Hello! Thank you so much for making this crate! I currently found an issue while generating reflection data from SPIR-V code compiled in DXC (v1.7.2212).
OpCapability Shader
OpExtension "SPV_GOOGLE_hlsl_functionality1"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vert "vert" %in_var_POSITION %gl_Position
OpDecorateString %in_var_POSITION UserSemantic "POSITION"
OpDecorate %gl_Position BuiltIn Position
OpDecorateString %gl_Position UserSemantic "SV_POSITION"
OpDecorate %in_var_POSITION Location 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Input_v4float = OpTypePointer Input %v4float
%_ptr_Output_v4float = OpTypePointer Output %v4float
%void = OpTypeVoid
%10 = OpTypeFunction %void
%in_var_POSITION = OpVariable %_ptr_Input_v4float Input
%gl_Position = OpVariable %_ptr_Output_v4float Output
%vert = OpFunction %void None %10
%11 = OpLabel
%12 = OpLoad %v4float %in_var_POSITION
OpStore %gl_Position %12
OpReturn
OpFunctionEnd
vert {
exec_model: Vertex,
name: "vert",
vars: [
Input {
name: Some(
"in.var.POSITION",
),
location: (loc=0, comp=0),
ty: Vector(
VectorType {
scalar_ty: Float {
bits: 32,
},
nscalar: 4,
},
),
},
],
exec_modes: [],
}
It seems to completely skip the output variable for this vertex shader, which looks like it represents the built-in gl_Position from glsl. If I change the semantics of the output variable to POSITION
instead of SV_POSITION
we get the following output (which is intended):
vert {
exec_model: Vertex,
name: "vert",
vars: [
Input {
name: Some(
"in.var.POSITION",
),
location: (loc=0, comp=0),
ty: Vector(
VectorType {
scalar_ty: Float {
bits: 32,
},
nscalar: 4,
},
),
},
Output {
name: Some(
"out.var.POSITION",
),
location: (loc=0, comp=0),
ty: Vector(
VectorType {
scalar_ty: Float {
bits: 32,
},
nscalar: 4,
},
),
},
],
exec_modes: [],
}
This also happens in fragment shaders under the same code under the same semantics (SV_POSITION
). The built in variable is equivalent to gl_FragCoord under the fragment shader however. Note that I have toggled ref_all_rscs()
with no change whatsoever.