HLSL: Add SampleCmp and SampleCmpLevelZero texture methods
This commit is contained in:
parent
934855a642
commit
a78b02941b
21 changed files with 5143 additions and 49 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue