diff options
| author | 2023-06-12 16:50:59 -0300 | |
|---|---|---|
| committer | 2023-06-12 16:50:59 -0300 | |
| commit | 42b2bc204f13966fd08af07dd08448bbefe14afa (patch) | |
| tree | 5676f2516f33f855a02df13e89d401c8067fae21 /src/video_core | |
| parent | Merge pull request #10693 from liamwhite/f64-to-f32 (diff) | |
| parent | shader_recompiler: remove barriers in conditional control flow when device la... (diff) | |
| download | yuzu-42b2bc204f13966fd08af07dd08448bbefe14afa.tar.gz yuzu-42b2bc204f13966fd08af07dd08448bbefe14afa.tar.xz yuzu-42b2bc204f13966fd08af07dd08448bbefe14afa.zip | |
Merge pull request #10699 from liamwhite/conditional-barrier
shader_recompiler: remove barriers in conditional control flow when device lacks support
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 5 |
5 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp index 400c21981..03d234f2f 100644 --- a/src/video_core/renderer_opengl/gl_device.cpp +++ b/src/video_core/renderer_opengl/gl_device.cpp | |||
| @@ -201,6 +201,7 @@ Device::Device(Core::Frontend::EmuWindow& emu_window) { | |||
| 201 | use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && | 201 | use_asynchronous_shaders = Settings::values.use_asynchronous_shaders.GetValue() && |
| 202 | !(is_amd || (is_intel && !is_linux)) && !strict_context_required; | 202 | !(is_amd || (is_intel && !is_linux)) && !strict_context_required; |
| 203 | use_driver_cache = is_nvidia; | 203 | use_driver_cache = is_nvidia; |
| 204 | supports_conditional_barriers = !is_intel; | ||
| 204 | 205 | ||
| 205 | LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); | 206 | LOG_INFO(Render_OpenGL, "Renderer_VariableAOFFI: {}", has_variable_aoffi); |
| 206 | LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); | 207 | LOG_INFO(Render_OpenGL, "Renderer_ComponentIndexingBug: {}", has_component_indexing_bug); |
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index cc0b95f1a..ad27264e5 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h | |||
| @@ -188,6 +188,10 @@ public: | |||
| 188 | return strict_context_required; | 188 | return strict_context_required; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | bool SupportsConditionalBarriers() const { | ||
| 192 | return supports_conditional_barriers; | ||
| 193 | } | ||
| 194 | |||
| 191 | private: | 195 | private: |
| 192 | static bool TestVariableAoffi(); | 196 | static bool TestVariableAoffi(); |
| 193 | static bool TestPreciseBug(); | 197 | static bool TestPreciseBug(); |
| @@ -233,6 +237,7 @@ private: | |||
| 233 | bool has_bool_ref_bug{}; | 237 | bool has_bool_ref_bug{}; |
| 234 | bool can_report_memory{}; | 238 | bool can_report_memory{}; |
| 235 | bool strict_context_required{}; | 239 | bool strict_context_required{}; |
| 240 | bool supports_conditional_barriers{}; | ||
| 236 | 241 | ||
| 237 | std::string vendor_name; | 242 | std::string vendor_name; |
| 238 | }; | 243 | }; |
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index dd8caa556..3f077311e 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -239,6 +239,7 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo | |||
| 239 | .support_snorm_render_buffer = false, | 239 | .support_snorm_render_buffer = false, |
| 240 | .support_viewport_index_layer = device.HasVertexViewportLayer(), | 240 | .support_viewport_index_layer = device.HasVertexViewportLayer(), |
| 241 | .support_geometry_shader_passthrough = device.HasGeometryShaderPassthrough(), | 241 | .support_geometry_shader_passthrough = device.HasGeometryShaderPassthrough(), |
| 242 | .support_conditional_barrier = device.SupportsConditionalBarriers(), | ||
| 242 | } { | 243 | } { |
| 243 | if (use_asynchronous_shaders) { | 244 | if (use_asynchronous_shaders) { |
| 244 | workers = CreateWorkers(); | 245 | workers = CreateWorkers(); |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 0158b6b0d..a46f9beed 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -386,6 +386,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 386 | IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, | 386 | IsFormatSupported(VK_FORMAT_D24_UNORM_S8_UINT, |
| 387 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, FormatType::Optimal); | 387 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT, FormatType::Optimal); |
| 388 | 388 | ||
| 389 | supports_conditional_barriers = !(is_intel_anv || is_intel_windows); | ||
| 390 | |||
| 389 | CollectPhysicalMemoryInfo(); | 391 | CollectPhysicalMemoryInfo(); |
| 390 | CollectToolingInfo(); | 392 | CollectToolingInfo(); |
| 391 | 393 | ||
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 0c53e35a6..f314d0ffe 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -585,6 +585,10 @@ public: | |||
| 585 | return properties.properties.limits.maxVertexInputBindings; | 585 | return properties.properties.limits.maxVertexInputBindings; |
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | bool SupportsConditionalBarriers() const { | ||
| 589 | return supports_conditional_barriers; | ||
| 590 | } | ||
| 591 | |||
| 588 | private: | 592 | private: |
| 589 | /// Checks if the physical device is suitable and configures the object state | 593 | /// Checks if the physical device is suitable and configures the object state |
| 590 | /// with all necessary info about its properties. | 594 | /// with all necessary info about its properties. |
| @@ -688,6 +692,7 @@ private: | |||
| 688 | bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. | 692 | bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. |
| 689 | bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. | 693 | bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. |
| 690 | bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. | 694 | bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. |
| 695 | bool supports_conditional_barriers{}; ///< Allows barriers in conditional control flow. | ||
| 691 | u64 device_access_memory{}; ///< Total size of device local memory in bytes. | 696 | u64 device_access_memory{}; ///< Total size of device local memory in bytes. |
| 692 | u32 sets_per_pool{}; ///< Sets per Description Pool | 697 | u32 sets_per_pool{}; ///< Sets per Description Pool |
| 693 | 698 | ||