From dc79d6b13af7ab93e933d3c9efd0e9b777175427 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 13 Mar 2026 15:59:26 +0200 Subject: [PATCH] anv: merge null surface state packing with previous attachments Signed-off-by: Lionel Landwerlin Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 33 ++++++++++++------------------ 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index d71571bc364..182a540aeea 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -6413,6 +6413,14 @@ void genX(CmdBeginRendering)( } } + anv_cmd_graphic_state_update_has_uint_rt(gfx); + + /* Finally, now that we know the right size, set up the null surface */ + assert(util_bitcount(gfx->samples) <= 1); + isl_null_fill_state(&cmd_buffer->device->isl_dev, + gfx->null_surface_state.map, + .size = fb_size); + /* Do fast clearing */ for (uint32_t i = 0; i < gfx->color_att_count; i++) { struct anv_attachment *att = &gfx->color_att[i]; @@ -6455,8 +6463,12 @@ void genX(CmdBeginRendering)( /* Fill surfaces, load clear colors and do slow clears */ for (uint32_t i = 0; i < gfx->color_att_count; i++) { struct anv_attachment *att = &gfx->color_att[i]; - if (att->iview == NULL) + if (att->iview == NULL) { + isl_null_fill_state(&cmd_buffer->device->isl_dev, + att->surface_state.state.map, + .size = fb_size); continue; + } struct isl_view isl_view = att->iview->planes[0].isl; if (pRenderingInfo->viewMask) { @@ -6517,25 +6529,6 @@ void genX(CmdBeginRendering)( } } - anv_cmd_graphic_state_update_has_uint_rt(gfx); - - /* Finally, now that we know the right size, set up the null surface */ - assert(util_bitcount(gfx->samples) <= 1); - isl_null_fill_state(&cmd_buffer->device->isl_dev, - gfx->null_surface_state.map, - .size = fb_size); - - for (uint32_t i = 0; i < gfx->color_att_count; i++) { - struct anv_attachment *att = &gfx->color_att[i]; - - if (pRenderingInfo->pColorAttachments[i].imageView != VK_NULL_HANDLE) - continue; - - isl_null_fill_state(&cmd_buffer->device->isl_dev, - att->surface_state.state.map, - .size = fb_size); - } - /****** We can now start emitting code to begin the render pass ******/ gfx->dirty |= ANV_CMD_DIRTY_RENDER_TARGETS;