Skip to content

Commit 5a1d9cb

Browse files
Patrick Lerda1ace
Patrick Lerda
authored andcommitted
panfrost: remove panfrost_create_shader_state() related dead code
The pointer "xfb" is allocated with a clone of "so->nir" and lost without further processing. The function panfrost_shader_compile() was the one processing "xfb". The call of this function was removed with the commit 40372bd. This makes "xfb" not required anymore. For instance, this issue is triggered on a Mali-T820 with "piglit/bin/arb_transform_feedback2-change-objects-while-paused -auto": Indirect leak of 32776 byte(s) in 1 object(s) allocated from: #0 0xf78f30a6 in malloc (/usr/lib/libasan.so.6+0x840a6) #1 0xee9cd4ee in ralloc_size ../src/util/ralloc.c:118 #2 0xee9cf7ae in create_slab ../src/util/ralloc.c:801 #3 0xee9cf7ae in gc_alloc_size ../src/util/ralloc.c:840 #4 0xef74ab82 in nir_undef_instr_create ../src/compiler/nir/nir.c:888 #5 0xef76212c in clone_ssa_undef ../src/compiler/nir/nir_clone.c:328 #6 0xef76212c in clone_instr ../src/compiler/nir/nir_clone.c:438 #7 0xef7642d8 in clone_block ../src/compiler/nir/nir_clone.c:501 #8 0xef7642d8 in clone_cf_list ../src/compiler/nir/nir_clone.c:555 #9 0xef7657dc in clone_function_impl ../src/compiler/nir/nir_clone.c:632 #10 0xef766cb8 in nir_shader_clone ../src/compiler/nir/nir_clone.c:743 #11 0xf007673e in panfrost_create_shader_state ../src/gallium/drivers/panfrost/pan_shader.c:434 #12 0xeeb6766c in st_create_common_variant ../src/mesa/state_tracker/st_program.c:781 #13 0xeeb71d1c in st_get_common_variant ../src/mesa/state_tracker/st_program.c:834 #14 0xeeb72ea2 in st_precompile_shader_variant ../src/mesa/state_tracker/st_program.c:1320 #15 0xeeb72ea2 in st_finalize_program ../src/mesa/state_tracker/st_program.c:1421 #16 0xef3806ec in st_link_glsl_to_nir ../src/mesa/state_tracker/st_glsl_to_nir.cpp:748 #17 0xef3806ec in st_link_shader ../src/mesa/state_tracker/st_glsl_to_nir.cpp:984 #18 0xef2992f6 in link_program ../src/mesa/main/shaderapi.c:1336 #19 0xef2992f6 in link_program_error ../src/mesa/main/shaderapi.c:1445 Fixes: 40372bd ("panfrost: Implement a disk cache") Signed-off-by: Patrick Lerda <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28743> (cherry picked from commit 4f5e9a2)
1 parent 51dd480 commit 5a1d9cb

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

.pick_status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@
15741574
"description": "panfrost: remove panfrost_create_shader_state() related dead code",
15751575
"nominated": true,
15761576
"nomination_type": 1,
1577-
"resolution": 0,
1577+
"resolution": 1,
15781578
"main_sha": null,
15791579
"because_sha": "40372bd720fe16186e9abc832bb452a3143d0e00",
15801580
"notes": null

src/gallium/drivers/panfrost/pan_shader.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,6 @@ panfrost_create_shader_state(struct pipe_context *pctx,
383383
struct panfrost_context *ctx = pan_context(pctx);
384384

385385
if (so->nir->xfb_info) {
386-
nir_shader *xfb = nir_shader_clone(NULL, so->nir);
387-
xfb->info.name = ralloc_asprintf(xfb, "%s@xfb", xfb->info.name);
388-
xfb->info.internal = true;
389-
390386
so->xfb = calloc(1, sizeof(struct panfrost_compiled_shader));
391387
so->xfb->key.vs_is_xfb = true;
392388

0 commit comments

Comments
 (0)