Parser: Add 64-bit type conversion for specialization constant.

This commit is contained in:
Rex Xu
2016-09-05 16:10:14 +08:00
parent 7d01bd6f0b
commit 64bcfdb632
8 changed files with 183 additions and 96 deletions

View File

@@ -3761,8 +3761,8 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec
case glslang::EOpConvInt64ToUint64:
if (builder.isInSpecConstCodeGenMode()) {
// Build zero scalar or vector for OpIAdd.
zero = (op == glslang::EOpConvUintToInt64 ||
op == glslang::EOpConvIntToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
zero = (op == glslang::EOpConvUint64ToInt64 ||
op == glslang::EOpConvInt64ToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0);
zero = makeSmearedConstant(zero, vectorSize);
// Use OpIAdd, instead of OpBitcast to do the conversion when
// generating for OpSpecConstantOp instruction.