From: Samuel Pitoiset Date: Sun, 12 Jul 2020 17:13:18 +0000 (+0200) Subject: radv/winsys: be more robust when a CS failed during recording X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=202592a3989745c83b80cdc25882ac2bf67bafa4;p=mesa.git radv/winsys: be more robust when a CS failed during recording Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c index 4f91aa1562a..b024ef97104 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c @@ -575,7 +575,7 @@ static void radv_amdgpu_cs_add_buffer_internal(struct radv_amdgpu_cs *cs, unsigned hash; int index = radv_amdgpu_cs_find_buffer(cs, bo); - if (index != -1 || cs->status != VK_SUCCESS) + if (index != -1) return; if (cs->num_buffers == cs->max_num_buffers) { @@ -660,6 +660,9 @@ static void radv_amdgpu_cs_add_buffer(struct radeon_cmdbuf *_cs, struct radv_amdgpu_cs *cs = radv_amdgpu_cs(_cs); struct radv_amdgpu_winsys_bo *bo = radv_amdgpu_winsys_bo(_bo); + if (cs->status != VK_SUCCESS) + return; + if (bo->is_virtual) { radv_amdgpu_cs_add_virtual_buffer(_cs, _bo); return; @@ -677,6 +680,9 @@ static void radv_amdgpu_cs_execute_secondary(struct radeon_cmdbuf *_parent, struct radv_amdgpu_cs *parent = radv_amdgpu_cs(_parent); struct radv_amdgpu_cs *child = radv_amdgpu_cs(_child); + if (parent->status != VK_SUCCESS || child->status != VK_SUCCESS) + return; + for (unsigned i = 0; i < child->num_buffers; ++i) { radv_amdgpu_cs_add_buffer_internal(parent, child->handles[i].bo_handle,