anv: only reprogram line-stipple if enabled

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41581>
This commit is contained in:
Lionel Landwerlin 2026-05-14 20:18:23 +03:00 committed by Marge Bot
parent d6751f2a3b
commit 7882321d4f
2 changed files with 11 additions and 4 deletions

View file

@ -1180,8 +1180,13 @@ VkResult anv_CreateDevice(
anv_device_init_descriptors_view(device);
BITSET_ONES(device->gfx_dirty_state);
/* Only dirtied when the index buffer is changing */
BITSET_CLEAR(device->gfx_dirty_state, ANV_GFX_STATE_INDEX_BUFFER);
/* Only programmed if streamout is enabled */
BITSET_CLEAR(device->gfx_dirty_state, ANV_GFX_STATE_SO_DECL_LIST);
/* Only programmed when line stipple is enabled, avoids PIPE_CONTROL */
BITSET_CLEAR(device->gfx_dirty_state, ANV_GFX_STATE_LINE_STIPPLE);
if (device->info->ver < 11)
BITSET_CLEAR(device->gfx_dirty_state, ANV_GFX_STATE_VF_SGVS_2);
if (device->info->ver < 12) {

View file

@ -1721,10 +1721,12 @@ ALWAYS_INLINE static void
update_line_stipple(struct anv_gfx_dynamic_state *hw_state,
const struct vk_dynamic_graphics_state *dyn)
{
SET(LINE_STIPPLE, ls.LineStipplePattern, dyn->rs.line.stipple.pattern);
SET(LINE_STIPPLE, ls.LineStippleInverseRepeatCount,
1.0f / MAX2(1, dyn->rs.line.stipple.factor));
SET(LINE_STIPPLE, ls.LineStippleRepeatCount, dyn->rs.line.stipple.factor);
if (dyn->rs.line.stipple.enable) {
SET(LINE_STIPPLE, ls.LineStipplePattern, dyn->rs.line.stipple.pattern);
SET(LINE_STIPPLE, ls.LineStippleInverseRepeatCount,
1.0f / MAX2(1, dyn->rs.line.stipple.factor));
SET(LINE_STIPPLE, ls.LineStippleRepeatCount, dyn->rs.line.stipple.factor);
}
SET(WM, wm.LineStippleEnable, dyn->rs.line.stipple.enable);
}