i965: Set MOCS for 3DSTATE_INDEX_BUFFER on Gfx6/7 as well.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 20 Oct 2021 07:25:47 +0000 (00:25 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 28 Oct 2021 19:45:56 +0000 (19:45 +0000)
For some reason we were only setting this on Gfx8+.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13480>

src/mesa/drivers/dri/i965/genX_state_upload.c

index 42b665c..d514dfa 100644 (file)
@@ -862,6 +862,10 @@ genX(emit_index_buffer)(struct brw_context *brw)
 #endif
       ib.IndexFormat = brw_get_index_type(1 << index_buffer->index_size_shift);
 
+#if GFX_VER >= 6
+      ib.MOCS = brw_mocs(&brw->isl_dev, brw->ib.bo);
+#endif
+
       /* The VF cache designers apparently cut corners, and made the cache
        * only consider the bottom 32 bits of memory addresses.  If you happen
        * to have two index buffers which get placed exactly 4 GiB apart and
@@ -871,7 +875,6 @@ genX(emit_index_buffer)(struct brw_context *brw)
        */
       ib.BufferStartingAddress = ro_32_bo(brw->ib.bo, 0);
 #if GFX_VER >= 8
-      ib.MOCS = brw_mocs(&brw->isl_dev, brw->ib.bo);
       ib.BufferSize = brw->ib.size;
 #else
       ib.BufferEndingAddress = ro_bo(brw->ib.bo, brw->ib.size - 1);