vulkan/rmv: enable logging miscellaneous internal resources

Add the vk_rmv_misc_internal_description struct and list the misc_internal
member of that type in the vk_rmv_resource_create_token union, allowing
logging of different internal resources in RMV dumps.

The vk_rmv_common.h header also has the C-linkage block added in order to
enable its inclusion in C++ files.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27631>
This commit is contained in:
Zan Dobersek 2024-03-07 16:10:00 +01:00 committed by Marge Bot
parent 6965c569cc
commit e29677b16d
3 changed files with 28 additions and 0 deletions

View file

@ -32,6 +32,10 @@
#include <vulkan/vulkan_core.h>
#include "vk_rmv_tokens.h"
#ifdef __cplusplus
extern "C" {
#endif
struct vk_memory_trace_data;
/*
@ -137,4 +141,8 @@ uint32_t vk_rmv_get_resource_id_locked(struct vk_device *device, uint64_t handle
* The memory trace mutex should be locked when entering this function. */
void vk_rmv_destroy_resource_id_locked(struct vk_device *device, uint64_t handle);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1394,6 +1394,14 @@ rmt_dump_command_buffer_resource(struct vk_rmv_command_buffer_description *descr
fwrite(data, 44, 1, output);
}
static void
rmt_dump_misc_internal_resource(struct vk_rmv_misc_internal_description *description,
FILE *output)
{
/* 8 bits of zero-value enum are the only thing in the payload */
fwrite(&description->type, 1, 1, output);
}
static void
rmt_dump_resource_create(struct vk_rmv_resource_create_token *token, FILE *output)
{
@ -1434,6 +1442,9 @@ rmt_dump_resource_create(struct vk_rmv_resource_create_token *token, FILE *outpu
case VK_RMV_RESOURCE_TYPE_COMMAND_ALLOCATOR:
rmt_dump_command_buffer_resource(&token->command_buffer, output);
break;
case VK_RMV_RESOURCE_TYPE_MISC_INTERNAL:
rmt_dump_misc_internal_resource(&token->misc_internal, output);
break;
default:
unreachable("invalid resource type");
}

View file

@ -224,6 +224,14 @@ struct vk_rmv_command_buffer_description {
uint64_t app_available_scratch_size;
};
enum vk_rmv_misc_internal_type {
VK_RMV_MISC_INTERNAL_TYPE_PADDING,
};
struct vk_rmv_misc_internal_description {
enum vk_rmv_misc_internal_type type;
};
struct vk_rmv_resource_create_token {
uint32_t resource_id;
bool is_driver_internal;
@ -238,6 +246,7 @@ struct vk_rmv_resource_create_token {
struct vk_rmv_pipeline_description pipeline;
struct vk_rmv_descriptor_pool_description descriptor_pool;
struct vk_rmv_command_buffer_description command_buffer;
struct vk_rmv_misc_internal_description misc_internal;
};
};