About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schürmann <daniel@schuermann.dev>2025-09-19 17:50:37 +0200
committerMarge Bot <marge-bot@fdo.invalid>2025-11-06 13:53:06 +0000
commit4ad9fb9d2e6db4d939f2292c1a9cca4a4b757120 (patch)
tree7ffdb9bb3467bd3fbbf7f40f5ba04ecbfc922058
parent6c2d6144128feb9f096e79e326edfd3abeb923c5 (diff)
radv/null_device: don't attempt to upload shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37525>
-rw-r--r--src/amd/vulkan/layers/radv_sqtt_layer.c3
-rw-r--r--src/amd/vulkan/radv_shader.c14
2 files changed, 13 insertions, 4 deletions
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);
}