radv: Add radv_trace_mode

...and add the RADV specific trace modes to the VK instance.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20573>
This commit is contained in:
Konstantin Seurer
2023-05-10 19:21:09 +02:00
committed by Marge Bot
parent 70489edce4
commit 15d6618a12
2 changed files with 16 additions and 0 deletions

View File

@@ -110,6 +110,12 @@ radv_get_perftest_option_name(int id)
return radv_perftest_options[id].string; return radv_perftest_options[id].string;
} }
static const struct debug_control trace_options[] = {
{"rgp", RADV_TRACE_MODE_RGP},
{"rra", RADV_TRACE_MODE_RRA},
{NULL, 0},
};
// clang-format off // clang-format off
static const driOptionDescription radv_dri_options[] = { static const driOptionDescription radv_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE DRI_CONF_SECTION_PERFORMANCE
@@ -266,6 +272,8 @@ radv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationC
return vk_error(NULL, result); return vk_error(NULL, result);
} }
vk_instance_add_driver_trace_modes(&instance->vk, trace_options);
instance->debug_flags = parse_debug_string(getenv("RADV_DEBUG"), radv_debug_options); instance->debug_flags = parse_debug_string(getenv("RADV_DEBUG"), radv_debug_options);
instance->perftest_flags = parse_debug_string(getenv("RADV_PERFTEST"), radv_perftest_options); instance->perftest_flags = parse_debug_string(getenv("RADV_PERFTEST"), radv_perftest_options);

View File

@@ -390,6 +390,14 @@ void radv_physical_device_destroy(struct vk_physical_device *vk_device);
bool radv_sqtt_enabled(void); bool radv_sqtt_enabled(void);
enum radv_trace_mode {
/** Radeon GPU Profiler */
RADV_TRACE_MODE_RGP = 1 << VK_TRACE_MODE_COUNT,
/** Radeon Raytracing Analyzer */
RADV_TRACE_MODE_RRA = 1 << (VK_TRACE_MODE_COUNT + 1),
};
struct radv_instance { struct radv_instance {
struct vk_instance vk; struct vk_instance vk;