Manually merge ClemensRognerSD-dx9-sampler and resolve conflicts.

This commit is contained in:
John Kessenich
2018-12-07 18:38:26 -07:00
parent 5d43c4aac7
commit bd1c1831d5
13 changed files with 1060 additions and 8 deletions

View File

@@ -3770,6 +3770,43 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
break;
}
case EOpTextureLod: //is almost EOpTextureBias (only args & operations are different)
{
TIntermTyped *argSamp = argAggregate->getSequence()[0]->getAsTyped(); // sampler
TIntermTyped *argCoord = argAggregate->getSequence()[1]->getAsTyped(); // coord
assert(argCoord->getVectorSize() == 4);
TIntermTyped *w = intermediate.addConstantUnion(3, loc, true);
TIntermTyped *argLod = intermediate.addIndex(EOpIndexDirect, argCoord, w, loc);
TOperator constructOp = EOpNull;
const TSampler &sampler = argSamp->getType().getSampler();
int coordSize = 0;
switch (sampler.dim)
{
case Esd1D: constructOp = EOpConstructFloat; coordSize = 1; break; // 1D
case Esd2D: constructOp = EOpConstructVec2; coordSize = 2; break; // 2D
case Esd3D: constructOp = EOpConstructVec3; coordSize = 3; break; // 3D
case EsdCube: constructOp = EOpConstructVec3; coordSize = 3; break; // also 3D
default:
break;
}
TIntermAggregate *constructCoord = new TIntermAggregate(constructOp);
constructCoord->getSequence().push_back(argCoord);
constructCoord->setLoc(loc);
constructCoord->setType(TType(argCoord->getBasicType(), EvqTemporary, coordSize));
TIntermAggregate *tex = new TIntermAggregate(EOpTextureLod);
tex->getSequence().push_back(argSamp); // sampler
tex->getSequence().push_back(constructCoord); // coordinate
tex->getSequence().push_back(argLod); // lod
node = convertReturn(tex, sampler);
break;
}
case EOpTextureBias:
{