[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gl-320 primitive-point-quad vertex shader #60

Closed
wants to merge 1 commit into from
Closed

Fix gl-320 primitive-point-quad vertex shader #60

wants to merge 1 commit into from

Conversation

ghost
Copy link
@ghost ghost commented Dec 7, 2015

From section 7.1 (Built-In Language Variables) of the GLSL 4.10 spec:

 "If multiple shaders using members of a built-in block belonging
 to the same interface are linked together in the same program,
 they must all redeclare the built-in block in the same way, as
 described in section 4.3.7 "Interface Blocks" for interface
 block matching, or a link error will result.  It will also be a
 link error if some shaders in a program redeclare a specific
 built-in interface block while another shader in that program
 does not redeclare that interface block yet still uses a member
 of that interface block."

This fixes the test for Mesa drivers which seem to be the only drivers that follow the spec.

From section 7.1 (Built-In Language Variables) of the GLSL 4.10  spec:

     "If multiple shaders using members of a built-in block belonging
     to the same interface are linked together in the same program,
     they must all redeclare the built-in block in the same way, as
     described in section 4.3.7 "Interface Blocks" for interface
     block matching, or a link error will result.  It will also be a
     link error if some shaders in a program redeclare a specific
     built-in interface block while another shader in that program
     does not redeclare that interface block yet still uses a member
     of that interface block."
@Groovounet
Copy link
Member

"The gl_PerVertex block can be redeclared in a shader to explicitly indicate what subset of the fixed
pipeline interface will be used. This is necessary to establish the interface between multiple programs.
For example:
out gl_PerVertex {
vec4 gl_Position; // will use gl_Position
float gl_PointSize; // will use gl_PointSize
vec4 t; // error, only gl_PerVertex members allowed
}; // no other members of gl_PerVertex will be used
This establishes the output interface the shader will use with the subsequent pipeline stage. It must be a subset of the built-in members of gl_PerVertex.
If a built-in interface block is redeclared, it must appear in the shader before any use of any member
included in the built-in declaration, or a compilation error will result. It is also a compilation error to
redeclare the block more than once or to redeclare a built-in block and then use a member from that builtin block that was not included in the redeclaration. Also, if a built-in interface block is redeclared, no member of the built-in declaration can be redeclared outside the block redeclaration. If multiple shaders using members of a built-in block belonging to the same interface are linked together in the same program, they must all redeclare the built-in block in the same way, as described in section 4.3.7 “Interface Blocks” for interface block matching, or a link error will result. It will also be a link error if some shaders in a program redeclare a specific built-in interface block while another shader in that program does not redeclare that interface block yet still uses a member of that interface block. If a builtin block interface is formed across shaders in different programs, the shaders must all redeclare the builtin block in the same way (as described for a single program), or the values passed along the interface are undefined."

@Groovounet Groovounet closed this Dec 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant