Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Unknown layout specifier "binding = 1"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member Newbie
    Join Date
    Dec 2017
    Posts
    17

    Unknown layout specifier "binding = 1"

    I am atm creating a camera with the help of GLM. Everything went well until the point I had to specify a matrix4x4 uniform in my shader.
    I use layout specifiers to specify my uniforms. The big problem with this is, that it gives me an error: error C3008: unknown layout specifier 'binding = 1'.

    Does anyone know how I can fix this probem?

    (Sorry I do not know how to create codeblocks, if someone can explain this too I would be really gratefull)

    My vertex shader:

    Code glsl:
    #version 450
     
    layout(location=0) in vec3 position;
    layout(location=1) in vec4 colour;
    layout(location=2) in vec2 uv;
     
    out vec4 fragColour;
    out vec2 fragUV;
     
    layout(binding = 1)uniform mat4 orthoMat;
     
    void main()
    {
        fragColour = colour;
        gl_Position = vec4(orthoMat * vec4(position, 1.0));
        fragUV = vec2(uv.x, 1.0 - uv.y);
    }

    My fragment shader:

    Code glsl:
    #version 450
     
    in vec4 fragColour;
    in vec2 fragUV;
     
    out vec4 colour;
     
    layout(binding = 0) uniform sampler2D diffuse;
     
    void main()
    {
        vec4 textureColour = texture(diffuse, fragUV);
        colour = textureColour * fragColour;
    }
    Last edited by Dark Photon; 01-07-2018 at 12:50 PM.

Tags for this Thread

Posting Permissions

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