diff options
| author | 2023-10-17 02:38:07 +1100 | |
|---|---|---|
| committer | 2023-10-17 02:42:40 +1100 | |
| commit | 326ebbb2fa87f7e4006e1434649ba1f48b4bebfa (patch) | |
| tree | 96cf6f308e067b0c4157008ce7a6bca2f7c5bd65 /src/video_core/renderer_vulkan | |
| parent | Make Clang happy. (diff) | |
| download | yuzu-326ebbb2fa87f7e4006e1434649ba1f48b4bebfa.tar.gz yuzu-326ebbb2fa87f7e4006e1434649ba1f48b4bebfa.tar.xz yuzu-326ebbb2fa87f7e4006e1434649ba1f48b4bebfa.zip | |
Changes based on hardware tests
Removes unnecessary d32f to bgra shader and blit functions,
update vk_texture_cache to use abgr shader for d32f to BGRA formats
updates abgr to d32f shader to comply with hardware tests
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 4 |
3 files changed, 2 insertions, 15 deletions
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 5030dd200..1a40a4d05 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include "video_core/host_shaders/convert_abgr8_to_d32f_frag_spv.h" | 11 | #include "video_core/host_shaders/convert_abgr8_to_d32f_frag_spv.h" |
| 12 | #include "video_core/host_shaders/convert_d24s8_to_abgr8_frag_spv.h" | 12 | #include "video_core/host_shaders/convert_d24s8_to_abgr8_frag_spv.h" |
| 13 | #include "video_core/host_shaders/convert_d32f_to_abgr8_frag_spv.h" | 13 | #include "video_core/host_shaders/convert_d32f_to_abgr8_frag_spv.h" |
| 14 | #include "video_core/host_shaders/convert_d32f_to_bgra8_frag_spv.h" | ||
| 15 | #include "video_core/host_shaders/convert_depth_to_float_frag_spv.h" | 14 | #include "video_core/host_shaders/convert_depth_to_float_frag_spv.h" |
| 16 | #include "video_core/host_shaders/convert_float_to_depth_frag_spv.h" | 15 | #include "video_core/host_shaders/convert_float_to_depth_frag_spv.h" |
| 17 | #include "video_core/host_shaders/convert_s8d24_to_abgr8_frag_spv.h" | 16 | #include "video_core/host_shaders/convert_s8d24_to_abgr8_frag_spv.h" |
| @@ -440,7 +439,6 @@ BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_, | |||
| 440 | convert_d32f_to_abgr8_frag(BuildShader(device, CONVERT_D32F_TO_ABGR8_FRAG_SPV)), | 439 | convert_d32f_to_abgr8_frag(BuildShader(device, CONVERT_D32F_TO_ABGR8_FRAG_SPV)), |
| 441 | convert_d24s8_to_abgr8_frag(BuildShader(device, CONVERT_D24S8_TO_ABGR8_FRAG_SPV)), | 440 | convert_d24s8_to_abgr8_frag(BuildShader(device, CONVERT_D24S8_TO_ABGR8_FRAG_SPV)), |
| 442 | convert_s8d24_to_abgr8_frag(BuildShader(device, CONVERT_S8D24_TO_ABGR8_FRAG_SPV)), | 441 | convert_s8d24_to_abgr8_frag(BuildShader(device, CONVERT_S8D24_TO_ABGR8_FRAG_SPV)), |
| 443 | convert_d32f_to_bgra8_frag(BuildShader(device, CONVERT_D32F_TO_BGRA8_FRAG_SPV)), | ||
| 444 | linear_sampler(device.GetLogical().CreateSampler(SAMPLER_CREATE_INFO<VK_FILTER_LINEAR>)), | 442 | linear_sampler(device.GetLogical().CreateSampler(SAMPLER_CREATE_INFO<VK_FILTER_LINEAR>)), |
| 445 | nearest_sampler(device.GetLogical().CreateSampler(SAMPLER_CREATE_INFO<VK_FILTER_NEAREST>)) {} | 443 | nearest_sampler(device.GetLogical().CreateSampler(SAMPLER_CREATE_INFO<VK_FILTER_NEAREST>)) {} |
| 446 | 444 | ||
| @@ -591,13 +589,6 @@ void BlitImageHelper::ConvertS8D24ToABGR8(const Framebuffer* dst_framebuffer, | |||
| 591 | ConvertDepthStencil(*convert_s8d24_to_abgr8_pipeline, dst_framebuffer, src_image_view); | 589 | ConvertDepthStencil(*convert_s8d24_to_abgr8_pipeline, dst_framebuffer, src_image_view); |
| 592 | } | 590 | } |
| 593 | 591 | ||
| 594 | void BlitImageHelper::ConvertD32FToBGRA8(const Framebuffer* dst_framebuffer, | ||
| 595 | ImageView& src_image_view) { | ||
| 596 | ConvertPipelineColorTargetEx(convert_d32f_to_bgra8_pipeline, dst_framebuffer->RenderPass(), | ||
| 597 | convert_d32f_to_bgra8_frag); | ||
| 598 | ConvertDepthStencil(*convert_d32f_to_bgra8_pipeline, dst_framebuffer, src_image_view); | ||
| 599 | } | ||
| 600 | |||
| 601 | void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u8 color_mask, | 592 | void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u8 color_mask, |
| 602 | const std::array<f32, 4>& clear_color, | 593 | const std::array<f32, 4>& clear_color, |
| 603 | const Region2D& dst_region) { | 594 | const Region2D& dst_region) { |
diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index b3281ff3e..b2104a59e 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h | |||
| @@ -75,8 +75,6 @@ public: | |||
| 75 | 75 | ||
| 76 | void ConvertS8D24ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view); | 76 | void ConvertS8D24ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view); |
| 77 | 77 | ||
| 78 | void ConvertD32FToBGRA8(const Framebuffer* dst_framebuffer, ImageView& src_image_view); | ||
| 79 | |||
| 80 | void ClearColor(const Framebuffer* dst_framebuffer, u8 color_mask, | 78 | void ClearColor(const Framebuffer* dst_framebuffer, u8 color_mask, |
| 81 | const std::array<f32, 4>& clear_color, const Region2D& dst_region); | 79 | const std::array<f32, 4>& clear_color, const Region2D& dst_region); |
| 82 | 80 | ||
| @@ -138,7 +136,6 @@ private: | |||
| 138 | vk::ShaderModule convert_d32f_to_abgr8_frag; | 136 | vk::ShaderModule convert_d32f_to_abgr8_frag; |
| 139 | vk::ShaderModule convert_d24s8_to_abgr8_frag; | 137 | vk::ShaderModule convert_d24s8_to_abgr8_frag; |
| 140 | vk::ShaderModule convert_s8d24_to_abgr8_frag; | 138 | vk::ShaderModule convert_s8d24_to_abgr8_frag; |
| 141 | vk::ShaderModule convert_d32f_to_bgra8_frag; | ||
| 142 | vk::Sampler linear_sampler; | 139 | vk::Sampler linear_sampler; |
| 143 | vk::Sampler nearest_sampler; | 140 | vk::Sampler nearest_sampler; |
| 144 | 141 | ||
| @@ -159,7 +156,6 @@ private: | |||
| 159 | vk::Pipeline convert_d32f_to_abgr8_pipeline; | 156 | vk::Pipeline convert_d32f_to_abgr8_pipeline; |
| 160 | vk::Pipeline convert_d24s8_to_abgr8_pipeline; | 157 | vk::Pipeline convert_d24s8_to_abgr8_pipeline; |
| 161 | vk::Pipeline convert_s8d24_to_abgr8_pipeline; | 158 | vk::Pipeline convert_s8d24_to_abgr8_pipeline; |
| 162 | vk::Pipeline convert_d32f_to_bgra8_pipeline; | ||
| 163 | }; | 159 | }; |
| 164 | 160 | ||
| 165 | } // namespace Vulkan | 161 | } // namespace Vulkan |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index a4ee9295f..cdc41816f 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -1211,12 +1211,12 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im | |||
| 1211 | break; | 1211 | break; |
| 1212 | case PixelFormat::B8G8R8A8_SRGB: | 1212 | case PixelFormat::B8G8R8A8_SRGB: |
| 1213 | if (src_view.format == PixelFormat::D32_FLOAT) { | 1213 | if (src_view.format == PixelFormat::D32_FLOAT) { |
| 1214 | return blit_image_helper.ConvertD32FToBGRA8(dst, src_view); | 1214 | return blit_image_helper.ConvertD32FToABGR8(dst, src_view); |
| 1215 | } | 1215 | } |
| 1216 | break; | 1216 | break; |
| 1217 | case PixelFormat::B8G8R8A8_UNORM: | 1217 | case PixelFormat::B8G8R8A8_UNORM: |
| 1218 | if (src_view.format == PixelFormat::D32_FLOAT) { | 1218 | if (src_view.format == PixelFormat::D32_FLOAT) { |
| 1219 | return blit_image_helper.ConvertD32FToBGRA8(dst, src_view); | 1219 | return blit_image_helper.ConvertD32FToABGR8(dst, src_view); |
| 1220 | } | 1220 | } |
| 1221 | break; | 1221 | break; |
| 1222 | case PixelFormat::R32_FLOAT: | 1222 | case PixelFormat::R32_FLOAT: |