aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorBruce Cherniak <[email protected]>2017-06-27 17:49:06 -0500
committerTim Rowley <[email protected]>2017-06-29 13:23:33 -0500
commit2b27dcd0751e704193ceb0572447799342dd1db5 (patch)
tree4b95f7f16cd3838414a65b2db9f2baf827ad2ac6 /src/gallium/drivers/swr
parent867e1117692c4c735688b678dbdff7a5e4696d95 (diff)
swr: conditionally validate vertex buffer state
Vertex buffer state doesn't need to be validated on every call, only on dirty _NEW_VERTEX or indexed draws. Unconditional validation was introduced as part of patch 330d0607ed6, "remove pipe_index_buffer and set_index_buffer", with the expectation we'd optimize later. Reviewed-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/swr_state.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index f65e6427534..6dc06ed1563 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -1212,12 +1212,13 @@ swr_update_derived(struct pipe_context *pipe,
SwrSetViewports(ctx->swrContext, 1, vp, vpm);
}
- /* Set vertex & index buffers */
- /* (using draw info if called by swr_draw_vbo) */
- /* TODO: This is always true, because the index buffer comes from
+ /* Set vertex & index buffers
+ * (using draw info if called by swr_draw_vbo)
+ * If indexed draw, revalidate since index buffer comes from
* pipe_draw_info.
*/
- if (1 || ctx->dirty & SWR_NEW_VERTEX) {
+ if (ctx->dirty & SWR_NEW_VERTEX ||
+ (p_draw_info && p_draw_info->index_size)) {
uint32_t scratch_total;
uint8_t *scratch = NULL;