mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
radv: Set debug info in radv_shader_create_uncached
Avoids patching the stats in radv_shader_create and it will allow adding shader args debug info to some prologs. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37829>
This commit is contained in:
parent
3766985f1b
commit
ff2caf1513
4 changed files with 11 additions and 13 deletions
|
|
@ -69,7 +69,7 @@ radv_shader_deserialize(struct radv_device *device, const void *key_data, size_t
|
|||
const struct radv_shader_binary *binary = blob_read_bytes(blob, sizeof(struct radv_shader_binary));
|
||||
|
||||
struct radv_shader *shader;
|
||||
radv_shader_create_uncached(device, binary, false, NULL, &shader);
|
||||
radv_shader_create_uncached(device, binary, false, NULL, NULL, &shader);
|
||||
if (!shader)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -166,12 +166,7 @@ radv_shader_create(struct radv_device *device, struct vk_pipeline_cache *cache,
|
|||
{
|
||||
if (radv_is_cache_disabled(device, cache) || skip_cache || (dbg && dbg->dump_shader)) {
|
||||
struct radv_shader *shader;
|
||||
radv_shader_create_uncached(device, binary, false, NULL, &shader);
|
||||
if (dbg) {
|
||||
struct amd_stats *stats = shader->dbg.statistics;
|
||||
shader->dbg = *dbg;
|
||||
shader->dbg.statistics = stats;
|
||||
}
|
||||
radv_shader_create_uncached(device, binary, false, NULL, dbg, &shader);
|
||||
return shader;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -543,12 +543,11 @@ radv_rt_compile_nir(struct radv_device *device, struct vk_pipeline_cache *cache,
|
|||
|
||||
struct radv_shader *shader;
|
||||
if (replay_block || replayable) {
|
||||
VkResult result = radv_shader_create_uncached(device, binary, replayable, replay_block, &shader);
|
||||
VkResult result = radv_shader_create_uncached(device, binary, replayable, replay_block, &debug, &shader);
|
||||
if (result != VK_SUCCESS) {
|
||||
free(binary);
|
||||
return result;
|
||||
}
|
||||
shader->dbg = debug;
|
||||
} else {
|
||||
shader = radv_shader_create(device, cache, binary, skip_shaders_cache, &debug);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2962,7 +2962,8 @@ radv_parse_binary_debug_info(struct radv_device *device, const struct radv_shade
|
|||
|
||||
VkResult
|
||||
radv_shader_create_uncached(struct radv_device *device, const struct radv_shader_binary *binary, bool replayable,
|
||||
struct radv_serialized_shader_arena_block *replay_block, struct radv_shader **out_shader)
|
||||
struct radv_serialized_shader_arena_block *replay_block, struct radv_shader_debug_info *dbg,
|
||||
struct radv_shader **out_shader)
|
||||
{
|
||||
VkResult result = VK_SUCCESS;
|
||||
struct radv_shader *shader = calloc(1, sizeof(struct radv_shader));
|
||||
|
|
@ -2980,6 +2981,9 @@ radv_shader_create_uncached(struct radv_device *device, const struct radv_shader
|
|||
shader->config = binary->config;
|
||||
shader->max_waves = radv_get_max_waves(device, &shader->config, &shader->info);
|
||||
|
||||
if (dbg)
|
||||
shader->dbg = *dbg;
|
||||
|
||||
if (binary->type == RADV_BINARY_TYPE_RTLD) {
|
||||
#if !defined(USE_LIBELF)
|
||||
goto out;
|
||||
|
|
@ -3470,7 +3474,7 @@ radv_create_trap_handler_shader(struct radv_device *device)
|
|||
radv_postprocess_binary_config(device, binary, &args);
|
||||
|
||||
struct radv_shader *shader;
|
||||
radv_shader_create_uncached(device, binary, false, NULL, &shader);
|
||||
radv_shader_create_uncached(device, binary, false, NULL, NULL, &shader);
|
||||
radv_parse_binary_debug_info(device, binary, &shader->dbg);
|
||||
|
||||
if (options.dump_shader) {
|
||||
|
|
@ -3543,7 +3547,7 @@ radv_compile_rt_prolog(struct radv_device *device, struct radv_shader_stage *sta
|
|||
binary->info = stage->info;
|
||||
|
||||
radv_postprocess_binary_config(device, binary, &stage->args);
|
||||
radv_shader_create_uncached(device, binary, false, NULL, &prolog);
|
||||
radv_shader_create_uncached(device, binary, false, NULL, NULL, &prolog);
|
||||
if (!prolog || radv_parse_binary_debug_info(device, binary, &prolog->dbg) != VK_SUCCESS)
|
||||
goto done;
|
||||
|
||||
|
|
|
|||
|
|
@ -532,7 +532,7 @@ VkResult radv_parse_binary_debug_info(struct radv_device *device, const struct r
|
|||
|
||||
VkResult radv_shader_create_uncached(struct radv_device *device, const struct radv_shader_binary *binary,
|
||||
bool replayable, struct radv_serialized_shader_arena_block *replay_block,
|
||||
struct radv_shader **out_shader);
|
||||
struct radv_shader_debug_info *dbg, struct radv_shader **out_shader);
|
||||
|
||||
struct radv_shader_binary *radv_shader_nir_to_asm(struct radv_device *device, struct radv_shader_stage *pl_stage,
|
||||
struct nir_shader *const *shaders, int shader_count,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue