HLSL: Fix #1423: implement CalculateLevelOfDetailUnclamped().

(If there is a bias issue, we need to discover what it is.)
This commit is contained in:
John Kessenich
2018-07-02 18:52:14 -06:00
parent ab8960fd12
commit dccfeedfc3
2 changed files with 244 additions and 39 deletions

View File

@@ -4377,16 +4377,13 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
txquerylod->getSequence().push_back(txcombine);
txquerylod->getSequence().push_back(argCoord);
TIntermTyped* lodComponent = intermediate.addConstantUnion(0, loc, true);
TIntermTyped* lodComponent = intermediate.addConstantUnion(
op == EOpMethodCalculateLevelOfDetail ? 0 : 1,
loc, true);
TIntermTyped* lodComponentIdx = intermediate.addIndex(EOpIndexDirect, txquerylod, lodComponent, loc);
lodComponentIdx->setType(TType(EbtFloat, EvqTemporary, 1));
node = lodComponentIdx;
// We cannot currently obtain the unclamped LOD
if (op == EOpMethodCalculateLevelOfDetailUnclamped)
error(loc, "unimplemented: CalculateLevelOfDetailUnclamped", "", "");
break;
}