|
@@ -61,6 +61,8 @@ bool HasReturnType(uint32_t opcode) {
|
|
|
bool HasOnlyFloatReturnType(uint32_t opcode) {
|
|
bool HasOnlyFloatReturnType(uint32_t opcode) {
|
|
|
switch (opcode) {
|
|
switch (opcode) {
|
|
|
case SpvOpAtomicFAddEXT:
|
|
case SpvOpAtomicFAddEXT:
|
|
|
|
|
+ case SpvOpAtomicFMinEXT:
|
|
|
|
|
+ case SpvOpAtomicFMaxEXT:
|
|
|
return true;
|
|
return true;
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
@@ -132,8 +134,10 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) {
|
|
|
case SpvOpAtomicISub:
|
|
case SpvOpAtomicISub:
|
|
|
case SpvOpAtomicSMin:
|
|
case SpvOpAtomicSMin:
|
|
|
case SpvOpAtomicUMin:
|
|
case SpvOpAtomicUMin:
|
|
|
|
|
+ case SpvOpAtomicFMinEXT:
|
|
|
case SpvOpAtomicSMax:
|
|
case SpvOpAtomicSMax:
|
|
|
case SpvOpAtomicUMax:
|
|
case SpvOpAtomicUMax:
|
|
|
|
|
+ case SpvOpAtomicFMaxEXT:
|
|
|
case SpvOpAtomicAnd:
|
|
case SpvOpAtomicAnd:
|
|
|
case SpvOpAtomicOr:
|
|
case SpvOpAtomicOr:
|
|
|
case SpvOpAtomicXor:
|
|
case SpvOpAtomicXor:
|
|
@@ -232,6 +236,29 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) {
|
|
|
<< ": float add atomics require the AtomicFloat64AddEXT "
|
|
<< ": float add atomics require the AtomicFloat64AddEXT "
|
|
|
"capability";
|
|
"capability";
|
|
|
}
|
|
}
|
|
|
|
|
+ } else if (opcode == SpvOpAtomicFMinEXT ||
|
|
|
|
|
+ opcode == SpvOpAtomicFMaxEXT) {
|
|
|
|
|
+ if ((_.GetBitWidth(result_type) == 16) &&
|
|
|
|
|
+ (!_.HasCapability(SpvCapabilityAtomicFloat16MinMaxEXT))) {
|
|
|
|
|
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
|
|
|
|
|
+ << spvOpcodeString(opcode)
|
|
|
|
|
+ << ": float min/max atomics require the "
|
|
|
|
|
+ "AtomicFloat16MinMaxEXT capability";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ((_.GetBitWidth(result_type) == 32) &&
|
|
|
|
|
+ (!_.HasCapability(SpvCapabilityAtomicFloat32MinMaxEXT))) {
|
|
|
|
|
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
|
|
|
|
|
+ << spvOpcodeString(opcode)
|
|
|
|
|
+ << ": float min/max atomics require the "
|
|
|
|
|
+ "AtomicFloat32MinMaxEXT capability";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ((_.GetBitWidth(result_type) == 64) &&
|
|
|
|
|
+ (!_.HasCapability(SpvCapabilityAtomicFloat64MinMaxEXT))) {
|
|
|
|
|
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
|
|
|
|
|
+ << spvOpcodeString(opcode)
|
|
|
|
|
+ << ": float min/max atomics require the "
|
|
|
|
|
+ "AtomicFloat64MinMaxEXT capability";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|