mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-23 12:10:06 +00:00
Accept OpBitCast in fix storage class. (#2505)
Fixes http://crbug.com/950889.
This commit is contained in:
parent
d90aae9a5a
commit
9047de51cb
@ -68,6 +68,7 @@ bool FixStorageClass::PropagateStorageClass(Instruction* inst,
|
||||
case SpvOpCopyMemory:
|
||||
case SpvOpCopyMemorySized:
|
||||
case SpvOpVariable:
|
||||
case SpvOpBitcast:
|
||||
// Nothing to change for these opcode. The result type is the same
|
||||
// regardless of the storage class of the operand.
|
||||
return false;
|
||||
|
@ -440,6 +440,25 @@ TEST_F(FixStorageClassTest, FixSelect) {
|
||||
SinglePassRunAndMatch<FixStorageClass>(text, false);
|
||||
}
|
||||
|
||||
TEST_F(FixStorageClassTest, BitCast) {
|
||||
const std::string text = R"(OpCapability VariablePointersStorageBuffer
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint GLCompute %1 "main"
|
||||
%void = OpTypeVoid
|
||||
%3 = OpTypeFunction %void
|
||||
%_ptr_Output_void = OpTypePointer Output %void
|
||||
%_ptr_Private__ptr_Output_void = OpTypePointer Private %_ptr_Output_void
|
||||
%6 = OpVariable %_ptr_Private__ptr_Output_void Private
|
||||
%1 = OpFunction %void Inline %3
|
||||
%7 = OpLabel
|
||||
%8 = OpBitcast %_ptr_Output_void %6
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
)";
|
||||
|
||||
SinglePassRunAndCheck<FixStorageClass>(text, text, false);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace opt
|
||||
} // namespace spvtools
|
||||
|
Loading…
Reference in New Issue
Block a user