PDA

View Full Version : GLSL 4.5 Specification - Confusion about Interface Blocks



Xzander
08-18-2017, 10:52 PM
Hi,

I'm a bit confused by parts of section 4.3.9 of the GLSL 4.5 specification. That section is about interface blocks. Everything is fine until after the definition of shader interfaces.

From what I understand, in a program:

The set of all the uniform variables and uniform blocks forms 1 shader interface.
The set of all buffer blocks forms 1 shader interface.
For every boundary between adjacent pipeline stages, the set of all out/in variables forms 1 shader interface.

So far so good, but here comes the confusion.

The block name is used to match within shader interfaces: an output block of one pipeline stage will be matched to an input block with the same name in the subsequent pipeline stage.
Ok, fine, but what about the matching of buffer blocks (e.g. declared in different shaders of the same program, thus part of the same shader interface)? Same question about uniform blocks...

For uniform blocks, the application uses the block name to identify the block
Great, but there is no equivalent mention for buffer blocks. Why?

Matched uniform block names (but not input or output block names) must also either all be lacking an instance name or all having an instance name
And what about buffer blocks?

Any help would be greatly appreciated, thanks!

Alfonse Reinheart
08-19-2017, 06:48 PM
Ok, fine, but what about the matching of buffer blocks (e.g. declared in different shaders of the same program, thus part of the same shader interface)? Same question about uniform blocks...

You go on to quote how interface block matching works. It's in the very next paragraph.


Great, but there is no equivalent mention for buffer blocks. Why?

Because it's a bug in the spec (https://github.com/KhronosGroup/OpenGL-GLSL/issues/3).

Xzander
08-21-2017, 02:49 PM
Thanks for your reply. Then I may have found another issue. In section 4.4 "Layout Qualifiers", it says "They can also appear
with just an interface qualifier (a storage qualifier that is in, out, or uniform)". Here again, buffer seems to be missing. Maybe it should be in your ticket too.