Merge pull request #337 from steve-lunarg/intrinsics

HLSL: Add decompositions for some intrinsics.
This commit is contained in:
John Kessenich
2016-06-13 08:54:45 -06:00
committed by GitHub
11 changed files with 5546 additions and 3245 deletions

View File

@@ -1,6 +1,6 @@
//
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//Copyright (C) 2012-2015 LunarG, Inc.
//Copyright (C) 2012-2016 LunarG, Inc.
//Copyright (C) 2015-2016 Google, Inc.
//
//All rights reserved.
@@ -1043,8 +1043,9 @@ public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
// for "empty" type (no args) or simple scalar/vector/matrix
explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(false),
explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
bool isVector = false) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr)
{
sampler.clear();
@@ -1052,8 +1053,9 @@ public:
qualifier.storage = q;
}
// for explicit precision qualifier
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(false),
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
bool isVector = false) :
basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr)
{
sampler.clear();

View File

@@ -1,6 +1,6 @@
//
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//Copyright (C) 2012-2013 LunarG, Inc.
//Copyright (C) 2012-2016 LunarG, Inc.
//
//All rights reserved.
//
@@ -493,6 +493,19 @@ enum TOperator {
EOpBitCount,
EOpFindLSB,
EOpFindMSB,
//
// HLSL operations
//
EOpClip,
EOpIsFinite,
EOpLog10,
EOpRcp,
EOpSaturate,
EOpSinCos,
EOpGenMul, // mul(x,y) on any of mat/vec/scalars
EOpDst,
};
class TIntermTraverser;

View File

@@ -1,6 +1,6 @@
//
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//Copyright (C) 2012-2013 LunarG, Inc.
//Copyright (C) 2012-2016 LunarG, Inc.
//
//All rights reserved.
//
@@ -359,6 +359,12 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpAllInvocations: out.debug << "allInvocations"; break;
case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break;
case EOpClip: out.debug << "clip"; break;
case EOpIsFinite: out.debug << "isfinite"; break;
case EOpLog10: out.debug << "log10"; break;
case EOpRcp: out.debug << "rcp"; break;
case EOpSaturate: out.debug << "saturate"; break;
default: out.debug.message(EPrefixError, "Bad unary op");
}
@@ -534,6 +540,9 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpInterpolateAtSample: out.debug << "interpolateAtSample"; break;
case EOpInterpolateAtOffset: out.debug << "interpolateAtOffset"; break;
case EOpSinCos: out.debug << "sincos"; break;
case EOpGenMul: out.debug << "mul"; break;
default: out.debug.message(EPrefixError, "Bad aggregation op");
}