From 28e1e33c32bd1c58ff20c7c9b5801f6c56a5734b Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sat, 2 Sep 2023 22:33:58 +0200 Subject: [PATCH] radv: Don't use the depth image view for depth bias emission If the application records a secondary command buffer that inherits a render pass without specifying a framebuffer, we should still be able to emit the depth bias state properly. Fixes: 266b2cf ("radv: implement VK_EXT_depth_bias_control") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9588 Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 34e76ffb721..bff76f4231e 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2115,11 +2115,10 @@ radv_emit_depth_bias(struct radv_cmd_buffer *cmd_buffer) unsigned slope = fui(d->vk.rs.depth_bias.slope * 16.0f); unsigned pa_su_poly_offset_db_fmt_cntl = 0; - if (render->ds_att.iview && vk_format_has_depth(render->ds_att.iview->image->vk.format) && + if (vk_format_has_depth(render->ds_att.format) && d->vk.rs.depth_bias.representation != VK_DEPTH_BIAS_REPRESENTATION_FLOAT_EXT && !device->instance->absolute_depth_bias) { - const struct radv_image_view *iview = render->ds_att.iview; - VkFormat format = vk_format_depth_only(iview->image->vk.format); + VkFormat format = vk_format_depth_only(render->ds_att.format); if (format == VK_FORMAT_D16_UNORM) { pa_su_poly_offset_db_fmt_cntl = S_028B78_POLY_OFFSET_NEG_NUM_DB_BITS(-16);