From 4c6f5cbb2a0465f7ab8cb9d7e7457d5e836e384d Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 31 Oct 2025 01:16:25 +0000 Subject: [PATCH] [vk, settings] Add options for common optional Vulkan extensions Signed-off-by: lizzie --- .../features/settings/model/BooleanSetting.kt | 17 ++ .../settings/model/view/SettingsItem.kt | 133 ++++++++++++ .../settings/ui/SettingsFragmentPresenter.kt | 18 +- .../app/src/main/res/values/strings.xml | 18 +- src/common/settings.h | 55 ++--- src/qt_common/config/shared_translation.cpp | 91 +++++--- .../vulkan_common/vulkan_device.cpp | 195 ++++++++---------- src/yuzu/configuration/configure_debug.cpp | 3 - src/yuzu/configuration/configure_debug.ui | 11 - 9 files changed, 373 insertions(+), 168 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt index 5c21ea7dc1..663a815fef 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt @@ -32,6 +32,23 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting { RENDERER_PROVOKING_VERTEX("provoking_vertex"), RENDERER_DESCRIPTOR_INDEXING("descriptor_indexing"), RENDERER_SAMPLE_SHADING("sample_shading"), + RENDERER_SHADER_ATOMIC_INT64("shader_atomic_int64"), + RENDERER_SHADER_DEMOTE_TO_HELPER_INVOCATION("shader_demote_to_helper_invocation"), + RENDERER_SUBGROUP_SIZE_CONTROL("subgroup_size_control"), + RENDERER_TRANSFORM_FEEDBACK("transform_feedback"), + RENDERER_VERTEX_INPUT_DYNAMIC_STATE("vertex_input_dynamic_state"), + RENDERER_PIPELINE_EXECUTABLE_PROPERTIES("pipeline_executable_properties"), + RENDERER_WORKGROUP_MEMORY_EXPLICIT_LAYOUT("workgroup_memory_explicit_layout"), + RENDERER_CUSTOM_BORDER_CONTROL("custom_border_color"), + RENDERER_DEPTH_BIAS_CONTROL("depth_bias_control"), + RENDERER_DEPTH_CLIP_CONTROL("depth_clip_control"), + RENDERER_SHADER_FLOAT16_INT8("shader_float16_int8"), + RENDERER_UNIFORM_BUFFER_STANDARD_LAYOUT("uniform_buffer_standard_layout"), + RENDERER_VARIABLE_POINTER("variable_pointer"), + RENDERER_HOST_QUERY_RESET("host_query_reset"), + RENDERER_BIT8_STORAGE("bit8_storage"), + RENDERER_TIMELINE_SEMAPHORE("timeline_semaphore"), + RENDERER_SPIRV_1_4("spirv_1_4"), PICTURE_IN_PICTURE("picture_in_picture"), USE_CUSTOM_RTC("custom_rtc_enabled"), BLACK_BACKGROUNDS("black_backgrounds"), diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt index 6dc5d66c7b..4d1f407848 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/SettingsItem.kt @@ -168,6 +168,139 @@ abstract class SettingsItem( units = "%" ) ) + put( + SwitchSetting( + BooleanSetting.RENDERER_SHADER_ATOMIC_INT64, + titleId = R.string.shader_atomic_int64, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_SHADER_DEMOTE_TO_HELPER_INVOCATION, + titleId = R.string.shader_demote_to_helper_invocation, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_SHADER_DEMOTE_TO_HELPER_INVOCATION, + titleId = R.string.shader_demote_to_helper_invocation, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_SUBGROUP_SIZE_CONTROL, + titleId = R.string.subgroup_size_control, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_TRANSFORM_FEEDBACK, + titleId = R.string.shader_demtransform_feedbackote_to_helper_invocation, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_VERTEX_INPUT_DYNAMIC_STATE, + titleId = R.string.vertex_input_dynamic_state, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_PIPELINE_EXECUTABLE_PROPERTIES, + titleId = R.string.pipeline_executable_properties, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_PIPELINE_EXECUTABLE_PROPERTIES, + titleId = R.string.pipeline_executable_properties, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_WORKGROUP_MEMORY_EXPLICIT_LAYOUT, + titleId = R.string.workgroup_memory_explicit_layout, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_CUSTOM_BORDER_CONTROL, + titleId = R.string.custom_border_color, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_DEPTH_BIAS_CONTROL, + titleId = R.string.depth_bias_control, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_DEPTH_CLIP_CONTROL, + titleId = R.string.depth_clip_control, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_SHADER_FLOAT16_INT8, + titleId = R.string.shader_float16_int8, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_UNIFORM_BUFFER_STANDARD_LAYOUT, + titleId = R.string.uniform_buffer_standard_layout, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_VARIABLE_POINTER, + titleId = R.string.variable_pointer, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_HOST_QUERY_RESET, + titleId = R.string.host_query_reset, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_BIT8_STORAGE, + titleId = R.string.bit8_storage, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_TIMELINE_SEMAPHORE, + titleId = R.string.timeline_semaphore, + descriptionId = 0 + ) + ) + put( + SwitchSetting( + BooleanSetting.RENDERER_SPIRV_1_4, + titleId = R.string.spirv_1_4, + descriptionId = 0 + ) + ) put( SliderSetting( ShortSetting.RENDERER_SPEED_LIMIT, diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt index 8a0bea158e..cb5f5e8577 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -457,7 +457,23 @@ class SettingsFragmentPresenter( add(BooleanSetting.RENDERER_DESCRIPTOR_INDEXING.key) add(BooleanSetting.RENDERER_SAMPLE_SHADING.key) add(IntSetting.RENDERER_SAMPLE_SHADING_FRACTION.key) - + add(BooleanSetting.RENDERER_SHADER_ATOMIC_INT64.key) + add(BooleanSetting.RENDERER_SHADER_DEMOTE_TO_HELPER_INVOCATION.key) + add(BooleanSetting.RENDERER_SUBGROUP_SIZE_CONTROL.key) + add(BooleanSetting.RENDERER_TRANSFORM_FEEDBACK.key) + add(BooleanSetting.RENDERER_VERTEX_INPUT_DYNAMIC_STATE.key) + add(BooleanSetting.RENDERER_PIPELINE_EXECUTABLE_PROPERTIES.key) + add(BooleanSetting.RENDERER_WORKGROUP_MEMORY_EXPLICIT_LAYOUT.key) + add(BooleanSetting.RENDERER_CUSTOM_BORDER_CONTROL.key) + add(BooleanSetting.RENDERER_DEPTH_BIAS_CONTROL.key) + add(BooleanSetting.RENDERER_DEPTH_CLIP_CONTROL.key) + add(BooleanSetting.RENDERER_SHADER_FLOAT16_INT8.key) + add(BooleanSetting.RENDERER_UNIFORM_BUFFER_STANDARD_LAYOUT.key) + add(BooleanSetting.RENDERER_VARIABLE_POINTER.key) + add(BooleanSetting.RENDERER_HOST_QUERY_RESET.key) + add(BooleanSetting.RENDERER_BIT8_STORAGE.key) + add(BooleanSetting.RENDERER_TIMELINE_SEMAPHORE.key) + add(BooleanSetting.RENDERER_SPIRV_1_4.key) add(HeaderSetting(R.string.veil_renderer)) add(BooleanSetting.RENDERER_EARLY_RELEASE_FENCES.key) add(IntSetting.DMA_ACCURACY.key) diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 03f546333a..d29904055b 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -102,7 +102,23 @@ Allows the fragment shader to execute per sample in a multi-sampled fragment instead once per fragment. Improves graphics quality at the cost of some performance. Only Vulkan 1.1+ devices support this extension. Sample Shading Fraction The intensity of the sample shading pass. Higher values improve quality more but also reduce performance to a greater extent. - + shader_atomic_int64 + Shader invocation demotion + Subgroup Size Control + Transform Feedback + Vertex Input Dynamic State + Pipeline Executable Properties + Workgroup Memory Explicit Layout + Custom Border Colour + Depth Bias Control + Depth Clip Control + Shader Float16 Int8 + UBO Standard Layout + Variable Pointers + Host Query Reset + 8-bit storage + Timeline Semaphore + SPIRV 1.4 Renderer Enhanced Frame Pacing Ensures smooth and consistent frame delivery by synchronizing the timing between frames, reducing stuttering and uneven animation. Ideal for games that experience frame timing instability or micro-stutters during gameplay. diff --git a/src/common/settings.h b/src/common/settings.h index 360a49c6c6..9394486a88 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -530,39 +530,46 @@ struct Values { SwitchableSetting dyna_state{linkage, #if defined (_WIN32) - 3, + 3, #elif defined (__FreeBSD__) - 3, + 3, #elif defined (ANDROID) - 0, + 0, #elif defined (__APPLE__) - 0, + 0, #else - 2, + 2, #endif - 0, - 3, - "dyna_state", - Category::RendererExtensions, - Specialization::Scalar}; - + 0, + 3, + "dyna_state", + Category::RendererExtensions, + Specialization::Scalar}; + SwitchableSetting force_unsupported_extensions{linkage, false, "force_unsupported_extensions", Category::RendererExtensions}; + // This bool must be BEFORE the option its referencing, otherwise very EVIL things will occur :) + SwitchableSetting sample_shading{linkage, false, "sample_shading", Category::RendererExtensions, Specialization::Paired}; + SwitchableSetting sample_shading_fraction{linkage, 50, 0, 100, "sample_shading_fraction", Category::RendererExtensions, Specialization::Scalar, true, false, &sample_shading}; SwitchableSetting provoking_vertex{linkage, false, "provoking_vertex", Category::RendererExtensions}; SwitchableSetting descriptor_indexing{linkage, false, "descriptor_indexing", Category::RendererExtensions}; - SwitchableSetting sample_shading{linkage, false, "sample_shading", Category::RendererExtensions, Specialization::Paired}; - SwitchableSetting sample_shading_fraction{linkage, - 50, - 0, - 100, - "sample_shading_fraction", - Category::RendererExtensions, - Specialization::Scalar, - true, - false, - &sample_shading}; + SwitchableSetting shader_atomic_int64{linkage, true, "shader_atomic_int64", Category::RendererExtensions}; + SwitchableSetting shader_demote_to_helper_invocation{linkage, true, "shader_demote_to_helper_invocation", Category::RendererExtensions}; + SwitchableSetting subgroup_size_control{linkage, true, "subgroup_size_control", Category::RendererExtensions}; + SwitchableSetting transform_feedback{linkage, true, "transform_feedback", Category::RendererExtensions}; + SwitchableSetting vertex_input_dynamic_state{linkage, true, "vertex_input_dynamic_state", Category::RendererExtensions}; + SwitchableSetting pipeline_executable_properties{linkage, true, "pipeline_executable_properties", Category::RendererExtensions}; + SwitchableSetting workgroup_memory_explicit_layout{linkage, true, "workgroup_memory_explicit_layout", Category::RendererExtensions}; + SwitchableSetting custom_border_color{linkage, true, "custom_border_color", Category::RendererExtensions}; + SwitchableSetting depth_bias_control{linkage, true, "depth_bias_control", Category::RendererExtensions}; + SwitchableSetting depth_clip_control{linkage, true, "depth_clip_control", Category::RendererExtensions}; + SwitchableSetting shader_float16_int8{linkage, true, "shader_float16_int8", Category::RendererExtensions}; + SwitchableSetting uniform_buffer_standard_layout{linkage, true, "uniform_buffer_standard_layout", Category::RendererExtensions}; + SwitchableSetting variable_pointer{linkage, true, "variable_pointer", Category::RendererExtensions}; + SwitchableSetting host_query_reset{linkage, true, "host_query_reset", Category::RendererExtensions}; + SwitchableSetting bit8_storage{linkage, true, "bit8_storage", Category::RendererExtensions}; + SwitchableSetting timeline_semaphore{linkage, true, "timeline_semaphore", Category::RendererExtensions}; + SwitchableSetting spirv_1_4{linkage, true, "spirv_1_4", Category::RendererExtensions}; Setting renderer_debug{linkage, false, "debug", Category::RendererDebug}; - Setting renderer_shader_feedback{linkage, false, "shader_feedback", - Category::RendererDebug}; Setting enable_nsight_aftermath{linkage, false, "nsight_aftermath", Category::RendererDebug}; Setting disable_shader_loop_safety_checks{ diff --git a/src/qt_common/config/shared_translation.cpp b/src/qt_common/config/shared_translation.cpp index b54211142c..6579f0d553 100644 --- a/src/qt_common/config/shared_translation.cpp +++ b/src/qt_common/config/shared_translation.cpp @@ -324,31 +324,74 @@ std::unique_ptr InitializeTranslations(QObject* parent) tr("Improves rendering of transparency effects in specific games.")); // Renderer (Extensions) - INSERT(Settings, - dyna_state, - tr("Extended Dynamic State"), - tr("Controls the number of features that can be used in Extended Dynamic State.\nHigher numbers allow for more features and can increase performance, but may cause issues.\nThe default value is per-system.")); - - INSERT(Settings, - provoking_vertex, - tr("Provoking Vertex"), - tr("Improves lighting and vertex handling in some games.\n" - "Only Vulkan 1.0+ devices support this extension.")); - - INSERT(Settings, - descriptor_indexing, - tr("Descriptor Indexing"), - tr("Improves texture & buffer handling and the Maxwell translation layer.\n" - "Some Vulkan 1.1+ and all 1.2+ devices support this extension.")); - + INSERT(Settings, dyna_state, + tr("Extended Dynamic State"), + tr("Controls the number of features that can be used in Extended Dynamic State.\nHigher numbers allow for more features and can increase performance, but may cause issues.\nThe default value is per-system.")); + INSERT(Settings, sample_shading_fraction, + tr("Sample Shading"), + tr("Allows the fragment shader to execute per sample in a multi-sampled fragment " + "instead of once per fragment. Improves graphics quality at the cost of performance.\n" + "Higher values improve quality but degrade performance.")); + INSERT(Settings, provoking_vertex, + tr("Provoking Vertex"), + tr("Improves lighting and vertex handling in some games.\n" + "Only Vulkan 1.0+ devices support this extension.")); + INSERT(Settings, descriptor_indexing, + tr("Descriptor Indexing"), + tr("Improves texture & buffer handling and the Maxwell translation layer.\n" + "Some Vulkan 1.1+ and all 1.2+ devices support this extension.")); INSERT(Settings, sample_shading, QString(), QString()); - - INSERT(Settings, - sample_shading_fraction, - tr("Sample Shading"), - tr("Allows the fragment shader to execute per sample in a multi-sampled fragment " - "instead of once per fragment. Improves graphics quality at the cost of performance.\n" - "Higher values improve quality but degrade performance.")); + INSERT(Settings, shader_atomic_int64, + tr("Shader Atomic Int64"), + QString()); + INSERT(Settings, shader_demote_to_helper_invocation, + tr("Shader Demote to helper invocation"), + QString()); + INSERT(Settings, subgroup_size_control, + tr("Subgroup size controls"), + QString()); + INSERT(Settings, transform_feedback, + tr("Transform feedback"), + QString()); + INSERT(Settings, vertex_input_dynamic_state, + tr("Vertex input dynamic state"), + QString()); + INSERT(Settings, pipeline_executable_properties, + tr("Pipeline executable properties"), + QString()); + INSERT(Settings, workgroup_memory_explicit_layout, + tr("Workgroup memory explicit layout"), + QString()); + INSERT(Settings, custom_border_color, + tr("Custom border colour"), + QString()); + INSERT(Settings, depth_bias_control, + tr("Depth bias control"), + QString()); + INSERT(Settings, depth_clip_control, + tr("Depth clip control"), + QString()); + INSERT(Settings, shader_float16_int8, + tr("Shader Float16 Int8"), + QString()); + INSERT(Settings, uniform_buffer_standard_layout, + tr("Uniform buffer standard layout"), + QString()); + INSERT(Settings, variable_pointer, + tr("Variable pointers"), + QString()); + INSERT(Settings, host_query_reset, + tr("Host query reset"), + QString()); + INSERT(Settings, bit8_storage, + tr("8-bit storage"), + QString()); + INSERT(Settings, timeline_semaphore, + tr("Timeline semaphore"), + QString()); + INSERT(Settings, spirv_1_4, + tr("SPIRV 1.4"), + QString()); // Renderer (Debug) diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 7b7c4b0b78..f50817b463 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -1208,129 +1208,116 @@ bool Device::GetSuitability(bool requires_swapchain) { } void Device::RemoveUnsuitableExtensions() { +// Enables without an expression predicate +#define ENABLE_IF_EXT(vk_name, var_name) \ + if (!Settings::values.var_name.GetValue()) \ + RemoveExtensionFeature(extensions.var_name, features.var_name, vk_name); +#define ENABLE_IF_EXT_P(vk_name, var_name, expr) \ + if (Settings::values.var_name.GetValue()) { \ + extensions.var_name = expr; \ + RemoveExtensionFeatureIfUnsuitable(extensions.var_name, features.var_name, vk_name); \ + } else { \ + RemoveExtensionFeature(extensions.var_name, features.var_name, vk_name); \ + } +#define ENABLE_IF_NO_FEAT(vk_name, var_name) \ + if (!Settings::values.var_name.GetValue()) \ + extensions.var_name = false; + + // Extensions without a feature without a predicate + // VK_KHR_spirv_1_4 + ENABLE_IF_NO_FEAT(VK_KHR_SPIRV_1_4_NAME, spirv_1_4) + + // Extensions (+features) without a predicate + // VK_KHR_shader_float16_int8 + ENABLE_IF_EXT(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, shader_float16_int8) + // VK_KHR_uniform_buffer_standard_layout + ENABLE_IF_EXT(VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, uniform_buffer_standard_layout) + // VK_KHR_variable_pointers + ENABLE_IF_EXT(VK_KHR_VARIABLE_POINTERS_EXTENSION_NAME, variable_pointer) + // VK_EXT_host_query_reset + ENABLE_IF_EXT(VK_EXT_HOST_QUERY_RESET_EXTENSION_NAME, host_query_reset) + // VK_KHR_bit8_storage + ENABLE_IF_EXT(VK_KHR_8BIT_STORAGE_EXTENSION_NAME, bit8_storage) + // VK_KHR_timeline_semaphore + ENABLE_IF_EXT(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME, timeline_semaphore) + + // Predicated extensions (+features) // VK_EXT_custom_border_color - extensions.custom_border_color = features.custom_border_color.customBorderColors && - features.custom_border_color.customBorderColorWithoutFormat; - RemoveExtensionFeatureIfUnsuitable(extensions.custom_border_color, features.custom_border_color, - VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME); - + ENABLE_IF_EXT_P(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, custom_border_color, + features.custom_border_color.customBorderColors + && features.custom_border_color.customBorderColorWithoutFormat) // VK_EXT_depth_bias_control - extensions.depth_bias_control = - features.depth_bias_control.depthBiasControl && - features.depth_bias_control.leastRepresentableValueForceUnormRepresentation; - RemoveExtensionFeatureIfUnsuitable(extensions.depth_bias_control, features.depth_bias_control, - VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME); - + ENABLE_IF_EXT_P(VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME, depth_bias_control, + features.depth_bias_control.depthBiasControl + && features.depth_bias_control.leastRepresentableValueForceUnormRepresentation) // VK_EXT_depth_clip_control - extensions.depth_clip_control = features.depth_clip_control.depthClipControl; - RemoveExtensionFeatureIfUnsuitable(extensions.depth_clip_control, features.depth_clip_control, - VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME); - - /* */ // VK_EXT_extended_dynamic_state + ENABLE_IF_EXT_P(VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME, depth_clip_control, + features.depth_clip_control.depthClipControl) + // VK_EXT_provoking_vertex + ENABLE_IF_EXT_P(VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME, provoking_vertex, + features.provoking_vertex.provokingVertexLast + && features.provoking_vertex.transformFeedbackPreservesProvokingVertex) + // VK_KHR_shader_atomic_int64 + ENABLE_IF_EXT_P(VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME, shader_atomic_int64, + features.shader_atomic_int64.shaderBufferInt64Atomics + && features.shader_atomic_int64.shaderSharedInt64Atomics) + // VK_EXT_shader_demote_to_helper_invocation + ENABLE_IF_EXT_P(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME, shader_demote_to_helper_invocation, + features.shader_demote_to_helper_invocation.shaderDemoteToHelperInvocation) + // VK_EXT_subgroup_size_control + ENABLE_IF_EXT_P(VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, subgroup_size_control, + features.subgroup_size_control.subgroupSizeControl + && properties.subgroup_size_control.minSubgroupSize <= GuestWarpSize + && properties.subgroup_size_control.maxSubgroupSize >= GuestWarpSize) + // VK_EXT_transform_feedback + ENABLE_IF_EXT_P(VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, transform_feedback, + features.transform_feedback.transformFeedback + && features.transform_feedback.geometryStreams + && properties.transform_feedback.maxTransformFeedbackStreams >= 4 + && properties.transform_feedback.maxTransformFeedbackBuffers > 0 + && properties.transform_feedback.transformFeedbackQueries + && properties.transform_feedback.transformFeedbackDraw) + // VK_EXT_vertex_input_dynamic_state + ENABLE_IF_EXT_P(VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME, vertex_input_dynamic_state, + features.vertex_input_dynamic_state.vertexInputDynamicState) + // VK_KHR_pipeline_executable_properties + ENABLE_IF_EXT_P(VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME, pipeline_executable_properties, + features.pipeline_executable_properties.pipelineExecutableInfo) + // VK_KHR_workgroup_memory_explicit_layout + ENABLE_IF_EXT_P(VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME, workgroup_memory_explicit_layout, + features.features.shaderInt16 + && features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayout + && features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayout8BitAccess + && features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayout16BitAccess + && features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayoutScalarBlockLayout) +#undef ENABLE_IF_EXT_P +#undef ENABLE_IF_EXT +#undef ENABLE_IF_FEAT + + // EDS is treated specially :) + // VK_EXT_extended_dynamic_state extensions.extended_dynamic_state = features.extended_dynamic_state.extendedDynamicState; RemoveExtensionFeatureIfUnsuitable(extensions.extended_dynamic_state, features.extended_dynamic_state, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); - // VK_EXT_extended_dynamic_state2 extensions.extended_dynamic_state2 = features.extended_dynamic_state2.extendedDynamicState2; RemoveExtensionFeatureIfUnsuitable(extensions.extended_dynamic_state2, features.extended_dynamic_state2, VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME); - // VK_EXT_extended_dynamic_state3 dynamic_state3_blending = - features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable && - features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation && - features.extended_dynamic_state3.extendedDynamicState3ColorWriteMask; + features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable + && features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation + && features.extended_dynamic_state3.extendedDynamicState3ColorWriteMask; dynamic_state3_enables = - features.extended_dynamic_state3.extendedDynamicState3DepthClampEnable && - features.extended_dynamic_state3.extendedDynamicState3LogicOpEnable; - + features.extended_dynamic_state3.extendedDynamicState3DepthClampEnable + && features.extended_dynamic_state3.extendedDynamicState3LogicOpEnable; extensions.extended_dynamic_state3 = dynamic_state3_blending || dynamic_state3_enables; dynamic_state3_blending = dynamic_state3_blending && extensions.extended_dynamic_state3; dynamic_state3_enables = dynamic_state3_enables && extensions.extended_dynamic_state3; RemoveExtensionFeatureIfUnsuitable(extensions.extended_dynamic_state3, - features.extended_dynamic_state3, - VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME); - - // VK_EXT_provoking_vertex - if (Settings::values.provoking_vertex.GetValue()) { - extensions.provoking_vertex = features.provoking_vertex.provokingVertexLast - && features.provoking_vertex - .transformFeedbackPreservesProvokingVertex; - RemoveExtensionFeatureIfUnsuitable(extensions.provoking_vertex, - features.provoking_vertex, - VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME); - } else { - RemoveExtensionFeature(extensions.provoking_vertex, - features.provoking_vertex, - VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME); - } - - // VK_KHR_shader_atomic_int64 - extensions.shader_atomic_int64 = features.shader_atomic_int64.shaderBufferInt64Atomics && - features.shader_atomic_int64.shaderSharedInt64Atomics; - RemoveExtensionFeatureIfUnsuitable(extensions.shader_atomic_int64, features.shader_atomic_int64, - VK_KHR_SHADER_ATOMIC_INT64_EXTENSION_NAME); - - // VK_EXT_shader_demote_to_helper_invocation - extensions.shader_demote_to_helper_invocation = - features.shader_demote_to_helper_invocation.shaderDemoteToHelperInvocation; - RemoveExtensionFeatureIfUnsuitable(extensions.shader_demote_to_helper_invocation, - features.shader_demote_to_helper_invocation, - VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME); - - // VK_EXT_subgroup_size_control - extensions.subgroup_size_control = - features.subgroup_size_control.subgroupSizeControl && - properties.subgroup_size_control.minSubgroupSize <= GuestWarpSize && - properties.subgroup_size_control.maxSubgroupSize >= GuestWarpSize; - RemoveExtensionFeatureIfUnsuitable(extensions.subgroup_size_control, - features.subgroup_size_control, - VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME); - - // VK_EXT_transform_feedback - extensions.transform_feedback = - features.transform_feedback.transformFeedback && - features.transform_feedback.geometryStreams && - properties.transform_feedback.maxTransformFeedbackStreams >= 4 && - properties.transform_feedback.maxTransformFeedbackBuffers > 0 && - properties.transform_feedback.transformFeedbackQueries && - properties.transform_feedback.transformFeedbackDraw; - RemoveExtensionFeatureIfUnsuitable(extensions.transform_feedback, features.transform_feedback, - VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME); - - // VK_EXT_vertex_input_dynamic_state - extensions.vertex_input_dynamic_state = - features.vertex_input_dynamic_state.vertexInputDynamicState; - RemoveExtensionFeatureIfUnsuitable(extensions.vertex_input_dynamic_state, - features.vertex_input_dynamic_state, - VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME); - - // VK_KHR_pipeline_executable_properties - if (Settings::values.renderer_shader_feedback.GetValue()) { - extensions.pipeline_executable_properties = - features.pipeline_executable_properties.pipelineExecutableInfo; - RemoveExtensionFeatureIfUnsuitable(extensions.pipeline_executable_properties, - features.pipeline_executable_properties, - VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME); - } else { - RemoveExtensionFeature(extensions.pipeline_executable_properties, - features.pipeline_executable_properties, - VK_KHR_PIPELINE_EXECUTABLE_PROPERTIES_EXTENSION_NAME); - } - - // VK_KHR_workgroup_memory_explicit_layout - extensions.workgroup_memory_explicit_layout = - features.features.shaderInt16 && - features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayout && - features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayout8BitAccess && - features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayout16BitAccess && - features.workgroup_memory_explicit_layout.workgroupMemoryExplicitLayoutScalarBlockLayout; - RemoveExtensionFeatureIfUnsuitable(extensions.workgroup_memory_explicit_layout, - features.workgroup_memory_explicit_layout, - VK_KHR_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_EXTENSION_NAME); + features.extended_dynamic_state3, VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME); } void Device::SetupFamilies(VkSurfaceKHR surface) { diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index db8956474c..beebf5eed2 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp @@ -59,8 +59,6 @@ void ConfigureDebug::SetConfiguration() { ui->disable_buffer_reorder->setChecked(Settings::values.disable_buffer_reorder.GetValue()); ui->enable_graphics_debugging->setEnabled(runtime_lock); ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug.GetValue()); - ui->enable_shader_feedback->setEnabled(runtime_lock); - ui->enable_shader_feedback->setChecked(Settings::values.renderer_shader_feedback.GetValue()); ui->enable_nsight_aftermath->setEnabled(runtime_lock); ui->enable_nsight_aftermath->setChecked(Settings::values.enable_nsight_aftermath.GetValue()); ui->dump_shaders->setEnabled(runtime_lock); @@ -101,7 +99,6 @@ void ConfigureDebug::ApplyConfiguration() { Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); Settings::values.enable_renderdoc_hotkey = ui->enable_renderdoc_hotkey->isChecked(); Settings::values.disable_buffer_reorder = ui->disable_buffer_reorder->isChecked(); - Settings::values.renderer_shader_feedback = ui->enable_shader_feedback->isChecked(); Settings::values.enable_nsight_aftermath = ui->enable_nsight_aftermath->isChecked(); Settings::values.dump_shaders = ui->dump_shaders->isChecked(); Settings::values.dump_macros = ui->dump_macros->isChecked(); diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui index 1f302bf118..a3f096ce0a 100644 --- a/src/yuzu/configuration/configure_debug.ui +++ b/src/yuzu/configuration/configure_debug.ui @@ -368,16 +368,6 @@ - - - - When checked, yuzu will log statistics about the compiled pipeline cache - - - Enable Shader Feedback - - - @@ -570,7 +560,6 @@ open_log_button homebrew_args_edit enable_graphics_debugging - enable_shader_feedback enable_nsight_aftermath fs_access_log reporting_services