diff options
author | Alex Smith <[email protected]> | 2017-10-27 14:25:05 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-10-29 00:28:45 +0200 |
commit | de889794134e6245e08a24425a6d686a1be584b8 (patch) | |
tree | 1ed5daf5009b6ffaf10a70d5fb83d067028fe6b4 /src/amd/vulkan/radv_device.c | |
parent | 0a23841a98dacad1fbc81f34479ce194e86fc99a (diff) |
radv: Implement VK_AMD_shader_info
This allows an app to query shader statistics and get a disassembly of
a shader. RenderDoc git has support for it, so this allows you to view
shader disassembly from a capture.
When this extension is enabled on a device (or when tracing), we now
disable pipeline caching, since we don't get the shader debug info when
we retrieve cached shaders.
v2: Improvements to resource usage reporting
v3: Disassembly string must be null terminated (string_buffer's length
does not include the terminator)
v4: Fixed LDS reporting. (Bas)
Signed-off-by: Alex Smith <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index d25e9c97ba8..0c2f6fa6312 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -944,10 +944,15 @@ VkResult radv_CreateDevice( VkResult result; struct radv_device *device; + bool keep_shader_info = false; + for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { const char *ext_name = pCreateInfo->ppEnabledExtensionNames[i]; if (!radv_physical_device_extension_supported(physical_device, ext_name)) return vk_error(VK_ERROR_EXTENSION_NOT_PRESENT); + + if (strcmp(ext_name, VK_AMD_SHADER_INFO_EXTENSION_NAME) == 0) + keep_shader_info = true; } /* Check enabled features */ @@ -1041,10 +1046,14 @@ VkResult radv_CreateDevice( device->physical_device->rad_info.max_se >= 2; if (getenv("RADV_TRACE_FILE")) { + keep_shader_info = true; + if (!radv_init_trace(device)) goto fail; } + device->keep_shader_info = keep_shader_info; + result = radv_device_init_meta(device); if (result != VK_SUCCESS) goto fail; |