diff options
| author | bunnei <bunneidev@gmail.com> | 2020-05-07 12:18:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-07 12:18:53 -0400 |
| commit | 028f6fdbf64d408950bdc15482d8c0614ac46a9e (patch) | |
| tree | 9e954dbcd34ec83468681f059f9c99ceaf2ee441 /src/video_core/renderer_vulkan/vk_device.cpp | |
| parent | 3c39a87146b9cd0daf6dc0bd226bd25ea36bd170 (diff) | |
| parent | 227278098a6b883e3a40faeb28ec8f130d898240 (diff) | |
Merge pull request #3884 from ReinUsesLisp/border-colors
vk_sampler_cache: Use VK_EXT_custom_border_color when available
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_device.cpp')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index 0e4bbca97..09ddfa59c 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp @@ -293,6 +293,17 @@ bool VKDevice::Create() { LOG_INFO(Render_Vulkan, "Device doesn't support transform feedbacks"); } + VkPhysicalDeviceCustomBorderColorFeaturesEXT custom_border; + if (ext_custom_border_color) { + custom_border.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; + custom_border.pNext = nullptr; + custom_border.customBorderColors = VK_TRUE; + custom_border.customBorderColorWithoutFormat = VK_TRUE; + SetNext(next, custom_border); + } else { + LOG_INFO(Render_Vulkan, "Device doesn't support custom border colors"); + } + if (!ext_depth_range_unrestricted) { LOG_INFO(Render_Vulkan, "Device doesn't support depth range unrestricted"); } @@ -520,6 +531,7 @@ std::vector<const char*> VKDevice::LoadExtensions() { bool has_khr_shader_float16_int8{}; bool has_ext_subgroup_size_control{}; bool has_ext_transform_feedback{}; + bool has_ext_custom_border_color{}; for (const auto& extension : physical.EnumerateDeviceExtensionProperties()) { Test(extension, khr_uniform_buffer_standard_layout, VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, true); @@ -534,6 +546,8 @@ std::vector<const char*> VKDevice::LoadExtensions() { false); Test(extension, has_ext_transform_feedback, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, false); + Test(extension, has_ext_custom_border_color, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, + false); if (Settings::values.renderer_debug) { Test(extension, nv_device_diagnostics_config, VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME, true); @@ -606,6 +620,19 @@ std::vector<const char*> VKDevice::LoadExtensions() { } } + if (has_ext_custom_border_color) { + VkPhysicalDeviceCustomBorderColorFeaturesEXT border_features; + border_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT; + border_features.pNext = nullptr; + features.pNext = &border_features; + physical.GetFeatures2KHR(features); + + if (border_features.customBorderColors && border_features.customBorderColorWithoutFormat) { + extensions.push_back(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); + ext_custom_border_color = true; + } + } + return extensions; } |
