diff --git a/backends/vulkan/runtime/api/Context.cpp b/backends/vulkan/runtime/api/Context.cpp index adb8409d28c..326391424df 100644 --- a/backends/vulkan/runtime/api/Context.cpp +++ b/backends/vulkan/runtime/api/Context.cpp @@ -288,9 +288,8 @@ Context* context() { return context.get(); } -#ifdef VULKAN_DEBUG - -#ifdef VK_KHR_pipeline_executable_properties +#if defined(VK_KHR_pipeline_executable_properties) && \ + defined(ETVK_INSPECT_PIPELINES) VkPipeline Context::get_shader_pipeline( const vkapi::ShaderInfo& shader, @@ -502,9 +501,7 @@ void Context::print_shader_executable_properties( } } -#endif // VK_KHR_pipeline_executable_properties - -#endif // VULKAN_DEBUG +#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES } // namespace api } // namespace vkcompute diff --git a/backends/vulkan/runtime/api/Context.h b/backends/vulkan/runtime/api/Context.h index 9c7301b9971..5764cb6a894 100644 --- a/backends/vulkan/runtime/api/Context.h +++ b/backends/vulkan/runtime/api/Context.h @@ -234,9 +234,8 @@ class Context final { void flush(); -#ifdef VULKAN_DEBUG - -#ifdef VK_KHR_pipeline_executable_properties +#if defined(VK_KHR_pipeline_executable_properties) && \ + defined(ETVK_INSPECT_PIPELINES) VkPipeline get_shader_pipeline( const vkapi::ShaderInfo& shader, @@ -260,9 +259,7 @@ class Context final { const vkapi::ShaderInfo& shader, const vkapi::SpecVarList& spec_constants); -#endif // VK_KHR_pipeline_executable_properties - -#endif // VULKAN_DEBUG +#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES }; bool available(); diff --git a/backends/vulkan/runtime/vk_api/Adapter.cpp b/backends/vulkan/runtime/vk_api/Adapter.cpp index aa76b202882..e0b2f1c978b 100644 --- a/backends/vulkan/runtime/vk_api/Adapter.cpp +++ b/backends/vulkan/runtime/vk_api/Adapter.cpp @@ -113,9 +113,10 @@ VkDevice create_logical_device( #ifdef VK_KHR_shader_integer_dot_product VK_KHR_SHADER_INTEGER_DOT_PRODUCT_EXTENSION_NAME, #endif /* VK_KHR_shader_integer_dot_product */ -#if defined(VK_KHR_pipeline_executable_properties) && defined(VULKAN_DEBUG) +#if defined(VK_KHR_pipeline_executable_properties) && \ + defined(ETVK_INSPECT_PIPELINES) VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, -#endif /* VK_KHR_pipeline_executable_properties */ +#endif /* VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES */ }; std::vector enabled_device_extensions; diff --git a/backends/vulkan/runtime/vk_api/Pipeline.cpp b/backends/vulkan/runtime/vk_api/Pipeline.cpp index 994b46b8c76..6fa85924223 100644 --- a/backends/vulkan/runtime/vk_api/Pipeline.cpp +++ b/backends/vulkan/runtime/vk_api/Pipeline.cpp @@ -298,10 +298,11 @@ ComputePipeline::ComputePipeline( }; VkPipelineCreateFlags flags = 0u; -#if defined(VULKAN_DEBUG) && defined(VK_KHR_pipeline_executable_properties) +#if defined(VK_KHR_pipeline_executable_properties) && \ + defined(ETVK_INSPECT_PIPELINES) flags = VK_PIPELINE_CREATE_CAPTURE_STATISTICS_BIT_KHR | VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR | flags; -#endif /* VULKAN_DEBUG && VK_KHR_pipeline_executable_properties */ +#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES const VkComputePipelineCreateInfo compute_pipeline_create_info{ VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO, // sType diff --git a/backends/vulkan/test/vulkan_compute_api_test.cpp b/backends/vulkan/test/vulkan_compute_api_test.cpp index 189562178a7..7e3d957afdb 100644 --- a/backends/vulkan/test/vulkan_compute_api_test.cpp +++ b/backends/vulkan/test/vulkan_compute_api_test.cpp @@ -102,14 +102,15 @@ TEST_F(VulkanComputeAPITest, print_adapter) { std::cout << *(context()->adapter_ptr()) << std::endl; } -#if defined(VULKAN_DEBUG) && defined(VK_KHR_pipeline_executable_properties) +#if defined(VK_KHR_pipeline_executable_properties) && \ + defined(ETVK_INSPECT_PIPELINES) TEST_F(VulkanComputeAPITest, print_shader_executable_properties) { context()->print_shader_executable_properties( VK_KERNEL(binary_add_nobroadcast__test_half), {0}); } -#endif // VULKAN_DEBUG && VK_KHR_pipeline_executable_properties +#endif // VK_KHR_pipeline_executable_properties && ETVK_INSPECT_PIPELINES std::vector get_reference_strides( const std::vector& sizes,