mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 18:48:28 +02:00
nvc0/ir: fix picking of coordinates from tex instruction for textureGrad
On Fermi, there's an argument in front of the coords that combines array and indirect handle, while on Kepler the array and the indirect handle are separate (and in front of the coords). We were previously only accounting for the array bit of it, if there were an indirect access it wouldn't be counted in the formula. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
6711f159d9
commit
f667d15561
1 changed files with 11 additions and 1 deletions
|
|
@ -874,7 +874,17 @@ NVC0LoweringPass::handleManualTXD(TexInstruction *i)
|
|||
Value *zero = bld.loadImm(bld.getSSA(), 0);
|
||||
int l, c;
|
||||
const int dim = i->tex.target.getDim() + i->tex.target.isCube();
|
||||
const int array = i->tex.target.isArray();
|
||||
|
||||
// This function is invoked after handleTEX lowering, so we have to expect
|
||||
// the arguments in the order that the hw wants them. For Fermi, array and
|
||||
// indirect are both in the leading arg, while for Kepler, array and
|
||||
// indirect are separate (and both precede the coordinates). Maxwell is
|
||||
// handled in a separate function.
|
||||
unsigned array;
|
||||
if (targ->getChipset() < NVISA_GK104_CHIPSET)
|
||||
array = i->tex.target.isArray() || i->tex.rIndirectSrc >= 0;
|
||||
else
|
||||
array = i->tex.target.isArray() + (i->tex.rIndirectSrc >= 0);
|
||||
|
||||
i->op = OP_TEX; // no need to clone dPdx/dPdy later
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue