summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-13 04:25:40 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:35 +0200
commitba3bdf1d4156fa6fd257305406a3b88f0c288006 (patch)
treead5fb92253aa88aaeea3459a35589bd961d33757
parentvk_pipeline_cache: Skip cached pipelines with different dynamic state (diff)
downloadyuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.tar
yuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.tar.gz
yuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.tar.bz2
yuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.tar.lz
yuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.tar.xz
yuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.tar.zst
yuzu-ba3bdf1d4156fa6fd257305406a3b88f0c288006.zip
-rw-r--r--src/video_core/vulkan_common/vulkan_device.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp
index 618535aae..8eb37a77a 100644
--- a/src/video_core/vulkan_common/vulkan_device.cpp
+++ b/src/video_core/vulkan_common/vulkan_device.cpp
@@ -425,6 +425,18 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
LOG_INFO(Render_Vulkan, "Device doesn't support provoking vertex last");
}
+ VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT vertex_input_dynamic;
+ if (ext_vertex_input_dynamic_state) {
+ vertex_input_dynamic = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT,
+ .pNext = nullptr,
+ .vertexInputDynamicState = VK_TRUE,
+ };
+ SetNext(next, vertex_input_dynamic);
+ } else {
+ LOG_INFO(Render_Vulkan, "Device doesn't support vertex input dynamic state");
+ }
+
VkPhysicalDeviceShaderAtomicInt64FeaturesKHR atomic_int64;
if (ext_shader_atomic_int64) {
atomic_int64 = {
@@ -732,6 +744,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
bool has_ext_extended_dynamic_state{};
bool has_ext_shader_atomic_int64{};
bool has_ext_provoking_vertex{};
+ bool has_ext_vertex_input_dynamic_state{};
for (const VkExtensionProperties& extension : physical.EnumerateDeviceExtensionProperties()) {
const auto test = [&](std::optional<std::reference_wrapper<bool>> status, const char* name,
bool push) {
@@ -763,6 +776,8 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
test(has_ext_extended_dynamic_state, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, false);
test(has_ext_subgroup_size_control, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, false);
test(has_ext_provoking_vertex, VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME, false);
+ test(has_ext_vertex_input_dynamic_state, VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME,
+ false);
test(has_ext_shader_atomic_int64, VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME, false);
test(has_khr_workgroup_memory_explicit_layout,
VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME, false);
@@ -827,6 +842,19 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
ext_provoking_vertex = true;
}
}
+ if (has_ext_vertex_input_dynamic_state) {
+ VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT vertex_input;
+ vertex_input.sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT;
+ vertex_input.pNext = nullptr;
+ features.pNext = &vertex_input;
+ physical.GetFeatures2KHR(features);
+
+ if (vertex_input.vertexInputDynamicState) {
+ extensions.push_back(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
+ ext_vertex_input_dynamic_state = true;
+ }
+ }
if (has_ext_shader_atomic_int64) {
VkPhysicalDeviceShaderAtomicInt64Features atomic_int64;
atomic_int64.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT;