[spirv] Fix the UserSemantic decoration string. (#2581)
This commit is contained in:
Родитель
3c20b0d808
Коммит
1d1033426b
|
@ -1923,7 +1923,7 @@ bool DeclResultIdMapper::createStageVars(
|
|||
|
||||
// Emit OpDecorate* instructions to link this stage variable with the HLSL
|
||||
// semantic it is created for
|
||||
spvBuilder.decorateHlslSemantic(varInstr, stageVar.getSemanticInfo().str);
|
||||
spvBuilder.decorateHlslSemantic(varInstr, stageVar.getSemanticStr());
|
||||
|
||||
// We have semantics attached to this decl, which means it must be a
|
||||
// function/parameter/variable. All are DeclaratorDecls.
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Run: %dxc -T vs_6_0 -E main -fspv-reflect
|
||||
|
||||
|
||||
// CHECK: OpExtension "SPV_GOOGLE_hlsl_functionality1"
|
||||
|
||||
// CHECK: OpName %in_var_POSITION "in.var.POSITION"
|
||||
// CHECK: OpName %in_var_TEXCOORD4 "in.var.TEXCOORD4"
|
||||
// CHECK: OpName %in_var_TEXCOORD5 "in.var.TEXCOORD5"
|
||||
|
||||
// CHECK: OpDecorateString %in_var_POSITION UserSemantic "POSITION"
|
||||
// CHECK: OpDecorateString %in_var_TEXCOORD4 UserSemantic "TEXCOORD4"
|
||||
// CHECK: OpDecorateString %in_var_TEXCOORD5 UserSemantic "TEXCOORD5"
|
||||
|
||||
// CHECK: %in_var_POSITION = OpVariable %_ptr_Input_v3float Input
|
||||
// CHECK: %in_var_TEXCOORD4 = OpVariable %_ptr_Input_mat4v3float Input
|
||||
// CHECK: %in_var_TEXCOORD5 = OpVariable %_ptr_Input_v4float Input
|
||||
|
||||
struct SInstanceData {
|
||||
float4x3 VisualToWorld;
|
||||
float4 Output;
|
||||
};
|
||||
|
||||
struct VS_INPUT {
|
||||
float3 Position : POSITION;
|
||||
SInstanceData InstanceData : TEXCOORD4;
|
||||
};
|
||||
|
||||
float4 main(const VS_INPUT v) : SV_Position {
|
||||
const SInstanceData I = v.InstanceData;
|
||||
return I.Output;
|
||||
}
|
|
@ -1427,6 +1427,11 @@ TEST_F(FileTest, SpirvStageIOAliasBuiltIn) {
|
|||
runFileTest("spirv.interface.alias-builtin.hlsl");
|
||||
}
|
||||
|
||||
// For testing UserSemantic decoration
|
||||
TEST_F(FileTest, SpirvUserSemanticVS) {
|
||||
runFileTest("spirv.user-semantic.vs.hlsl");
|
||||
}
|
||||
|
||||
TEST_F(FileTest, SpirvStageIO16bitTypes) {
|
||||
runFileTest("spirv.stage-io.16bit.hlsl");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче