From 7882321d4f18d8e8e86cb5e528e72e1e153a9bac Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 14 May 2026 20:18:23 +0300 Subject: [PATCH] anv: only reprogram line-stipple if enabled Signed-off-by: Lionel Landwerlin Reviewed-by: Ivan Briano Part-of: --- src/intel/vulkan/anv_device.c | 5 +++++ src/intel/vulkan/genX_gfx_state.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 8a2afefc040..ee19a0a0341 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -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) { diff --git a/src/intel/vulkan/genX_gfx_state.c b/src/intel/vulkan/genX_gfx_state.c index ba6b3c505ec..3040ebe9be1 100644 --- a/src/intel/vulkan/genX_gfx_state.c +++ b/src/intel/vulkan/genX_gfx_state.c @@ -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); }