summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2017-06-06 20:58:31 -0700
committerAndres Gomez <agomez@igalia.com>2017-06-28 20:15:03 +0300
commit3ec9e035011c4f295dfe8fcf54d10f740dc6643b (patch)
tree34a73a73076f070a37e78bdaee2aecc204deb3e1
parent175b0442df3f978b27a86f0fe41dc94b4866a8d3 (diff)
i965: Disable the interleaved vertex optimization when instancing
Instance divisor is a property of the vertex buffer and not the vertex element so if we ever see anything other than 0, bail. Cc: "17.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> (cherry picked from commit b3569e74451e3b913a2f3b327db430edbcd8f42e)
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 14b60a9abc2..b8c7cb51a67 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -664,15 +664,16 @@ brw_prepare_vertices(struct brw_context *brw)
ptr = glarray->Ptr;
}
else if (interleaved != glarray->StrideB ||
+ glarray->InstanceDivisor != 0 ||
glarray->Ptr < ptr ||
(uintptr_t)(glarray->Ptr - ptr) + glarray->_ElementSize > interleaved)
{
/* If our stride is different from the first attribute's stride,
- * or if the first attribute's stride didn't cover our element,
- * disable the interleaved upload optimization. The second case
- * can most commonly occur in cases where there is a single vertex
- * and, for example, the data is stored on the application's
- * stack.
+ * or if we are using an instance divisor or if the first
+ * attribute's stride didn't cover our element, disable the
+ * interleaved upload optimization. The second case can most
+ * commonly occur in cases where there is a single vertex and, for
+ * example, the data is stored on the application's stack.
*
* NOTE: This will also disable the optimization in cases where
* the data is in a different order than the array indices.