[Mesa-dev] [PATCH] swr: conditionally validate vertex buffer state
Rowley, Timothy O
timothy.o.rowley at intel.com
Thu Jun 29 17:00:18 UTC 2017
Reviewed-by: Tim Rowley <timothy.o.rowley at intel.com<mailto:timothy.o.rowley at intel.com>>
On Jun 27, 2017, at 5:49 PM, Bruce Cherniak <bruce.cherniak at intel.com<mailto:bruce.cherniak at intel.com>> wrote:
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.
---
src/gallium/drivers/swr/swr_state.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index f65e642753..6dc06ed156 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;
--
2.11.0
_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org<mailto:mesa-dev at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170629/aa4cd2f5/attachment.html>
More information about the mesa-dev
mailing list