SPV constants and constOffsets completion: isConstant() and disassembler to see results.
Expand to full isConstant() implementation. Fix disassembler to generate texture look-up masks.
This commit is contained in:
parent
d4a7a8e721
commit
716312771c
7 changed files with 74 additions and 57 deletions
|
|
@ -136,11 +136,8 @@ public:
|
|||
bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; }
|
||||
bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; }
|
||||
|
||||
bool isConstant(Id resultId) const
|
||||
{
|
||||
Op opCode = getOpCode(resultId);
|
||||
return opCode == OpConstantTrue || opCode == OpConstantFalse || opCode == OpConstant || opCode == OpConstantComposite || opCode == OpConstantNull;
|
||||
}
|
||||
bool isConstantOpCode(Op opcode) const;
|
||||
bool isConstant(Id resultId) const { return isConstantOpCode(getOpCode(resultId)); }
|
||||
bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; }
|
||||
unsigned int getConstantScalar(Id resultId) const { return module.getInstruction(resultId)->getImmediateOperand(0); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue