mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
zink: allocate program shader caches from the program's mem ctx
these will now be freed when the program itself is freed.
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
(cherry picked from commit b3ed037ca8)
This commit is contained in:
parent
2cb4f5a1bc
commit
840e0b9410
2 changed files with 7 additions and 7 deletions
|
|
@ -301,7 +301,7 @@
|
|||
"description": "zink: allocate program shader caches from the program's mem ctx",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -886,10 +886,10 @@ zink_create_gfx_program(struct zink_context *ctx,
|
|||
prog->ctx = ctx;
|
||||
|
||||
for (int i = 0; i < ZINK_GFX_SHADER_COUNT; ++i) {
|
||||
util_dynarray_init(&prog->shader_cache[i][0][0], NULL);
|
||||
util_dynarray_init(&prog->shader_cache[i][0][1], NULL);
|
||||
util_dynarray_init(&prog->shader_cache[i][1][0], NULL);
|
||||
util_dynarray_init(&prog->shader_cache[i][1][1], NULL);
|
||||
util_dynarray_init(&prog->shader_cache[i][0][0], prog);
|
||||
util_dynarray_init(&prog->shader_cache[i][0][1], prog);
|
||||
util_dynarray_init(&prog->shader_cache[i][1][0], prog);
|
||||
util_dynarray_init(&prog->shader_cache[i][1][1], prog);
|
||||
if (stages[i]) {
|
||||
prog->shaders[i] = stages[i];
|
||||
prog->stages_present |= BITFIELD_BIT(i);
|
||||
|
|
@ -1011,8 +1011,8 @@ precompile_compute_job(void *data, void *gdata, int thread_index)
|
|||
assert(comp->module);
|
||||
comp->module->shader = zink_shader_compile(screen, comp->shader, comp->shader->nir, NULL);
|
||||
assert(comp->module->shader);
|
||||
util_dynarray_init(&comp->shader_cache[0], NULL);
|
||||
util_dynarray_init(&comp->shader_cache[1], NULL);
|
||||
util_dynarray_init(&comp->shader_cache[0], comp);
|
||||
util_dynarray_init(&comp->shader_cache[1], comp);
|
||||
|
||||
struct blob blob = {0};
|
||||
blob_init(&blob);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue