GL_EXT_vulkan_glsl_relaxed - retarget gl_VertexID to gl_VertexIndex

instead of allowing for multiple declarations of the variable in the
resulting SPIR-V, instead use a retargeted mechanism to cause references
to gl_VertexID and gl_InstanceID to use the gl_VertexIndex and
gl_InstanceIndex symbol.
This commit is contained in:
Malcolm Bechard
2021-09-16 17:40:49 -04:00
parent 80dcc36907
commit 05794b46a7
7 changed files with 133 additions and 59 deletions

View File

@@ -25,7 +25,7 @@ vec4 foo() {
void main() {
vec4 v = foo();
v = v + s[gl_VertexID];
v.x = v.x - float(gl_InstanceID);
v = v + s[gl_VertexID - gl_VertexIndex];
v.x = v.x - float(gl_InstanceID - gl_InstanceIndex);
io = v;
}
}