mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2025-01-12 09:20:15 +00:00
spirv-opt: Add spvOpcodeIsAccessChain (#3682)
This commit is contained in:
parent
b7056e7e03
commit
f505538677
@ -719,3 +719,15 @@ std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode) {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool spvOpcodeIsAccessChain(SpvOp opcode) {
|
||||||
|
switch (opcode) {
|
||||||
|
case SpvOpAccessChain:
|
||||||
|
case SpvOpInBoundsAccessChain:
|
||||||
|
case SpvOpPtrAccessChain:
|
||||||
|
case SpvOpInBoundsPtrAccessChain:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -144,4 +144,7 @@ bool spvOpcodeIsImageSample(SpvOp opcode);
|
|||||||
// operands for |opcode|.
|
// operands for |opcode|.
|
||||||
std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode);
|
std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode);
|
||||||
|
|
||||||
|
// Returns true for opcodes that represents access chain instructions.
|
||||||
|
bool spvOpcodeIsAccessChain(SpvOp opcode);
|
||||||
|
|
||||||
#endif // SOURCE_OPCODE_H_
|
#endif // SOURCE_OPCODE_H_
|
||||||
|
Loading…
Reference in New Issue
Block a user