Commit 0339af3c by John Kessenich

GLSL/SPV: If a texture is used with a shadow sampler, force 'shadow'.

Fixes #854. But, only good if we are not trying to use the same texture for both shadow and non-shadow constructors. Force the type of the texture to have 'shadow' set when it is constructed with a samplerShadow.
parent fa4952c3
...@@ -5917,8 +5917,14 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* ...@@ -5917,8 +5917,14 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode*
// Combined texture-sampler constructors are completely semantic checked // Combined texture-sampler constructors are completely semantic checked
// in constructorTextureSamplerError() // in constructorTextureSamplerError()
if (op == EOpConstructTextureSampler) if (op == EOpConstructTextureSampler) {
if (aggrNode->getSequence()[1]->getAsTyped()->getType().getSampler().shadow) {
// Transfer depth into the texture (SPIR-V image) type, as a hint
// for tools to know this texture/image is a depth image.
aggrNode->getSequence()[0]->getAsTyped()->getWritableType().getSampler().shadow = true;
}
return intermediate.setAggregateOperator(aggrNode, op, type, loc); return intermediate.setAggregateOperator(aggrNode, op, type, loc);
}
TTypeList::const_iterator memberTypes; TTypeList::const_iterator memberTypes;
if (op == EOpConstructStruct) if (op == EOpConstructStruct)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment