summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-08-17 02:08:46 +0100
committerAndres Gomez <[email protected]>2017-08-25 16:03:37 +0300
commit3f3e925d404c8524c342b72c32e4c151e293b2c9 (patch)
tree6271ac1b75e9e9cf88718399d8fc9b48d1d5fe76 /src
parent81a1ecda15bba5d16812226ffafe60f36f2ac21e (diff)
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 4a091b0788664f73bbb35c14d04c00cebf37e17a) [Andres Gomez: resolve trivial conflicts] Signed-off-by: Andres Gomez <[email protected]> Conflicts: src/amd/vulkan/radv_cmd_buffer.c
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 303a3da2bdc..4d8a27f98dd 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;