summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-05-20 16:25:59 -0700
committerKenneth Graunke <kenneth@whitecape.org>2011-05-20 16:33:43 -0700
commit9be8524af753791d26fbd65417c5380b4d934296 (patch)
treeccdf1917e6df1f1770b7ac337fe961d71913d2aa
parent24de02acaca2ed2e5149a6a026b8707cd0d6d27f (diff)
i965: Fix sampling on Ivybridge after headerless change.
Fixes a regression since 90e922267a89fa9bef254bb257405531ceff7356. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index eb954c8bf9..6d545afab6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1388,9 +1388,19 @@ fs_inst *
fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
int sampler)
{
- int mlen = 1; /* g0 header always present. */
- int base_mrf = 1;
+ int mlen = 0;
+ int base_mrf = 2;
int reg_width = c->dispatch_width / 8;
+ bool header_present = false;
+
+ if (ir->offset) {
+ /* The offsets set up by the ir_texture visitor are in the
+ * m1 header, so we can't go headerless.
+ */
+ header_present = true;
+ mlen++;
+ base_mrf--;
+ }
if (ir->shadow_comparitor) {
ir->shadow_comparitor->accept(this);
@@ -1439,6 +1449,7 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
}
inst->base_mrf = base_mrf;
inst->mlen = mlen;
+ inst->header_present = header_present;
if (mlen > 11) {
fail("Message length >11 disallowed by hardware\n");