Commit 179e8745 authored by Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Committed by Erik Faye-Lund

d3d12: Only enable depth bias for triangle primitives

parent 3bdfaccf
......@@ -126,18 +126,26 @@ fill_so_declaration(const struct pipe_stream_output_info *info,
static bool
depth_bias(struct d3d12_rasterizer_state *state, enum pipe_prim_type reduced_prim)
{
switch (reduced_prim) {
case PIPE_PRIM_POINTS:
return state->base.offset_point;
/* glPolygonOffset is supposed to be only enabled when rendering polygons.
* In d3d12 case, all polygons (and quads) are lowered to triangles */
if (reduced_prim != PIPE_PRIM_TRIANGLES)
return false;
case PIPE_PRIM_LINES:
return state->base.offset_line;
unsigned fill_mode = state->base.cull_face == PIPE_FACE_FRONT ? state->base.fill_back
: state->base.fill_front;
case PIPE_PRIM_TRIANGLES:
switch (fill_mode) {
case PIPE_POLYGON_MODE_FILL:
return state->base.offset_tri;
case PIPE_POLYGON_MODE_LINE:
return state->base.offset_line;
case PIPE_POLYGON_MODE_POINT:
return state->base.offset_point;
default:
unreachable("unexpected reduced prim");
unreachable("unexpected fill mode");
}
}
......
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