Updated spirv-tools.

This commit is contained in:
Бранимир Караџић
2019-03-16 20:28:47 -07:00
parent 45a64efab9
commit b28dfbd770
27 changed files with 1106 additions and 44 deletions

View File

@@ -605,3 +605,35 @@ bool spvOpcodeIsDebug(SpvOp opcode) {
return false;
}
}
std::vector<uint32_t> spvOpcodeMemorySemanticsOperandIndices(SpvOp opcode) {
switch (opcode) {
case SpvOpMemoryBarrier:
return {1};
case SpvOpAtomicStore:
case SpvOpControlBarrier:
case SpvOpAtomicFlagClear:
case SpvOpMemoryNamedBarrier:
return {2};
case SpvOpAtomicLoad:
case SpvOpAtomicExchange:
case SpvOpAtomicIIncrement:
case SpvOpAtomicIDecrement:
case SpvOpAtomicIAdd:
case SpvOpAtomicISub:
case SpvOpAtomicSMin:
case SpvOpAtomicUMin:
case SpvOpAtomicSMax:
case SpvOpAtomicUMax:
case SpvOpAtomicAnd:
case SpvOpAtomicOr:
case SpvOpAtomicXor:
case SpvOpAtomicFlagTestAndSet:
return {4};
case SpvOpAtomicCompareExchange:
case SpvOpAtomicCompareExchangeWeak:
return {4, 5};
default:
return {};
}
}