mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
nvc0/ir: fix overwriting of value backing non-constant gather offset
Normally the value is an immediate, which is moved to some temporary, so there's no problem. In the case of a non-constant offset (as allowed by ARB_gpu_shader5), we have to take care to copy it first before using it to build up the bits. This fixes a compilation error observed in F1 2015. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
parent
0a898ec28b
commit
5239bd5920
1 changed files with 2 additions and 2 deletions
|
|
@ -820,11 +820,11 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
|
|||
// Either there is 1 offset, which goes into the 2 low bytes of the
|
||||
// first source, or there are 4 offsets, which go into 2 sources (8
|
||||
// values, 1 byte each).
|
||||
Value *offs[2] = {NULL, NULL};
|
||||
Value *offs[2] = {bld.getScratch(), bld.getScratch()};
|
||||
for (n = 0; n < i->tex.useOffsets; n++) {
|
||||
for (c = 0; c < 2; ++c) {
|
||||
if ((n % 2) == 0 && c == 0)
|
||||
offs[n / 2] = i->offset[n][c].get();
|
||||
bld.mkMov(offs[n / 2], i->offset[n][c].get());
|
||||
else
|
||||
bld.mkOp3(OP_INSBF, TYPE_U32,
|
||||
offs[n / 2],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue