Mesa (17.1): radv: don't crash if we have no framebuffer

Andres Gomez tanty at kemper.freedesktop.org
Fri Aug 25 20:55:29 UTC 2017


Module: Mesa
Branch: 17.1
Commit: 3f3e925d404c8524c342b72c32e4c151e293b2c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f3e925d404c8524c342b72c32e4c151e293b2c9

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Aug 17 02:08:46 2017 +0100

radv: don't crash if we have no framebuffer

Recording secondaries with no framebuffer attachment may
make this happen, though this might not be the complete solution.

(esp if someone does meta stuff in there, would we have to
save things, not sure).

Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver")
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied at redhat.com>
(cherry picked from commit 4a091b0788664f73bbb35c14d04c00cebf37e17a)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez at igalia.com>

Conflicts:
	src/amd/vulkan/radv_cmd_buffer.c

---

 src/amd/vulkan/radv_cmd_buffer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 303a3da2bd..4d8a27f98d 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -1106,6 +1106,10 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer *cmd_buffer)
 	const struct radv_subpass *subpass = cmd_buffer->state.subpass;
 	int dst_resolve_micro_tile_mode = -1;
 
+	/* this may happen for inherited secondary recording */
+	if (!framebuffer)
+		return;
+
 	if (subpass->has_resolve) {
 		uint32_t a = subpass->resolve_attachments[0].attachment;
 		const struct radv_image *image = framebuffer->attachments[a].attachment->image;




More information about the mesa-commit mailing list