summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-12-14 12:24:55 -0800
committerEric Anholt <[email protected]>2012-12-14 15:26:48 -0800
commit380fc562b35c57b0f97ea4325c578ed94efae220 (patch)
tree5d73dc2b77ef2fc1e8aefbdbaba5575f0bb4879e /src/mesa/drivers
parent3c560633548f4b0298a372903de32639706f8c40 (diff)
i965/fs: Fix setup for textureGrad(samplerCubeArray, coord, dPdx, dPdy)
Caught by tex_grad-01.frag. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 0959e47ad8d..8967a6ce321 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1103,13 +1103,18 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
coordinate.reg_offset++;
mlen += reg_width;
- emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
- lod.reg_offset++;
- mlen += reg_width;
-
- emit(MOV(fs_reg(MRF, base_mrf + mlen), lod2));
- lod2.reg_offset++;
- mlen += reg_width;
+ /* For cube map array, the coordinate is (u,v,r,ai) but there are
+ * only derivatives for (u, v, r).
+ */
+ if (i < ir->lod_info.grad.dPdx->type->vector_elements) {
+ emit(MOV(fs_reg(MRF, base_mrf + mlen), lod));
+ lod.reg_offset++;
+ mlen += reg_width;
+
+ emit(MOV(fs_reg(MRF, base_mrf + mlen), lod2));
+ lod2.reg_offset++;
+ mlen += reg_width;
+ }
}
break;
}