summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-04-05 12:48:32 +0200
committerSamuel Pitoiset <[email protected]>2016-04-26 19:47:49 +0200
commit8b540db44cd9adadd98d98d184ad9fe5afc4f1ac (patch)
tree459733b74ed823b33b452f750f69ab21cfe8f865 /src
parente478156ed7b57724fd189efd5c4ac42e769f6d04 (diff)
nvc0/ir: fix 1D arrays images for Kepler
For 1D arrays, the array index is stored in the Z component. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
index e23141b2dd2..6a3c7e92f8a 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
@@ -1628,13 +1628,20 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su)
// calculate clamped coordinates
for (c = 0; c < arg; ++c) {
+ int dimc = c;
+
+ if (c == 1 && su->tex.target == TEX_TARGET_1D_ARRAY) {
+ // The array index is stored in the Z component for 1D arrays.
+ dimc = 2;
+ }
+
src[c] = bld.getScratch();
if (c == 0 && raw)
v = loadSuInfo32(NULL, base + NVE4_SU_INFO_RAW_X);
else
- v = loadSuInfo32(NULL, base + NVE4_SU_INFO_DIM(c));
+ v = loadSuInfo32(NULL, base + NVE4_SU_INFO_DIM(dimc));
bld.mkOp3(OP_SUCLAMP, TYPE_S32, src[c], su->getSrc(c), v, zero)
- ->subOp = getSuClampSubOp(su, c);
+ ->subOp = getSuClampSubOp(su, dimc);
}
for (; c < 3; ++c)
src[c] = zero;