Is reuse of bindings for multiple Shader memory blocks legal

Suppose I have one shader storage buffer and you want to have several views in it, for example. eg:

layout(std430,binding=0) buffer FloatView { float floats[]; };
layout(std430,binding=0) buffer IntView { int ints[]; };

Is this legal GLSL? opengl.org says no:

Two blocks cannot use the same index.

However, I could not find such a statement in the GL 4.5 Core Spec or GLSL 4.50 Spec (or the description of the ARB_shader_storage_buffer_object extension ), and my NVIDIA driver seems to compile such code without errors or warnings.

+4
source share
1

OpenGL ? . , , , , .

, -. OpenGL .

"" , . .


. , -. , :

  • : , , , SSBOs.
  • , , (, ).

, . , GLSL .


7 GLSL 4.5:

.

"fixed", glUniform/ShaderStorageBlockBinding. , .

+4

Source: https://habr.com/ru/post/1624285/


All Articles