i965: Upload SAMPLER_STATE pointers for the VS on Ivybridge.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 7 Nov 2011 06:51:53 +0000 (22:51 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 11 Nov 2011 06:51:19 +0000 (22:51 -0800)
See similar code in gen7_wm_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/gen7_vs_state.c

index e3234b593b039540fd19c80e3d7e0e86604b1f85..558933c2c4cdc5690a15e4e037569f01bdf31494 100644 (file)
@@ -40,6 +40,12 @@ upload_vs_state(struct brw_context *brw)
    OUT_BATCH(brw->bind.bo_offset);
    ADVANCE_BATCH();
 
+   /* CACHE_NEW_SAMPLER */
+   BEGIN_BATCH(2);
+   OUT_BATCH(_3DSTATE_SAMPLER_STATE_POINTERS_VS << 16 | (2 - 2));
+   OUT_BATCH(brw->sampler.offset);
+   ADVANCE_BATCH();
+
    if (brw->vs.push_const_size == 0) {
       /* Disable the push constant buffers. */
       BEGIN_BATCH(7);
@@ -104,7 +110,7 @@ const struct brw_tracked_state gen7_vs_state = {
                BRW_NEW_VERTEX_PROGRAM |
                BRW_NEW_VS_BINDING_TABLE |
                BRW_NEW_BATCH),
-      .cache = CACHE_NEW_VS_PROG
+      .cache = CACHE_NEW_VS_PROG | CACHE_NEW_SAMPLER
    },
    .emit = upload_vs_state,
 };