HLSL: force textures to shadow modes from combined samplers
Texture shadow mode must match the state of the sampler they are combined with. This change does that, both for the AST and the symbol table. Note that the texture cannot easily be *created* the right way, because this may not be known at that time. Instead, the texture is subsequently patched. This cannot work if a single texture is used with both a shadow and non-shadow sampler, so that case is detected and generates an error. This is permitted by the HLSL language, however. See #1073 discussion. Fixed one test source that was using a texture with both shadow and non-shadow samplers.
This commit is contained in:
@@ -262,6 +262,7 @@ protected:
|
||||
bool wasSplit(int id) const { return splitNonIoVars.find(id) != splitNonIoVars.end(); }
|
||||
TVariable* getSplitNonIoVar(int id) const;
|
||||
void addPatchConstantInvocation();
|
||||
void fixTextureShadowModes();
|
||||
TIntermTyped* makeIntegerIndex(TIntermTyped*);
|
||||
|
||||
void fixBuiltInIoType(TType&);
|
||||
@@ -455,6 +456,11 @@ protected:
|
||||
};
|
||||
|
||||
TVector<tMipsOperatorData> mipsOperatorMipArg;
|
||||
|
||||
// This can be removed if and when the texture shadow workarounnd in
|
||||
// HlslParseContext::handleSamplerTextureCombine is removed. It maps
|
||||
// texture symbol IDs to the shadow modes of samplers they were combined with.
|
||||
TMap<int, bool> textureShadowMode;
|
||||
};
|
||||
|
||||
// This is the prefix we use for built-in methods to avoid namespace collisions with
|
||||
|
||||
Reference in New Issue
Block a user