Mesa (master): radv: fix crashes when fast-clearing in a secondary command buffer

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 11:15:01 UTC 2021


Module: Mesa
Branch: master
Commit: 8f9b2afe7075d07bbeacb238f144240f2f68d13b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f9b2afe7075d07bbeacb238f144240f2f68d13b

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Jan 11 09:20:48 2021 +0100

radv: fix crashes when fast-clearing in a secondary command buffer

iview can be NULL inside a secondary command buffer.

Fixes: 00064713a30 ("radv: determine at creation if an image view can be fast cleared")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8408>

---

 src/amd/vulkan/radv_meta_clear.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index 2c3dfb52e88..4461ba44c96 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1001,7 +1001,7 @@ radv_can_fast_clear_depth(struct radv_cmd_buffer *cmd_buffer,
 			  const VkClearDepthStencilValue clear_value,
 			  uint32_t view_mask)
 {
-	if (!iview->support_fast_clear)
+	if (!iview || !iview->support_fast_clear)
 		return false;
 
 	if (!radv_layout_is_htile_compressed(cmd_buffer->device, iview->image, image_layout, in_render_loop,
@@ -1571,7 +1571,7 @@ radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
 {
 	uint32_t clear_color[2];
 
-	if (!iview->support_fast_clear)
+	if (!iview || !iview->support_fast_clear)
 		return false;
 
 	if (!radv_layout_can_fast_clear(cmd_buffer->device, iview->image, image_layout, in_render_loop,



More information about the mesa-commit mailing list