From ade72e677b3e3d15221c0097c76573c36e47d0f8 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 19 Sep 2020 17:28:17 +0200 Subject: [PATCH] st/mesa: Deal with empty textures/buffers in semaphore wait/signal. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The actual texture might not have been created yet. Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3257 CC: mesa-stable Acked-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Marek Olšák Part-of: --- src/mesa/state_tracker/st_cb_semaphoreobjects.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_semaphoreobjects.c b/src/mesa/state_tracker/st_cb_semaphoreobjects.c index 51288a8..6d97413 100644 --- a/src/mesa/state_tracker/st_cb_semaphoreobjects.c +++ b/src/mesa/state_tracker/st_cb_semaphoreobjects.c @@ -109,7 +109,8 @@ st_server_wait_semaphore(struct gl_context *ctx, continue; bufObj = st_buffer_object(bufObjs[i]); - pipe->flush_resource(pipe, bufObj->buffer); + if (bufObj->buffer) + pipe->flush_resource(pipe, bufObj->buffer); } for (unsigned i = 0; i < numTextureBarriers; i++) { @@ -117,7 +118,8 @@ st_server_wait_semaphore(struct gl_context *ctx, continue; texObj = st_texture_object(texObjs[i]); - pipe->flush_resource(pipe, texObj->pt); + if (texObj->pt) + pipe->flush_resource(pipe, texObj->pt); } } @@ -141,7 +143,8 @@ st_server_signal_semaphore(struct gl_context *ctx, continue; bufObj = st_buffer_object(bufObjs[i]); - pipe->flush_resource(pipe, bufObj->buffer); + if (bufObj->buffer) + pipe->flush_resource(pipe, bufObj->buffer); } for (unsigned i = 0; i < numTextureBarriers; i++) { @@ -149,7 +152,8 @@ st_server_signal_semaphore(struct gl_context *ctx, continue; texObj = st_texture_object(texObjs[i]); - pipe->flush_resource(pipe, texObj->pt); + if (texObj->pt) + pipe->flush_resource(pipe, texObj->pt); } /* The driver is allowed to flush during fence_server_signal, be prepared */ -- 2.7.4