zink: handle null samplerview in get_imageview_for_binding()

this is legal

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17639>
This commit is contained in:
Mike Blumenkrantz 2022-07-11 13:06:06 -04:00
parent 5b58f8df53
commit 19eddeb226

View file

@ -470,7 +470,7 @@ get_imageview_for_binding(struct zink_context *ctx, enum pipe_shader_type stage,
switch (type) {
case ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW: {
struct zink_sampler_view *sampler_view = zink_sampler_view(ctx->sampler_views[stage][idx]);
if (!sampler_view->base.texture)
if (!sampler_view || !sampler_view->base.texture)
return NULL;
/* if this is a non-seamless cube sampler, return the cube array view */
return (ctx->di.emulate_nonseamless[stage] & ctx->di.cubes[stage] & BITFIELD_BIT(idx)) ?