diff options
| author | 2023-02-18 18:23:36 +0000 | |
|---|---|---|
| committer | 2023-06-03 00:05:31 -0700 | |
| commit | 158a1896ec91c46a43fa3172fa472e6fc7c9eb05 (patch) | |
| tree | c9fefdf4e2a3f948d08bc32211675f19d936139e /src/video_core/vulkan_common | |
| parent | Disable push descriptors on adreno drivers (diff) | |
| download | yuzu-158a1896ec91c46a43fa3172fa472e6fc7c9eb05.tar.gz yuzu-158a1896ec91c46a43fa3172fa472e6fc7c9eb05.tar.xz yuzu-158a1896ec91c46a43fa3172fa472e6fc7c9eb05.zip | |
Implement scaled vertex buffer format emulation
These formats are unsupported by mobile GPUs so they need to be emulated in shaders instead.
Diffstat (limited to 'src/video_core/vulkan_common')
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 01540c10b..63e1c7d63 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -363,6 +363,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 363 | 363 | ||
| 364 | #ifdef ANDROID | 364 | #ifdef ANDROID |
| 365 | if (is_adreno) { | 365 | if (is_adreno) { |
| 366 | must_emulate_scaled_formats = true; | ||
| 367 | |||
| 366 | LOG_WARNING(Render_Vulkan, "Adreno drivers have broken VK_EXT_extended_dynamic_state"); | 368 | LOG_WARNING(Render_Vulkan, "Adreno drivers have broken VK_EXT_extended_dynamic_state"); |
| 367 | extensions.extended_dynamic_state = false; | 369 | extensions.extended_dynamic_state = false; |
| 368 | loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); | 370 | loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); |
| @@ -391,6 +393,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 391 | } | 393 | } |
| 392 | 394 | ||
| 393 | if (is_arm) { | 395 | if (is_arm) { |
| 396 | must_emulate_scaled_formats = true; | ||
| 397 | |||
| 394 | LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state"); | 398 | LOG_WARNING(Render_Vulkan, "ARM drivers have broken VK_EXT_extended_dynamic_state"); |
| 395 | extensions.extended_dynamic_state = false; | 399 | extensions.extended_dynamic_state = false; |
| 396 | loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); | 400 | loaded_extensions.erase(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME); |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 5f1c63ff9..f9d8c47ba 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -551,6 +551,10 @@ public: | |||
| 551 | return cant_blit_msaa; | 551 | return cant_blit_msaa; |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | bool MustEmulateScaledFormats() const { | ||
| 555 | return must_emulate_scaled_formats; | ||
| 556 | } | ||
| 557 | |||
| 554 | bool MustEmulateBGR565() const { | 558 | bool MustEmulateBGR565() const { |
| 555 | return must_emulate_bgr565; | 559 | return must_emulate_bgr565; |
| 556 | } | 560 | } |
| @@ -666,6 +670,7 @@ private: | |||
| 666 | bool has_nsight_graphics{}; ///< Has Nsight Graphics attached | 670 | bool has_nsight_graphics{}; ///< Has Nsight Graphics attached |
| 667 | bool supports_d24_depth{}; ///< Supports D24 depth buffers. | 671 | bool supports_d24_depth{}; ///< Supports D24 depth buffers. |
| 668 | bool cant_blit_msaa{}; ///< Does not support MSAA<->MSAA blitting. | 672 | bool cant_blit_msaa{}; ///< Does not support MSAA<->MSAA blitting. |
| 673 | bool must_emulate_scaled_formats{}; ///< Requires scaled vertex format emulation | ||
| 669 | bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. | 674 | bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. |
| 670 | bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. | 675 | bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. |
| 671 | bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. | 676 | bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. |