diff options
Diffstat (limited to 'src/video_core')
4 files changed, 22 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index b75d7220d..9a0b10568 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -347,6 +347,14 @@ VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const Device& device, | |||
| 347 | 347 | ||
| 348 | VkFormat VertexFormat(const Device& device, Maxwell::VertexAttribute::Type type, | 348 | VkFormat VertexFormat(const Device& device, Maxwell::VertexAttribute::Type type, |
| 349 | Maxwell::VertexAttribute::Size size) { | 349 | Maxwell::VertexAttribute::Size size) { |
| 350 | if (device.MustEmulateScaledFormats()) { | ||
| 351 | if (type == Maxwell::VertexAttribute::Type::SScaled) { | ||
| 352 | type = Maxwell::VertexAttribute::Type::SInt; | ||
| 353 | } else if (type == Maxwell::VertexAttribute::Type::UScaled) { | ||
| 354 | type = Maxwell::VertexAttribute::Type::UInt; | ||
| 355 | } | ||
| 356 | } | ||
| 357 | |||
| 350 | const VkFormat format{([&]() { | 358 | const VkFormat format{([&]() { |
| 351 | switch (type) { | 359 | switch (type) { |
| 352 | case Maxwell::VertexAttribute::Type::UnusedEnumDoNotUseBecauseItWillGoAway: | 360 | case Maxwell::VertexAttribute::Type::UnusedEnumDoNotUseBecauseItWillGoAway: |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index ec55e11b1..e39713761 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -114,14 +114,16 @@ Shader::AttributeType CastAttributeType(const FixedPipelineState::VertexAttribut | |||
| 114 | return Shader::AttributeType::Disabled; | 114 | return Shader::AttributeType::Disabled; |
| 115 | case Maxwell::VertexAttribute::Type::SNorm: | 115 | case Maxwell::VertexAttribute::Type::SNorm: |
| 116 | case Maxwell::VertexAttribute::Type::UNorm: | 116 | case Maxwell::VertexAttribute::Type::UNorm: |
| 117 | case Maxwell::VertexAttribute::Type::UScaled: | ||
| 118 | case Maxwell::VertexAttribute::Type::SScaled: | ||
| 119 | case Maxwell::VertexAttribute::Type::Float: | 117 | case Maxwell::VertexAttribute::Type::Float: |
| 120 | return Shader::AttributeType::Float; | 118 | return Shader::AttributeType::Float; |
| 121 | case Maxwell::VertexAttribute::Type::SInt: | 119 | case Maxwell::VertexAttribute::Type::SInt: |
| 122 | return Shader::AttributeType::SignedInt; | 120 | return Shader::AttributeType::SignedInt; |
| 123 | case Maxwell::VertexAttribute::Type::UInt: | 121 | case Maxwell::VertexAttribute::Type::UInt: |
| 124 | return Shader::AttributeType::UnsignedInt; | 122 | return Shader::AttributeType::UnsignedInt; |
| 123 | case Maxwell::VertexAttribute::Type::UScaled: | ||
| 124 | return Shader::AttributeType::UnsignedScaled; | ||
| 125 | case Maxwell::VertexAttribute::Type::SScaled: | ||
| 126 | return Shader::AttributeType::SignedScaled; | ||
| 125 | } | 127 | } |
| 126 | return Shader::AttributeType::Float; | 128 | return Shader::AttributeType::Float; |
| 127 | } | 129 | } |
| @@ -331,6 +333,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device | |||
| 331 | .support_derivative_control = true, | 333 | .support_derivative_control = true, |
| 332 | .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), | 334 | .support_geometry_shader_passthrough = device.IsNvGeometryShaderPassthroughSupported(), |
| 333 | .support_native_ndc = device.IsExtDepthClipControlSupported(), | 335 | .support_native_ndc = device.IsExtDepthClipControlSupported(), |
| 336 | .support_scaled_attributes = !device.MustEmulateScaledFormats(), | ||
| 334 | 337 | ||
| 335 | .warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(), | 338 | .warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(), |
| 336 | 339 | ||
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. |