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
|
|
@ -500,6 +500,27 @@ Id Builder::findScalarConstant(Op typeClass, Id typeId, unsigned v1, unsigned v2
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool Builder::isConstantOpCode(Op opcode) const
|
||||
{
|
||||
switch (opcode) {
|
||||
case OpUndef:
|
||||
case OpConstantTrue:
|
||||
case OpConstantFalse:
|
||||
case OpConstant:
|
||||
case OpConstantComposite:
|
||||
case OpConstantSampler:
|
||||
case OpConstantNull:
|
||||
case OpSpecConstantTrue:
|
||||
case OpSpecConstantFalse:
|
||||
case OpSpecConstant:
|
||||
case OpSpecConstantComposite:
|
||||
case OpSpecConstantOp:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Id Builder::makeBoolConstant(bool b)
|
||||
{
|
||||
Id typeId = makeBoolType();
|
||||
|
|
@ -1194,7 +1215,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool fetch, b
|
|||
mask = (ImageOperandsMask)(mask | ImageOperandsOffsetMask);
|
||||
texArgs[numArgs++] = parameters.offset;
|
||||
}
|
||||
// TBD: if Offset is constant, use ImageOperandsConstOffsetMask
|
||||
if (parameters.offsets) {
|
||||
mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
|
||||
texArgs[numArgs++] = parameters.offsets;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue