summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2015-01-09 14:39:36 -0700
committerXiang, Haihao <haihao.xiang@intel.com>2015-01-12 13:43:41 +0800
commite0621d1691195a1a38e32cace9b6cf46a39a1630 (patch)
treea0f74b98e446d5300215c9d449736393b4adcae3
parent24b7a89a92c0bf0cbff7eabeac8c6f3de763f7ad (diff)
i965 render: Explicitly disable instancing for vertex elements on Gen8
We really should guarantee that vertex elements non-instanced, especially since we don't use our own hardware context - other programs can change this on us. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Sean V Kelley <seanvk@posteo.de> (cherry picked from commit e079591f2ed4dbfaad309c95aa1a1ddb00eb80e8)
-rw-r--r--src/gen8_render.c8
-rwxr-xr-xsrc/i965_defines.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gen8_render.c b/src/gen8_render.c
index b7494a1..8a8012d 100644
--- a/src/gen8_render.c
+++ b/src/gen8_render.c
@@ -950,6 +950,7 @@ gen8_emit_vertex_element_state(VADriverContextP ctx)
{
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct intel_batchbuffer *batch = i965->batch;
+ int i;
/*
* The VUE layout
@@ -993,6 +994,13 @@ gen8_emit_vertex_element_state(VADriverContextP ctx)
(I965_VFCOMPONENT_STORE_SRC << VE1_VFCOMPONENT_1_SHIFT) |
(I965_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_2_SHIFT) |
(I965_VFCOMPONENT_STORE_1_FLT << VE1_VFCOMPONENT_3_SHIFT));
+
+ /* Disable instancing for all vertex elements. */
+ for (i = 0; i < 3; i++) {
+ OUT_BATCH(batch, GEN8_3DSTATE_VF_INSTANCING | (3 - 2));
+ OUT_BATCH(batch, i);
+ OUT_BATCH(batch, 0);
+ }
}
static void
diff --git a/src/i965_defines.h b/src/i965_defines.h
index 7c87274..949037e 100755
--- a/src/i965_defines.h
+++ b/src/i965_defines.h
@@ -330,6 +330,9 @@
#define GEN7_3DSTATE_VF CMD(3, 0, 0x0c)
#define GEN8_3DSTATE_VF_INSTANCING CMD(3, 0, 0x49)
+#define GEN7_3DSTATE_VF CMD(3, 0, 0x0c)
+#define GEN8_3DSTATE_VF_INSTANCING CMD(3, 0, 0x49)
+
#define MFX(pipeline, op, sub_opa, sub_opb) \
(3 << 29 | \
(pipeline) << 27 | \