HLSL: Sampler/texture declarations, method syntax, partial Sample method

This commit is contained in:
LoopDawg 2016-06-29 10:58:58 -06:00
parent d8509b3367
commit 4886f69734
13 changed files with 1387 additions and 74 deletions

View file

@ -84,6 +84,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isCombined() const { return combined; }
bool isPureSampler() const { return sampler; }
bool isTexture() const { return !sampler && !image; }
bool isShadow() const { return shadow; }
void clear()
{
@ -1080,6 +1081,15 @@ public:
typeName = NewPoolTString(p.userDef->getTypeName().c_str());
}
}
// for construction of sampler types
TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false),
arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
sampler(sampler)
{
qualifier.clear();
qualifier.storage = q;
}
// to efficiently make a dereferenced type
// without ever duplicating the outer structure that will be thrown away
// and using only shallow copy

View file

@ -525,6 +525,8 @@ enum TOperator {
EOpLit, // HLSL lighting coefficient vector
EOpTextureBias, // HLSL texture bias: will be lowered to EOpTexture
EOpAsDouble, // slightly different from EOpUint64BitsToDouble
EOpMethodSample,
};
class TIntermTraverser;