mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-25 01:01:04 +00:00
Remove MemberDecorateStringGOOGLE during stript-refect. (#2021)
The strip-reflect pass is not removing the reflection decorations that are decorating members. With this commit, they will now be removed. Fixes #2019.
This commit is contained in:
parent
1c1e749f0b
commit
6647884a13
@ -39,6 +39,14 @@ Pass::Status StripReflectInfoPass::Process() {
|
||||
}
|
||||
break;
|
||||
|
||||
case SpvOpMemberDecorateStringGOOGLE:
|
||||
if (inst.GetSingleWordInOperand(2) == SpvDecorationHlslSemanticGOOGLE) {
|
||||
to_remove.push_back(&inst);
|
||||
} else {
|
||||
other_uses_for_decorate_string = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case SpvOpDecorateId:
|
||||
if (inst.GetSingleWordInOperand(1) ==
|
||||
SpvDecorationHlslCounterBufferGOOGLE) {
|
||||
|
@ -64,6 +64,27 @@ OpMemoryModel Logical Simple
|
||||
SinglePassRunAndCheck<StripReflectInfoPass>(before, after, false);
|
||||
}
|
||||
|
||||
TEST_F(StripLineReflectInfoTest, StripHlslSemanticOnMember) {
|
||||
// This is a non-sensical example, but exercises the instructions.
|
||||
std::string before = R"(OpCapability Shader
|
||||
OpCapability Linkage
|
||||
OpExtension "SPV_GOOGLE_decorate_string"
|
||||
OpExtension "SPV_GOOGLE_hlsl_functionality1"
|
||||
OpMemoryModel Logical Simple
|
||||
OpMemberDecorateStringGOOGLE %struct 0 HlslSemanticGOOGLE "foobar"
|
||||
%float = OpTypeFloat 32
|
||||
%_struct_3 = OpTypeStruct %float
|
||||
)";
|
||||
std::string after = R"(OpCapability Shader
|
||||
OpCapability Linkage
|
||||
OpMemoryModel Logical Simple
|
||||
%float = OpTypeFloat 32
|
||||
%_struct_3 = OpTypeStruct %float
|
||||
)";
|
||||
|
||||
SinglePassRunAndCheck<StripReflectInfoPass>(before, after, false);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace opt
|
||||
} // namespace spvtools
|
||||
|
Loading…
Reference in New Issue
Block a user