}
if (BATCH_CHANGED || rast_state_changed || rast_prim_changed) {
- bool depth_bias = false;
- switch (ctx->gfx_pipeline_state.rast_prim) {
- case PIPE_PRIM_POINTS:
- 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");
- }
+ bool depth_bias =
+ ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_TRIANGLES &&
+ rast_state->offset_fill;
VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
if (depth_bias) {
state->base.line_stipple_pattern = UINT16_MAX;
}
- state->offset_point = rs_state->offset_point;
- state->offset_line = rs_state->offset_line;
- state->offset_tri = rs_state->offset_tri;
+ state->offset_fill = util_get_offset(rs_state, rs_state->fill_front);
state->offset_units = rs_state->offset_units;
if (!rs_state->offset_units_unscaled)
state->offset_units *= 2;
struct zink_rasterizer_state {
struct pipe_rasterizer_state base;
- bool offset_point, offset_line, offset_tri;
+ bool offset_fill;
float offset_units, offset_clamp, offset_scale;
float line_width;
VkFrontFace front_face;