From: Joe Konno <[email protected]>

BDW introduces separate packets for controlling instancing and system
generated values (eg vertex id and instance id).  We don't use
instancing, but still need to disable sgvs to avoid undefined behaviour
when some other driver (mesa) uses it.

Signed-off-by: Joe Konno <[email protected]>
Signed-off-by: Kristian Høgsberg <[email protected]>
---
 src/gen8_render.c  | 4 ++++
 src/gen9_render.c  | 3 +++
 src/i965_defines.h | 2 ++
 3 files changed, 9 insertions(+)

diff --git a/src/gen8_render.c b/src/gen8_render.c
index 8a8012d..c01d269 100644
--- a/src/gen8_render.c
+++ b/src/gen8_render.c
@@ -1001,6 +1001,10 @@ gen8_emit_vertex_element_state(VADriverContextP ctx)
        OUT_BATCH(batch, i);
        OUT_BATCH(batch, 0);
     }
+
+    /* Disable system-generated values. */
+    OUT_BATCH(batch, GEN8_3DSTATE_VF_SGVS | (2 - 2));
+    OUT_BATCH(batch, 0);
 }
 
 static void
diff --git a/src/gen9_render.c b/src/gen9_render.c
index 8823d33..ee7a4db 100644
--- a/src/gen9_render.c
+++ b/src/gen9_render.c
@@ -936,6 +936,9 @@ gen9_emit_vertices(VADriverContextP ctx)
     OUT_BATCH(batch, 0);
     OUT_BATCH(batch, 0);
 
+    OUT_BATCH(batch, GEN8_3DSTATE_VF_SGVS | (2 - 2));
+    OUT_BATCH(batch, 0);
+
     BEGIN_BATCH(batch, 7);
     OUT_BATCH(batch, CMD_3DPRIMITIVE | (7 - 2));
     OUT_BATCH(batch,
diff --git a/src/i965_defines.h b/src/i965_defines.h
index 949037e..aa5058f 100755
--- a/src/i965_defines.h
+++ b/src/i965_defines.h
@@ -746,6 +746,8 @@
 #define _3DPRIM_LINESTRIP_CONT_BF 0x14
 #define _3DPRIM_TRIFAN_NOSTIPPLE  0x15
 
+#define GEN8_3DSTATE_VF_INSTANCING     CMD(3, 0, 0x49)
+#define GEN8_3DSTATE_VF_SGVS           CMD(3, 0, 0x4a)
 #define GEN8_3DSTATE_VF_TOPOLOGY       CMD(3, 0, 0x4b)
 
 #define I965_TILEWALK_XMAJOR                 0
-- 
2.2.1

_______________________________________________
Libva mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libva

Reply via email to