summaryrefslogtreecommitdiffstats
path: root/src/video_core/vulkan_common/vulkan_device.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-28 00:15:32 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-07-28 02:29:24 +0200
commit3b006f4fe28006d320c60fd2b4393fd3f27eacd7 (patch)
treee8704a3796e766a764e2643a2621451a8fe4ea49 /src/video_core/vulkan_common/vulkan_device.cpp
parentMerge pull request #6748 from lioncash/engine-init (diff)
downloadyuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar
yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.gz
yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.bz2
yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.lz
yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.xz
yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.tar.zst
yuzu-3b006f4fe28006d320c60fd2b4393fd3f27eacd7.zip
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.cpp')
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 44afdc1cd..8e56a89e1 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -526,6 +526,17 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
SetNext(next, workgroup_layout);
}
+ VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR executable_properties;
+ if (khr_pipeline_executable_properties) {
+ LOG_INFO(Render_Vulkan, "Enabling shader feedback, expect slower shader build times");
+ executable_properties = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR,
+ .pNext = nullptr,
+ .pipelineExecutableInfo = VK_TRUE,
+ };
+ SetNext(next, executable_properties);
+ }
+
if (!ext_depth_range_unrestricted) {
LOG_INFO(Render_Vulkan, "Device doesn't support depth range unrestricted");
}
@@ -824,6 +835,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
bool has_khr_shader_float16_int8{};
bool has_khr_workgroup_memory_explicit_layout{};
+ bool has_khr_pipeline_executable_properties{};
bool has_ext_subgroup_size_control{};
bool has_ext_transform_feedback{};
bool has_ext_custom_border_color{};
@@ -878,6 +890,10 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
test(nv_device_diagnostics_config, VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME,
true);
}
+ if (Settings::values.renderer_shader_feedback) {
+ test(has_khr_pipeline_executable_properties,
+ VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, false);
+ }
}
VkPhysicalDeviceFeatures2KHR features{};
features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
@@ -1033,6 +1049,19 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
khr_workgroup_memory_explicit_layout = true;
}
}
+ if (has_khr_pipeline_executable_properties) {
+ VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR executable_properties;
+ executable_properties.sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR;
+ executable_properties.pNext = nullptr;
+ features.pNext = &executable_properties;
+ physical.GetFeatures2KHR(features);
+
+ if (executable_properties.pipelineExecutableInfo) {
+ extensions.push_back(VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME);
+ khr_pipeline_executable_properties = true;
+ }
+ }
if (khr_push_descriptor) {
VkPhysicalDevicePushDescriptorPropertiesKHR push_descriptor;
push_descriptor.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR;