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

This topic contains 2 replies, has 3 voices, and was last updated by  chris 2 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31915

    sw123
    Member

    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?

    #39278

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

    #39279

    chris
    Moderator

    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.

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.