mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-02 10:08:08 +02:00
zink: correct depth-bias enable condition
This should be based on the fill_mode, not on the primitive type. We *also* need to check if we'll rasterize triangles in the end, though. Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19438>
This commit is contained in:
parent
b78afc2c73
commit
53721827ea
3 changed files with 5 additions and 21 deletions
|
|
@ -681,23 +681,9 @@ zink_draw(struct pipe_context *pctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BATCH_CHANGED || rast_state_changed || rast_prim_changed) {
|
if (BATCH_CHANGED || rast_state_changed || rast_prim_changed) {
|
||||||
bool depth_bias = false;
|
bool depth_bias =
|
||||||
switch (ctx->gfx_pipeline_state.rast_prim) {
|
ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_TRIANGLES &&
|
||||||
case PIPE_PRIM_POINTS:
|
rast_state->offset_fill;
|
||||||
depth_bias = rast_state->offset_point;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIPE_PRIM_LINES:
|
|
||||||
depth_bias = rast_state->offset_line;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PIPE_PRIM_TRIANGLES:
|
|
||||||
depth_bias = rast_state->offset_tri;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
unreachable("unexpected reduced prim");
|
|
||||||
}
|
|
||||||
|
|
||||||
VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
|
VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
|
||||||
if (depth_bias) {
|
if (depth_bias) {
|
||||||
|
|
|
||||||
|
|
@ -620,9 +620,7 @@ zink_create_rasterizer_state(struct pipe_context *pctx,
|
||||||
state->base.line_stipple_pattern = UINT16_MAX;
|
state->base.line_stipple_pattern = UINT16_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
state->offset_point = rs_state->offset_point;
|
state->offset_fill = util_get_offset(rs_state, rs_state->fill_front);
|
||||||
state->offset_line = rs_state->offset_line;
|
|
||||||
state->offset_tri = rs_state->offset_tri;
|
|
||||||
state->offset_units = rs_state->offset_units;
|
state->offset_units = rs_state->offset_units;
|
||||||
if (!rs_state->offset_units_unscaled)
|
if (!rs_state->offset_units_unscaled)
|
||||||
state->offset_units *= 2;
|
state->offset_units *= 2;
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ struct zink_rasterizer_hw_state {
|
||||||
|
|
||||||
struct zink_rasterizer_state {
|
struct zink_rasterizer_state {
|
||||||
struct pipe_rasterizer_state base;
|
struct pipe_rasterizer_state base;
|
||||||
bool offset_point, offset_line, offset_tri;
|
bool offset_fill;
|
||||||
float offset_units, offset_clamp, offset_scale;
|
float offset_units, offset_clamp, offset_scale;
|
||||||
float line_width;
|
float line_width;
|
||||||
VkFrontFace front_face;
|
VkFrontFace front_face;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue