mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 10:14:13 +08:00
zink: fix crashing in image rebinds
this is invalid for buffer textures
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25379>
(cherry picked from commit c3f5416eaf
)
This commit is contained in:
parent
5ab99743c0
commit
1f42a7004c
@ -58,7 +58,7 @@
|
||||
"description": "zink: fix crashing in image rebinds",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
@ -4686,7 +4686,7 @@ zink_rebind_all_images(struct zink_context *ctx)
|
||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
for (unsigned j = 0; j < ctx->di.num_sampler_views[i]; j++) {
|
||||
struct zink_sampler_view *sv = zink_sampler_view(ctx->sampler_views[i][j]);
|
||||
if (!sv)
|
||||
if (!sv || sv->image_view->base.texture->target == PIPE_BUFFER)
|
||||
continue;
|
||||
struct zink_resource *res = zink_resource(sv->image_view->base.texture);
|
||||
if (res->obj != sv->image_view->obj) {
|
||||
@ -4700,7 +4700,7 @@ zink_rebind_all_images(struct zink_context *ctx)
|
||||
for (unsigned j = 0; j < ctx->di.num_images[i]; j++) {
|
||||
struct zink_image_view *image_view = &ctx->image_views[i][j];
|
||||
struct zink_resource *res = zink_resource(image_view->base.resource);
|
||||
if (!res)
|
||||
if (!res || res->base.b.target == PIPE_BUFFER)
|
||||
continue;
|
||||
if (ctx->image_views[i][j].surface->obj != res->obj) {
|
||||
zink_surface_reference(zink_screen(ctx->base.screen), &image_view->surface, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user