From a2f97bd88a0d050a56a36659f82a28f05a8ee40c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 18 Jul 2022 14:05:40 -0400 Subject: [PATCH] zink: avoid crashing when bindless texture updates aren't used some apps trigger the texture update path far in advance of when the texture will be used, so don't crash and wait to do the update cc: mesa-stable Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_draw.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index 743531e..abda8aa 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -740,7 +740,10 @@ zink_draw(struct pipe_context *pctx, if (zink_program_has_descriptors(&ctx->curr_program->base)) screen->descriptors_update(ctx, false); - if (ctx->di.any_bindless_dirty && ctx->curr_program->base.dd->bindless) + if (ctx->di.any_bindless_dirty && + /* some apps (d3dretrace) call MakeTextureHandleResidentARB randomly */ + zink_program_has_descriptors(&ctx->curr_program->base) && + ctx->curr_program->base.dd->bindless) zink_descriptors_update_bindless(ctx); if (reads_basevertex) { -- 2.7.4