diff --git a/src/amd/vulkan/layers/radv_sqtt_layer.c b/src/amd/vulkan/layers/radv_sqtt_layer.c index dc93b930097..847384ae56e 100644 --- a/src/amd/vulkan/layers/radv_sqtt_layer.c +++ b/src/amd/vulkan/layers/radv_sqtt_layer.c @@ -156,8 +156,7 @@ radv_sqtt_reloc_graphics_shaders(struct radv_device *device, struct radv_graphic return VK_SUCCESS; fail: - if (reloc->alloc) - radv_free_shader_memory(device, reloc->alloc); + radv_free_shader_memory(device, reloc->alloc); free(reloc); return result; } diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 61892c4d4ad..e7e70dedd81 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -1253,6 +1253,9 @@ get_hole(struct radv_shader_arena *arena, struct list_head *head) void radv_free_shader_memory(struct radv_device *device, union radv_shader_arena_block *alloc) { + if (!alloc) + return; + mtx_lock(&device->shader_arena_mutex); union radv_shader_arena_block *hole_prev = get_hole(alloc->arena, alloc->list.prev); @@ -2860,6 +2863,11 @@ radv_shader_create_uncached(struct radv_device *device, const struct radv_shader } } + if (radv_device_physical(device)->info.family_overridden) { + *out_shader = shader; + return VK_SUCCESS; + } + if (replay_block) { shader->alloc = radv_replay_shader_arena_block(device, replay_block, shader); if (!shader->alloc) { @@ -2962,6 +2970,9 @@ radv_shader_part_create(struct radv_device *device, struct radv_shader_part_bina shader_part->cb_shader_mask = binary->info.cb_shader_mask; shader_part->spi_shader_z_format = binary->info.spi_shader_z_format; + if (radv_device_physical(device)->info.family_overridden) + return shader_part; + /* Allocate memory and upload. */ shader_part->alloc = radv_alloc_shader_memory(device, shader_part->code_size, false, NULL); if (!shader_part->alloc) @@ -3562,8 +3573,7 @@ radv_shader_part_destroy(struct radv_device *device, struct radv_shader_part *sh radv_shader_wait_for_upload(device, shader_part->upload_seq); } - if (shader_part->alloc) - radv_free_shader_memory(device, shader_part->alloc); + radv_free_shader_memory(device, shader_part->alloc); free(shader_part->disasm_string); free(shader_part); }