diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 16 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 52 |
3 files changed, 47 insertions, 29 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 285a50ea4..f25842476 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -1049,15 +1049,27 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst | |||
| 1049 | dst_region, src_region, filter, operation); | 1049 | dst_region, src_region, filter, operation); |
| 1050 | return; | 1050 | return; |
| 1051 | } | 1051 | } |
| 1052 | ASSERT(src.format == dst.format); | ||
| 1052 | if (aspect_mask == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { | 1053 | if (aspect_mask == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) { |
| 1053 | if (!device.IsBlitDepthStencilSupported()) { | 1054 | const auto format = src.format; |
| 1055 | const auto can_blit_depth_stencil = [this, format] { | ||
| 1056 | switch (format) { | ||
| 1057 | case VideoCore::Surface::PixelFormat::D24_UNORM_S8_UINT: | ||
| 1058 | case VideoCore::Surface::PixelFormat::S8_UINT_D24_UNORM: | ||
| 1059 | return device.IsBlitDepth24Stencil8Supported(); | ||
| 1060 | case VideoCore::Surface::PixelFormat::D32_FLOAT_S8_UINT: | ||
| 1061 | return device.IsBlitDepth32Stencil8Supported(); | ||
| 1062 | default: | ||
| 1063 | UNREACHABLE(); | ||
| 1064 | } | ||
| 1065 | }(); | ||
| 1066 | if (!can_blit_depth_stencil) { | ||
| 1054 | UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa); | 1067 | UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa); |
| 1055 | blit_image_helper.BlitDepthStencil(dst_framebuffer, src.DepthView(), src.StencilView(), | 1068 | blit_image_helper.BlitDepthStencil(dst_framebuffer, src.DepthView(), src.StencilView(), |
| 1056 | dst_region, src_region, filter, operation); | 1069 | dst_region, src_region, filter, operation); |
| 1057 | return; | 1070 | return; |
| 1058 | } | 1071 | } |
| 1059 | } | 1072 | } |
| 1060 | ASSERT(src.format == dst.format); | ||
| 1061 | ASSERT(!(is_dst_msaa && !is_src_msaa)); | 1073 | ASSERT(!(is_dst_msaa && !is_src_msaa)); |
| 1062 | ASSERT(operation == Fermi2D::Operation::SrcCopy); | 1074 | ASSERT(operation == Fermi2D::Operation::SrcCopy); |
| 1063 | 1075 | ||
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index a88ff5ca5..18185610f 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -428,7 +428,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 428 | first_next = &diagnostics_nv; | 428 | first_next = &diagnostics_nv; |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | is_blit_depth_stencil_supported = TestDepthStencilBlits(); | 431 | is_blit_depth24_stencil8_supported = TestDepthStencilBlits(VK_FORMAT_D24_UNORM_S8_UINT); |
| 432 | is_blit_depth32_stencil8_supported = TestDepthStencilBlits(VK_FORMAT_D32_SFLOAT_S8_UINT); | ||
| 432 | is_optimal_astc_supported = ComputeIsOptimalAstcSupported(); | 433 | is_optimal_astc_supported = ComputeIsOptimalAstcSupported(); |
| 433 | is_warp_potentially_bigger = !extensions.subgroup_size_control || | 434 | is_warp_potentially_bigger = !extensions.subgroup_size_control || |
| 434 | properties.subgroup_size_control.maxSubgroupSize > GuestWarpSize; | 435 | properties.subgroup_size_control.maxSubgroupSize > GuestWarpSize; |
| @@ -782,14 +783,13 @@ bool Device::ComputeIsOptimalAstcSupported() const { | |||
| 782 | return true; | 783 | return true; |
| 783 | } | 784 | } |
| 784 | 785 | ||
| 785 | bool Device::TestDepthStencilBlits() const { | 786 | bool Device::TestDepthStencilBlits(VkFormat format) const { |
| 786 | static constexpr VkFormatFeatureFlags required_features = | 787 | static constexpr VkFormatFeatureFlags required_features = |
| 787 | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT; | 788 | VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT; |
| 788 | const auto test_features = [](VkFormatProperties props) { | 789 | const auto test_features = [](VkFormatProperties props) { |
| 789 | return (props.optimalTilingFeatures & required_features) == required_features; | 790 | return (props.optimalTilingFeatures & required_features) == required_features; |
| 790 | }; | 791 | }; |
| 791 | return test_features(format_properties.at(VK_FORMAT_D32_SFLOAT_S8_UINT)) && | 792 | return test_features(format_properties.at(format)); |
| 792 | test_features(format_properties.at(VK_FORMAT_D24_UNORM_S8_UINT)); | ||
| 793 | } | 793 | } |
| 794 | 794 | ||
| 795 | bool Device::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, | 795 | bool Device::IsFormatSupported(VkFormat wanted_format, VkFormatFeatureFlags wanted_usage, |
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 6c7fa34e5..8c5355a28 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -362,9 +362,14 @@ public: | |||
| 362 | return features.features.depthBounds; | 362 | return features.features.depthBounds; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | /// Returns true when blitting from and to depth stencil images is supported. | 365 | /// Returns true when blitting from and to D24S8 images is supported. |
| 366 | bool IsBlitDepthStencilSupported() const { | 366 | bool IsBlitDepth24Stencil8Supported() const { |
| 367 | return is_blit_depth_stencil_supported; | 367 | return is_blit_depth24_stencil8_supported; |
| 368 | } | ||
| 369 | |||
| 370 | /// Returns true when blitting from and to D32S8 images is supported. | ||
| 371 | bool IsBlitDepth32Stencil8Supported() const { | ||
| 372 | return is_blit_depth32_stencil8_supported; | ||
| 368 | } | 373 | } |
| 369 | 374 | ||
| 370 | /// Returns true if the device supports VK_NV_viewport_swizzle. | 375 | /// Returns true if the device supports VK_NV_viewport_swizzle. |
| @@ -674,7 +679,7 @@ private: | |||
| 674 | bool ComputeIsOptimalAstcSupported() const; | 679 | bool ComputeIsOptimalAstcSupported() const; |
| 675 | 680 | ||
| 676 | /// Returns true if the device natively supports blitting depth stencil images. | 681 | /// Returns true if the device natively supports blitting depth stencil images. |
| 677 | bool TestDepthStencilBlits() const; | 682 | bool TestDepthStencilBlits(VkFormat format) const; |
| 678 | 683 | ||
| 679 | private: | 684 | private: |
| 680 | VkInstance instance; ///< Vulkan instance. | 685 | VkInstance instance; ///< Vulkan instance. |
| @@ -738,25 +743,26 @@ private: | |||
| 738 | VkPhysicalDeviceProperties2 properties2{}; | 743 | VkPhysicalDeviceProperties2 properties2{}; |
| 739 | 744 | ||
| 740 | // Misc features | 745 | // Misc features |
| 741 | bool is_optimal_astc_supported{}; ///< Support for all guest ASTC formats. | 746 | bool is_optimal_astc_supported{}; ///< Support for all guest ASTC formats. |
| 742 | bool is_blit_depth_stencil_supported{}; ///< Support for blitting from and to depth stencil. | 747 | bool is_blit_depth24_stencil8_supported{}; ///< Support for blitting from and to D24S8. |
| 743 | bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. | 748 | bool is_blit_depth32_stencil8_supported{}; ///< Support for blitting from and to D32S8. |
| 744 | bool is_integrated{}; ///< Is GPU an iGPU. | 749 | bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. |
| 745 | bool is_virtual{}; ///< Is GPU a virtual GPU. | 750 | bool is_integrated{}; ///< Is GPU an iGPU. |
| 746 | bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. | 751 | bool is_virtual{}; ///< Is GPU a virtual GPU. |
| 747 | bool has_broken_compute{}; ///< Compute shaders can cause crashes | 752 | bool is_non_gpu{}; ///< Is SoftwareRasterizer, FPGA, non-GPU device. |
| 748 | bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit | 753 | bool has_broken_compute{}; ///< Compute shaders can cause crashes |
| 749 | bool has_renderdoc{}; ///< Has RenderDoc attached | 754 | bool has_broken_cube_compatibility{}; ///< Has broken cube compatibility bit |
| 750 | bool has_nsight_graphics{}; ///< Has Nsight Graphics attached | 755 | bool has_renderdoc{}; ///< Has RenderDoc attached |
| 751 | bool supports_d24_depth{}; ///< Supports D24 depth buffers. | 756 | bool has_nsight_graphics{}; ///< Has Nsight Graphics attached |
| 752 | bool cant_blit_msaa{}; ///< Does not support MSAA<->MSAA blitting. | 757 | bool supports_d24_depth{}; ///< Supports D24 depth buffers. |
| 753 | bool must_emulate_scaled_formats{}; ///< Requires scaled vertex format emulation | 758 | bool cant_blit_msaa{}; ///< Does not support MSAA<->MSAA blitting. |
| 754 | bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. | 759 | bool must_emulate_scaled_formats{}; ///< Requires scaled vertex format emulation |
| 755 | bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. | 760 | bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format. |
| 756 | bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. | 761 | bool dynamic_state3_blending{}; ///< Has all blending features of dynamic_state3. |
| 757 | bool supports_conditional_barriers{}; ///< Allows barriers in conditional control flow. | 762 | bool dynamic_state3_enables{}; ///< Has all enables features of dynamic_state3. |
| 758 | u64 device_access_memory{}; ///< Total size of device local memory in bytes. | 763 | bool supports_conditional_barriers{}; ///< Allows barriers in conditional control flow. |
| 759 | u32 sets_per_pool{}; ///< Sets per Description Pool | 764 | u64 device_access_memory{}; ///< Total size of device local memory in bytes. |
| 765 | u32 sets_per_pool{}; ///< Sets per Description Pool | ||
| 760 | 766 | ||
| 761 | // Telemetry parameters | 767 | // Telemetry parameters |
| 762 | std::set<std::string, std::less<>> supported_extensions; ///< Reported Vulkan extensions. | 768 | std::set<std::string, std::less<>> supported_extensions; ///< Reported Vulkan extensions. |