mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 19:48:03 +02:00
zink: handle NULL views in zink_set_sampler_views
Passing NULL for the views parameter should be the same as passing an array of NULL, according to the documentation. So let's respect that detail. This fixes a crash when using GALLIUM_HUD. Fixes:8d46e35d16("zink: introduce opengl over vulkan") Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8564> (cherry picked from commit333730405d)
This commit is contained in:
parent
380c7edbc2
commit
5e436d9f2d
2 changed files with 3 additions and 3 deletions
|
|
@ -418,7 +418,7 @@
|
|||
"description": "zink: handle NULL views in zink_set_sampler_views",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "8d46e35d16e3936968958bcab86d61967a673305"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -582,11 +582,11 @@ zink_set_sampler_views(struct pipe_context *pctx,
|
|||
struct pipe_sampler_view **views)
|
||||
{
|
||||
struct zink_context *ctx = zink_context(pctx);
|
||||
assert(views);
|
||||
for (unsigned i = 0; i < num_views; ++i) {
|
||||
struct pipe_sampler_view *pview = views ? views[i] : NULL;
|
||||
pipe_sampler_view_reference(
|
||||
&ctx->image_views[shader_type][start_slot + i],
|
||||
views[i]);
|
||||
pview);
|
||||
}
|
||||
ctx->num_image_views[shader_type] = start_slot + num_views;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue