Commit 4d255146 authored by Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Committed by Erik Faye-Lund
Browse files

d3d12: Don't reorder triangle strip vertices when flat shading + first pv

parent 2d6f0d5d
......@@ -432,13 +432,24 @@ needs_vertex_reordering(struct d3d12_selection_context *sel_ctx)
if (fill_mode_lowered(ctx, sel_ctx->dinfo) != PIPE_POLYGON_MODE_FILL)
return false;
/* If reordering for transform feedback, we don't care about provoking vertex */
if (xfb && !flat)
/* TODO add support for line primitives */
/* When flat shading a triangle and provoking vertex is not the first one, we use load_at_vertex.
If not available for this adapter, or if it's a triangle strip, we need to reorder the vertices */
if (flat && sel_ctx->provoking_vertex >= 2 && (!d3d12_screen(ctx->base.screen)->have_load_at_vertex ||
return true;
/* When transform feedback is enabled and the output is alternating (triangle strip or triangle
strip with adjacency), we need to reorder vertices to get the order expected by OpenGL. This
only works when there is no flat shading involved. In that scenario, we don't care about
the provoking vertex. */
if (xfb && !flat && sel_ctx->alternate_tri) {
sel_ctx->provoking_vertex = 0;
return true;
/* TODO add support for line primitives */
return ((flat && sel_ctx->provoking_vertex >= 2 && !d3d12_screen(ctx->base.screen)->have_load_at_vertex) ||
((flat || xfb) && sel_ctx->alternate_tri));
return false;
static nir_variable *
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment