add a special tracker here to set the state only when necessary
Fixes:
659c39fafbb ("zink: rework primitive rasterization type logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20886>
(cherry picked from commit
06a125942bef6a03a12b67f691ab4ad86e49c2df)
"description": "zink: fix VK_DYNAMIC_STATE_LINE_WIDTH usage",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "659c39fafbb53e27e6816fa872ac6eb78772e519"
},
}
}
- if ((BATCH_CHANGED || rast_state_changed || rast_prim_changed) &&
- ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_LINES) {
+ if (BATCH_CHANGED ||
+ /* only re-emit on non-batch change when actually drawing lines */
+ ((ctx->line_width_changed || rast_prim_changed) && ctx->gfx_pipeline_state.rast_prim == PIPE_PRIM_LINES)) {
VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
+ ctx->line_width_changed = false;
}
if (BATCH_CHANGED || mode_changed ||
bool clip_halfz = ctx->rast_state ? ctx->rast_state->hw_state.clip_halfz : false;
bool rasterizer_discard = ctx->rast_state ? ctx->rast_state->base.rasterizer_discard : false;
bool half_pixel_center = ctx->rast_state ? ctx->rast_state->base.half_pixel_center : true;
+ float line_width = ctx->rast_state ? ctx->rast_state->base.line_width : 1.0;
ctx->rast_state = cso;
if (ctx->rast_state) {
ctx->vp_state_changed = true;
}
+ if (fabs(ctx->rast_state->base.line_width - line_width) > FLT_EPSILON)
+ ctx->line_width_changed = true;
+
if (ctx->gfx_pipeline_state.dyn_state1.front_face != ctx->rast_state->front_face) {
ctx->gfx_pipeline_state.dyn_state1.front_face = ctx->rast_state->front_face;
ctx->gfx_pipeline_state.dirty |= !zink_screen(pctx->screen)->info.have_EXT_extended_dynamic_state;
bool blend_state_changed : 1;
bool sample_mask_changed : 1;
bool rast_state_changed : 1;
+ bool line_width_changed : 1;
bool dsa_state_changed : 1;
bool stencil_ref_changed : 1;
bool rasterizer_discard_changed : 1;