[Mesa-dev] [PATCH] radv: don't crash if we have no framebuffer

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Aug 24 06:48:36 UTC 2017


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

Even though this is only a partial solution.

On Mon, Aug 21, 2017, at 09:24, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> 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).
> ---
>  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 ea17e33..239f662 100644
> --- a/src/amd/vulkan/radv_cmd_buffer.c
> +++ b/src/amd/vulkan/radv_cmd_buffer.c
> @@ -1212,6 +1212,10 @@ radv_emit_framebuffer_state(struct radv_cmd_buffer
> *cmd_buffer)
>  	struct radv_framebuffer *framebuffer = cmd_buffer->state.framebuffer;
>  	const struct radv_subpass *subpass = cmd_buffer->state.subpass;
>  
> +       /* this may happen for inherited secondary recording */
> +       if (!framebuffer)
> +               return;
> +
>  	for (i = 0; i < 8; ++i) {
>  		if (i >= subpass->color_count || subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED) {
>  			radeon_set_context_reg(cmd_buffer->cs, R_028C70_CB_COLOR0_INFO + i * 0x3C,
> -- 
> 2.9.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list