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 <timothy.o.rowley@intel.com>
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;