i965: Fix sampler state pointer adjustment for nonconst samplers
authorChris Forbes <chrisf@ijw.co.nz>
Tue, 4 Nov 2014 17:41:13 +0000 (06:41 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Wed, 5 Nov 2014 10:32:42 +0000 (23:32 +1300)
This started hitting an assertion recently. Only affects Haswell
(Ivybridge doesn't support this meddling with the sampler state pointer,
and ARB_gpu_shader5 is not enabled yet on Broadwell)

14 Piglits crash->pass.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu_emit.c

index bb6334ba38a72aaee083e68c90d059192f5c8514..bb12a26b926990b2cf3c8e2eef3e8dd76bd2038d 100644 (file)
@@ -2409,7 +2409,7 @@ void brw_adjust_sampler_state_pointer(struct brw_compile *p,
 
       struct brw_reg temp = vec1(retype(scratch, BRW_REGISTER_TYPE_UD));
 
-      brw_AND(p, temp, sampler_index, brw_imm_ud(0x0f0));
+      brw_AND(p, temp, get_element_ud(sampler_index, 0), brw_imm_ud(0x0f0));
       brw_SHL(p, temp, temp, brw_imm_ud(4));
       brw_ADD(p,
               get_element_ud(header, 3),