mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
etnaviv: handle NULL views in 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. The wrong handling of views parameter was causing problems starting with2813688f8d("gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views"). Cc: <mesa-stable@lists.freedesktop.org> Fixes:c9e8b49b88("etnaviv: gallium driver for Vivante GPUs") Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8670> (cherry picked from commit81ab9fe2d0)
This commit is contained in:
parent
753f5bba85
commit
b6310c5225
2 changed files with 5 additions and 3 deletions
|
|
@ -400,7 +400,7 @@
|
|||
"description": "etnaviv: handle NULL views in set_sampler_views",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "c9e8b49b885242d84ba031dacef5aa4a5ac1e5b6"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -247,8 +247,10 @@ set_sampler_views(struct etna_context *ctx, unsigned start, unsigned end,
|
|||
uint32_t prev_active_sampler_views = ctx->active_sampler_views;
|
||||
|
||||
for (i = start, j = 0; j < nr; i++, j++, mask <<= 1) {
|
||||
pipe_sampler_view_reference(&ctx->sampler_view[i], views[j]);
|
||||
if (views[j]) {
|
||||
struct pipe_sampler_view *view = views ? views[i] : NULL;
|
||||
|
||||
pipe_sampler_view_reference(&ctx->sampler_view[i], view);
|
||||
if (view) {
|
||||
ctx->active_sampler_views |= mask;
|
||||
ctx->dirty_sampler_views |= mask;
|
||||
} else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue