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

@ -28,8 +28,8 @@ Shader version: 460
0:? Linker Objects
0:? 'io' (layout( location=0) smooth out highp 4-component vector of float)
0:? 'anon@0' (layout( column_major std140) uniform block{ uniform highp 2-component vector of float a})
0:? 'gl_VertexID' ( in int VertexIndex)
0:? 'gl_InstanceID' ( in int InstanceIndex)
0:? 'gl_VertexIndex' ( in int VertexIndex)
0:? 'gl_InstanceIndex' ( in int InstanceIndex)
vk.relaxed.errorcheck.frag
Shader version: 460
@ -94,8 +94,8 @@ Shader version: 460
0:? Linker Objects
0:? 'io' (layout( location=0) smooth out highp 4-component vector of float)
0:? 'anon@0' (layout( column_major std140) uniform block{ uniform highp 2-component vector of float a})
0:? 'gl_VertexID' ( in int VertexIndex)
0:? 'gl_InstanceID' ( in int InstanceIndex)
0:? 'gl_VertexIndex' ( in int VertexIndex)
0:? 'gl_InstanceIndex' ( in int InstanceIndex)
Shader version: 460
gl_FragCoord origin is upper left
0:? Sequence