Add changes for SPV_EXT_shader_atomic_float_add

This commit is contained in:
Vikram Kushwaha
2020-07-19 15:45:01 -07:00
parent 1c42d4ee7b
commit 79b93923d2
13 changed files with 1109 additions and 5 deletions

View File

@@ -6682,6 +6682,14 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
case glslang::EOpImageAtomicAdd:
case glslang::EOpAtomicCounterAdd:
opCode = spv::OpAtomicIAdd;
if (typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) {
opCode = spv::OpAtomicFAddEXT;
builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_add);
if (typeProxy == glslang::EbtFloat)
builder.addCapability(spv::CapabilityAtomicFloat32AddEXT);
else
builder.addCapability(spv::CapabilityAtomicFloat64AddEXT);
}
break;
case glslang::EOpAtomicCounterSubtract:
opCode = spv::OpAtomicISub;