anv:gpu_memcpy: Emit 3DSTATE_VF_INDEXING on Gen8+
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 24 Apr 2020 17:27:21 +0000 (12:27 -0500)
committerMarge Bot <eric+marge@anholt.net>
Mon, 18 May 2020 21:42:05 +0000 (21:42 +0000)
If this gets run right after something which uses
VK_VERTEX_INPUT_RATE_INSTANCE on its first vertex binding, we could end
up in serious trouble.

Fixes: 3d9747780b "anv: Add a helper for doing buffer copies with..."
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5090>

src/intel/vulkan/genX_gpu_memcpy.c

index 504c70f3ef319b9f06c734de2b9804d8827576e8..57dc55ec39415902037d389e710b60c3616934a5 100644 (file)
@@ -112,6 +112,13 @@ genX(cmd_buffer_so_memcpy)(struct anv_cmd_buffer *cmd_buffer,
          .Component3Control = (bs >= 16) ? VFCOMP_STORE_SRC : VFCOMP_STORE_0,
       });
 
+#if GEN_GEN >= 8
+   anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_VF_INSTANCING), vfi) {
+      vfi.InstancingEnable = false;
+      vfi.VertexElementIndex = 0;
+   }
+#endif
+
 #if GEN_GEN >= 8
    anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_VF_SGVS), sgvs);
 #endif