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 <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17665>
This commit is contained in:
Mike Blumenkrantz 2022-07-18 14:05:40 -04:00 committed by Marge Bot
parent 992cd1ae2b
commit a2f97bd88a

View file

@ -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) {