Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Explicit bindings ignored

  1. #1

    Explicit bindings of uniforms ignored

    Edit: I am stupid!

    I need "location" not "binding" for uniforms.
    But why does glsl not complain

    the following bindings are ignored.
    The locations for my samplers start at 3, which implies that the interface block is bound at 0.
    More than that, the samplers location bindings are ignored as well and bould lexicographically

    Am I missing something or is this some gtx1070 driver problem?

    Best Regards

    #version 450
    #extension GL_ARB_explicit_uniform_location : require

    layout( binding = 0) uniform sampler2D normal ;
    layout( binding = 1) uniform sampler2D diffuse ;
    layout( binding = 2) uniform sampler2D specular ;
    layout( binding = 3) uniform usampler2D shininess ;
    layout( binding = 4) uniform sampler2D depth ;

    struct DeferredConstData
    mat4 P;
    mat4 Pinv;
    vec3 lightSourceV;

    layout(std140, binding = 5) uniform ConstantBuffer{

    DeferredConstData deferredConstData;
    Last edited by Christoph.LGDV; 11-30-2016 at 01:00 AM.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Quote Originally Posted by Christoph.LGDV View Post
    I need "location" not "binding" for uniforms.
    But why does glsl not complain
    "location" is correct for uniforms in the default uniform block, "binding" is correct for uniform blocks and for atomic counters.

    It seems likely that the compiler accepts any layout qualifier within layout(...) and just ignores those which aren't applicable to a particular declaration.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts