diff options
author | Icecream95 <ixn@disroot.org> | 2021-10-14 16:38:38 +1300 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2022-03-18 20:00:45 +0000 |
commit | 9552166f272ebbff1d5df11d6ad44a4a9638a4db (patch) | |
tree | 1bcd1c7f95bbeaaa2834b0998ba2a0f8cd17198e | |
parent | 5ae5b38e96d35d4a661bd7dfca8ef530e93758ea (diff) |
panfrost: Don't initialise the trampolines array
PIPE_MAX_SHADER_SAMPLER_VIEWS is 128, so we just end up initialising a
kilobyte of memory for no reason, when usually only a couple of
sampler views are used.
Fixes: 53ef20f08d4 ("panfrost: Handle NULL sampler views")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15366>
(cherry picked from commit 3e405afeb9c1cb1182f83e2a1fd6f0beb199df64)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_cmdstream.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index b9a3541b926..41c7c6ba094 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2110,7 +2110,7 @@ "description": "panfrost: Don't initialise the trampolines array", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "53ef20f08d4340c1bad0b45a2501f4daba7fb479" }, diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index ea83ed547f9..80f22eaefa5 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1381,13 +1381,15 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch, return T.gpu; #else - uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS] = { 0 }; + uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS]; for (int i = 0; i < ctx->sampler_view_count[stage]; ++i) { struct panfrost_sampler_view *view = ctx->sampler_views[stage][i]; - if (!view) + if (!view) { + trampolines[i] = 0; continue; + } panfrost_update_sampler_view(view, &ctx->base); |