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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25018>
This commit is contained in:
Konstantin Seurer
2023-09-02 22:33:58 +02:00
committed by Marge Bot
parent 4171d9ff84
commit 28e1e33c32
+2 -3
View File
@@ -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);