llvmpipe: Handle NULL views in llvmpipe_cleanup_stage_sampling

This is the only barrier to lavapipe fully working in RenderDoc.

Fixes: 21864bdaae ("llvmpipe: unmap display target of shader image/sampler")

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11856>
This commit is contained in:
Joshua Ashton
2021-07-13 22:09:24 +01:00
committed by Marge Bot
parent 86f09b14df
commit f5946354d3
@@ -422,10 +422,11 @@ llvmpipe_cleanup_stage_sampling(struct llvmpipe_context *ctx,
for (i = 0; i < num; i++) {
struct pipe_sampler_view *view = views[i];
assert(view);
struct pipe_resource *tex = view->texture;
if (tex)
llvmpipe_resource_unmap(tex, 0, 0);
if (view) {
struct pipe_resource *tex = view->texture;
if (tex)
llvmpipe_resource_unmap(tex, 0, 0);
}
}
}