HLSL: Add SampleCmp and SampleCmpLevelZero texture methods

This commit is contained in:
LoopDawg 2016-07-19 14:28:05 -06:00
parent 934855a642
commit a78b02941b
21 changed files with 5143 additions and 49 deletions

View file

@ -661,8 +661,11 @@ bool HlslGrammar::acceptSamplerType(TType& type)
// read sampler type
const EHlslTokenClass samplerType = peek();
// TODO: for DX9
// TSamplerDim dim = EsdNone;
bool isShadow = false;
switch (samplerType) {
case EHTokSampler: break;
case EHTokSampler1d: /*dim = Esd1D*/; break;
@ -670,7 +673,7 @@ bool HlslGrammar::acceptSamplerType(TType& type)
case EHTokSampler3d: /*dim = Esd3D*/; break;
case EHTokSamplerCube: /*dim = EsdCube*/; break;
case EHTokSamplerState: break;
case EHTokSamplerComparisonState: break;
case EHTokSamplerComparisonState: isShadow = true; break;
default:
return false; // not a sampler declaration
}
@ -678,10 +681,9 @@ bool HlslGrammar::acceptSamplerType(TType& type)
advanceToken(); // consume the sampler type keyword
TArraySizes* arraySizes = nullptr; // TODO: array
bool shadow = false; // TODO: shadow
TSampler sampler;
sampler.setPureSampler(shadow);
sampler.setPureSampler(isShadow);
type.shallowCopy(TType(sampler, EvqUniform, arraySizes));