aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2016-04-21 13:51:14 +0200
committerHans de Goede <[email protected]>2016-04-27 16:11:48 +0200
commit90f45357abd4f0007aa3f047464b43188fed4ef1 (patch)
tree81c444910d4c72704ee8182d0712d353401e896b /src/gallium/drivers
parent1958397a587919e4a3ec83441c3717813ba2f18b (diff)
nouveau: codegen: LOAD: Do not call fetchSrc(1) if the address is immediate
"off" later gets set to NULL when the address is immediate, so move the fetchSrc(1) call to the non-immediate branch of the if-else. This brings handleLOAD's offset handling inline with how it is done in handleSTORE. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index cdf9d9413e6..9b9f257b280 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -2383,14 +2383,15 @@ Converter::handleLOAD(Value *dst0[4])
if (!dst0[c])
continue;
- // yzw are ignored for buffers
- Value *off = fetchSrc(1, 0);
+ Value *off;
Symbol *sym;
if (tgsi.getSrc(1).getFile() == TGSI_FILE_IMMEDIATE) {
off = NULL;
sym = makeSym(tgsi.getSrc(0).getFile(), r, -1, c,
tgsi.getSrc(1).getValueU32(0, info) + 4 * c);
} else {
+ // yzw are ignored for buffers
+ off = fetchSrc(1, 0);
sym = makeSym(tgsi.getSrc(0).getFile(), r, -1, c, 4 * c);
}