-
Notifications
You must be signed in to change notification settings - Fork 853
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
Can't redeclare gl_perVertex (for gl_ClipDistance as a passthrough) #1441
Comments
Redeclaring blocks needs GL_ARB_separate_shader_objects or #version 410. |
I don't understand, it says on the documentation page for gl_ClipDistance that you need to redeclare it: Is there a way to pass through gl_ClipDistance in a geometry shader in 150? From the 150 spec is says:
This implies a redeclaring of the interface block in order for the geometry shader to see the gl_ClipDistance array. |
I don't think you can redeclare blocks in base #version 150. This might work:
Or, going to a higher #version, or using extensions. Do you need #version 150? #version 150 was a complex juncture between blocks, redeclarations, SSO, extensions, and profiles in this space. If it is possible to get away from it, it would probably save time. |
I found a workaround, by taking advantage of that other half of that clause "or indexing with integral constant expressions". It isn't ideal, but it works and compiles without warning or errors. Your suggestion works fine in a vertex shader, but... there's an array for the geometry shader. That's the part that is causing me problems. Yeah I can't bump the version number. |
I have this for a 330 core shader:
Is the way of redeclaring gl_ClipDistance wrong? I'm using version 7.11.3170 btw. |
Going to For |
I forgot to say that this is a vertex shader. The wiki page does not state a specific version requirement btw. The reference page and the built-in wiki page doesn't either. |
GLSL issues outside of glslang can be raised at https://github.com/KhronosGroup/GLSL. |
z |
Using glslangValidator, version 7.7.2776 and 7.8.2801 I get the following results:
Reproduction:
a.vert:
b.geom:
Observation:
The error is:
Expectation:
My understanding is that redeclaring the gl_PerVertex is necessary to define the size of gl_ClipDistance, so I think that the code is correct and the compiler's error message is not. Further, the code does actually work on at least one system. ;)
Lastly, I see in the code with the error message that there's a call to profileRequires what looks like versions 320 and 410 of ES? I didn't see that in the documentation for gl_ClipDistance. Shouldn't it be version 130 for the vertex and 150 for the geometry?
The text was updated successfully, but these errors were encountered: