Implement extension GL_NV_shader_atomic_int64

This commit is contained in:
Rex Xu
2017-09-26 15:42:56 +08:00
parent f21c173a05
commit e8fe8b0de9
8 changed files with 347 additions and 3 deletions

View File

@@ -4749,12 +4749,12 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
case glslang::EOpAtomicMin:
case glslang::EOpImageAtomicMin:
case glslang::EOpAtomicCounterMin:
opCode = typeProxy == glslang::EbtUint ? spv::OpAtomicUMin : spv::OpAtomicSMin;
opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? spv::OpAtomicUMin : spv::OpAtomicSMin;
break;
case glslang::EOpAtomicMax:
case glslang::EOpImageAtomicMax:
case glslang::EOpAtomicCounterMax:
opCode = typeProxy == glslang::EbtUint ? spv::OpAtomicUMax : spv::OpAtomicSMax;
opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? spv::OpAtomicUMax : spv::OpAtomicSMax;
break;
case glslang::EOpAtomicAnd:
case glslang::EOpImageAtomicAnd:
@@ -4795,6 +4795,9 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
break;
}
if (typeProxy == glslang::EbtInt64 || typeProxy == glslang::EbtUint64)
builder.addCapability(spv::CapabilityInt64Atomics);
// Sort out the operands
// - mapping from glslang -> SPV
// - there are extra SPV operands with no glslang source