# Sampler name "texture" in fragment shader does not work (OpenGL ES Emulator 3.4 for Windows)

**URL:** <https://forums.imgtec.com/t/sampler-name-texture-in-fragment-shader-does-not-work-opengl-es-emulator-3-4-for-windows/2222>\
**Category:** PowerVR Insider\
**Created:** [December 19, 2014, 6:53am UTC](https://forums.imgtec.com/t/sampler-name-texture-in-fragment-shader-does-not-work-opengl-es-emulator-3-4-for-windows/2222 "2014-12-19T06:53:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sw123](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sw123](https://forums.imgtec.com/u/sw123)\
**Post date:** [December 19, 2014, 6:53am UTC](https://forums.imgtec.com/t/sampler-name-texture-in-fragment-shader-does-not-work-opengl-es-emulator-3-4-for-windows/2222/1 "2014-12-19T06:53:01Z")

</div>

When I define a texture sampler in my fragment shader with` uniform sampler2D texture;` and I try to get the uniform location with ` glGetUniformLocation(progId,“texture”); ` the function returns -1. This seems to be the same for all texture samplers names containing “texture”. `glGetActiveUniform` returned “PVR\_TEXTURE” as uniform name. Is this a bug, some debugging feature or something else?

---

<div class="post-metadata">

**Author:** ![dark\_photon](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/dark_photon/32/224_2.png) [@dark\_photon](https://forums.imgtec.com/u/dark_photon)\
**Post date:** [December 19, 2014, 4:59pm UTC](https://forums.imgtec.com/t/sampler-name-texture-in-fragment-shader-does-not-work-opengl-es-emulator-3-4-for-windows/2222/2 "2014-12-19T16:59:46Z")

</div>

“texture” is already a built-in function, defined in the global namespace. So I can easily see why the compiler wouldn’t like this.

---

<div class="post-metadata">

**Author:** ![ChrisPenrose](https://avatars.discourse-cdn.com/v4/letter/c/e36b37/32.png) [@ChrisPenrose](https://forums.imgtec.com/u/ChrisPenrose)\
**Post date:** [December 22, 2014, 9:40am UTC](https://forums.imgtec.com/t/sampler-name-texture-in-fragment-shader-does-not-work-opengl-es-emulator-3-4-for-windows/2222/3 "2014-12-22T09:40:55Z")

</div>

This can occur when using GLSL ES 1.0 shaders since ‘texture’ wasn’t a built-in function in that version of the language, so we convert it to ‘PVR\_TEXTURE’ before passing the shader to the host.  
  
  
  
However we currently have no logic in the uniform querying interface convert it back to ‘texture’ which is why you’re seeing this behaviour. I’ll file a bug report to add conversions to the uniform querying functions.
