Add decompositions for some HLSL intrinsics.

This commit is contained in:
LoopDawg 2016-06-09 08:57:35 -06:00
parent 41ebc42926
commit 592860cae5
11 changed files with 5546 additions and 3245 deletions

View file

@ -1,5 +1,5 @@
//
//Copyright (C) 2014-2015 LunarG, Inc.
//Copyright (C) 2014-2016 LunarG, Inc.
//Copyright (C) 2015-2016 Google, Inc.
//
//All rights reserved.
@ -3032,7 +3032,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec
return builder.setPrecision(result, precision);
}
// Handle component-wise +, -, *, and / for all combinations of type.
// Handle component-wise +, -, *, %, and / for all combinations of type.
// The result type of all of them is the same type as the (a) matrix operand.
// The algorithm is to:
// - break the matrix(es) into vectors
@ -3043,6 +3043,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec
case spv::OpFAdd:
case spv::OpFSub:
case spv::OpFDiv:
case spv::OpFMod:
case spv::OpFMul:
{
// one time set up...
@ -3209,6 +3210,9 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
case glslang::EOpIsInf:
unaryOp = spv::OpIsInf;
break;
case glslang::EOpIsFinite:
unaryOp = spv::OpIsFinite;
break;
case glslang::EOpFloatBitsToInt:
case glslang::EOpFloatBitsToUint: