From b33ccdf0cd7cfc1782dd27bb88141e693fd4dce2 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sat, 19 May 2018 15:49:37 -0500 Subject: [PATCH] [Vulkan] Better debug names. --- src/xenia/gpu/vulkan/pipeline_cache.cc | 15 +++++++++++++++ src/xenia/gpu/vulkan/render_cache.cc | 6 ++++-- src/xenia/gpu/vulkan/vulkan_shader.cc | 9 ++++++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/xenia/gpu/vulkan/pipeline_cache.cc b/src/xenia/gpu/vulkan/pipeline_cache.cc index a82bb996d..3e0d8744c 100644 --- a/src/xenia/gpu/vulkan/pipeline_cache.cc +++ b/src/xenia/gpu/vulkan/pipeline_cache.cc @@ -118,6 +118,9 @@ VkResult PipelineCache::Initialize( if (status != VK_SUCCESS) { return status; } + device_->DbgSetObjectName(uint64_t(geometry_shaders_.line_quad_list), + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, + "S(g): Line Quad List"); shader_module_info.codeSize = static_cast(sizeof(point_list_geom)); shader_module_info.pCode = reinterpret_cast(point_list_geom); @@ -126,6 +129,9 @@ VkResult PipelineCache::Initialize( if (status != VK_SUCCESS) { return status; } + device_->DbgSetObjectName(uint64_t(geometry_shaders_.point_list), + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, + "S(g): Point List"); shader_module_info.codeSize = static_cast(sizeof(quad_list_geom)); shader_module_info.pCode = reinterpret_cast(quad_list_geom); @@ -134,6 +140,9 @@ VkResult PipelineCache::Initialize( if (status != VK_SUCCESS) { return status; } + device_->DbgSetObjectName(uint64_t(geometry_shaders_.quad_list), + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, + "S(g): Quad List"); shader_module_info.codeSize = static_cast(sizeof(rect_list_geom)); shader_module_info.pCode = reinterpret_cast(rect_list_geom); @@ -142,6 +151,9 @@ VkResult PipelineCache::Initialize( if (status != VK_SUCCESS) { return status; } + device_->DbgSetObjectName(uint64_t(geometry_shaders_.rect_list), + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, + "S(g): Rect List"); shader_module_info.codeSize = static_cast(sizeof(dummy_frag)); shader_module_info.pCode = reinterpret_cast(dummy_frag); @@ -150,6 +162,9 @@ VkResult PipelineCache::Initialize( if (status != VK_SUCCESS) { return status; } + device_->DbgSetObjectName(uint64_t(dummy_pixel_shader_), + VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, + "S(p): Dummy"); return VK_SUCCESS; } diff --git a/src/xenia/gpu/vulkan/render_cache.cc b/src/xenia/gpu/vulkan/render_cache.cc index 6b048ad53..a961ef7c4 100644 --- a/src/xenia/gpu/vulkan/render_cache.cc +++ b/src/xenia/gpu/vulkan/render_cache.cc @@ -220,8 +220,10 @@ VkResult CachedTileView::Initialize(VkCommandBuffer command_buffer) { device_->DbgSetObjectName( reinterpret_cast(image), VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - xe::format_string("RT: 0x%.8X 0x%.8X(%d)", key.tile_offset, - key.tile_width, key.tile_width)); + xe::format_string("RT(d): 0x%.8X 0x%.8X(%d) 0x%.8X(%d) %d %d %d", + key.tile_offset, key.tile_width, key.tile_width, + key.tile_height, key.tile_height, key.color_or_depth, + key.msaa_samples, key.edram_format)); VkMemoryRequirements memory_requirements; vkGetImageMemoryRequirements(*device_, image, &memory_requirements); diff --git a/src/xenia/gpu/vulkan/vulkan_shader.cc b/src/xenia/gpu/vulkan/vulkan_shader.cc index 13b291310..ca0918e2d 100644 --- a/src/xenia/gpu/vulkan/vulkan_shader.cc +++ b/src/xenia/gpu/vulkan/vulkan_shader.cc @@ -49,9 +49,12 @@ bool VulkanShader::Prepare() { vkCreateShaderModule(*device_, &shader_info, nullptr, &shader_module_); CheckResult(status, "vkCreateShaderModule"); - device_->DbgSetObjectName(uint64_t(shader_module_), - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, - xe::format_string("S: %.16llX", ucode_data_hash())); + char typeChar = shader_type_ == ShaderType::kPixel + ? 'p' + : shader_type_ == ShaderType::kVertex ? 'v' : 'u'; + device_->DbgSetObjectName( + uint64_t(shader_module_), VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT, + xe::format_string("S(%c): %.16llX", typeChar, ucode_data_hash())); return status == VK_SUCCESS; }