summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/acc/acc.cpp12
-rw-r--r--src/core/hle/service/hle_ipc.cpp58
-rw-r--r--src/core/hle/service/hle_ipc.h6
-rw-r--r--src/core/hle/service/prepo/prepo.cpp40
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt1
-rw-r--r--src/video_core/host_shaders/convert_abgr8_to_d32f.frag15
-rw-r--r--src/video_core/host_shaders/convert_d32f_to_abgr8.frag2
-rw-r--r--src/video_core/renderer_vulkan/blit_image.cpp9
-rw-r--r--src/video_core/renderer_vulkan/blit_image.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp21
10 files changed, 121 insertions, 47 deletions
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index b7d14060c..1b1c8190e 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -407,13 +407,13 @@ protected:
407 IPC::RequestParser rp{ctx}; 407 IPC::RequestParser rp{ctx};
408 const auto base = rp.PopRaw<ProfileBase>(); 408 const auto base = rp.PopRaw<ProfileBase>();
409 409
410 const auto user_data = ctx.ReadBuffer(); 410 const auto image_data = ctx.ReadBufferA(0);
411 const auto image_data = ctx.ReadBuffer(1); 411 const auto user_data = ctx.ReadBufferX(0);
412 412
413 LOG_DEBUG(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}", 413 LOG_INFO(Service_ACC, "called, username='{}', timestamp={:016X}, uuid=0x{}",
414 Common::StringFromFixedZeroTerminatedBuffer( 414 Common::StringFromFixedZeroTerminatedBuffer(
415 reinterpret_cast<const char*>(base.username.data()), base.username.size()), 415 reinterpret_cast<const char*>(base.username.data()), base.username.size()),
416 base.timestamp, base.user_uuid.RawString()); 416 base.timestamp, base.user_uuid.RawString());
417 417
418 if (user_data.size() < sizeof(UserData)) { 418 if (user_data.size() < sizeof(UserData)) {
419 LOG_ERROR(Service_ACC, "UserData buffer too small!"); 419 LOG_ERROR(Service_ACC, "UserData buffer too small!");
diff --git a/src/core/hle/service/hle_ipc.cpp b/src/core/hle/service/hle_ipc.cpp
index f6a1e54f2..6f3ae3cc4 100644
--- a/src/core/hle/service/hle_ipc.cpp
+++ b/src/core/hle/service/hle_ipc.cpp
@@ -23,6 +23,17 @@
23#include "core/hle/service/ipc_helpers.h" 23#include "core/hle/service/ipc_helpers.h"
24#include "core/memory.h" 24#include "core/memory.h"
25 25
26namespace {
27static thread_local std::array read_buffer_data_a{
28 Common::ScratchBuffer<u8>(),
29 Common::ScratchBuffer<u8>(),
30};
31static thread_local std::array read_buffer_data_x{
32 Common::ScratchBuffer<u8>(),
33 Common::ScratchBuffer<u8>(),
34};
35} // Anonymous namespace
36
26namespace Service { 37namespace Service {
27 38
28SessionRequestHandler::SessionRequestHandler(Kernel::KernelCore& kernel_, const char* service_name_) 39SessionRequestHandler::SessionRequestHandler(Kernel::KernelCore& kernel_, const char* service_name_)
@@ -328,26 +339,57 @@ std::vector<u8> HLERequestContext::ReadBufferCopy(std::size_t buffer_index) cons
328 } 339 }
329} 340}
330 341
331std::span<const u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const { 342std::span<const u8> HLERequestContext::ReadBufferA(std::size_t buffer_index) const {
332 static thread_local std::array read_buffer_a{ 343 static thread_local std::array read_buffer_a{
333 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0), 344 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
334 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0), 345 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
335 }; 346 };
336 static thread_local std::array read_buffer_data_a{ 347
337 Common::ScratchBuffer<u8>(), 348 ASSERT_OR_EXECUTE_MSG(
338 Common::ScratchBuffer<u8>(), 349 BufferDescriptorA().size() > buffer_index, { return {}; },
339 }; 350 "BufferDescriptorA invalid buffer_index {}", buffer_index);
351 auto& read_buffer = read_buffer_a[buffer_index];
352 return read_buffer.Read(BufferDescriptorA()[buffer_index].Address(),
353 BufferDescriptorA()[buffer_index].Size(),
354 &read_buffer_data_a[buffer_index]);
355}
356
357std::span<const u8> HLERequestContext::ReadBufferX(std::size_t buffer_index) const {
340 static thread_local std::array read_buffer_x{ 358 static thread_local std::array read_buffer_x{
341 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0), 359 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
342 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0), 360 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
343 }; 361 };
344 static thread_local std::array read_buffer_data_x{ 362
345 Common::ScratchBuffer<u8>(), 363 ASSERT_OR_EXECUTE_MSG(
346 Common::ScratchBuffer<u8>(), 364 BufferDescriptorX().size() > buffer_index, { return {}; },
365 "BufferDescriptorX invalid buffer_index {}", buffer_index);
366 auto& read_buffer = read_buffer_x[buffer_index];
367 return read_buffer.Read(BufferDescriptorX()[buffer_index].Address(),
368 BufferDescriptorX()[buffer_index].Size(),
369 &read_buffer_data_x[buffer_index]);
370}
371
372std::span<const u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const {
373 static thread_local std::array read_buffer_a{
374 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
375 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
376 };
377 static thread_local std::array read_buffer_x{
378 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
379 Core::Memory::CpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead>(memory, 0, 0),
347 }; 380 };
348 381
349 const bool is_buffer_a{BufferDescriptorA().size() > buffer_index && 382 const bool is_buffer_a{BufferDescriptorA().size() > buffer_index &&
350 BufferDescriptorA()[buffer_index].Size()}; 383 BufferDescriptorA()[buffer_index].Size()};
384 const bool is_buffer_x{BufferDescriptorX().size() > buffer_index &&
385 BufferDescriptorX()[buffer_index].Size()};
386
387 if (is_buffer_a && is_buffer_x) {
388 LOG_WARNING(Input, "Both buffer descriptors are available a.size={}, x.size={}",
389 BufferDescriptorA()[buffer_index].Size(),
390 BufferDescriptorX()[buffer_index].Size());
391 }
392
351 if (is_buffer_a) { 393 if (is_buffer_a) {
352 ASSERT_OR_EXECUTE_MSG( 394 ASSERT_OR_EXECUTE_MSG(
353 BufferDescriptorA().size() > buffer_index, { return {}; }, 395 BufferDescriptorA().size() > buffer_index, { return {}; },
diff --git a/src/core/hle/service/hle_ipc.h b/src/core/hle/service/hle_ipc.h
index 4bd24c899..ad5259a5c 100644
--- a/src/core/hle/service/hle_ipc.h
+++ b/src/core/hle/service/hle_ipc.h
@@ -253,6 +253,12 @@ public:
253 return domain_message_header.has_value(); 253 return domain_message_header.has_value();
254 } 254 }
255 255
256 /// Helper function to get a span of a buffer using the buffer descriptor A
257 [[nodiscard]] std::span<const u8> ReadBufferA(std::size_t buffer_index = 0) const;
258
259 /// Helper function to get a span of a buffer using the buffer descriptor X
260 [[nodiscard]] std::span<const u8> ReadBufferX(std::size_t buffer_index = 0) const;
261
256 /// Helper function to get a span of a buffer using the appropriate buffer descriptor 262 /// Helper function to get a span of a buffer using the appropriate buffer descriptor
257 [[nodiscard]] std::span<const u8> ReadBuffer(std::size_t buffer_index = 0) const; 263 [[nodiscard]] std::span<const u8> ReadBuffer(std::size_t buffer_index = 0) const;
258 264
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp
index ec4a84989..14e8df63a 100644
--- a/src/core/hle/service/prepo/prepo.cpp
+++ b/src/core/hle/service/prepo/prepo.cpp
@@ -58,14 +58,8 @@ private:
58 IPC::RequestParser rp{ctx}; 58 IPC::RequestParser rp{ctx};
59 const auto process_id = rp.PopRaw<u64>(); 59 const auto process_id = rp.PopRaw<u64>();
60 60
61 const auto data1 = ctx.ReadBuffer(0); 61 const auto data1 = ctx.ReadBufferA(0);
62 const auto data2 = [&ctx] { 62 const auto data2 = ctx.ReadBufferX(0);
63 if (ctx.CanReadBuffer(1)) {
64 return ctx.ReadBuffer(1);
65 }
66
67 return std::span<const u8>{};
68 }();
69 63
70 LOG_DEBUG(Service_PREPO, 64 LOG_DEBUG(Service_PREPO,
71 "called, type={:02X}, process_id={:016X}, data1_size={:016X}, data2_size={:016X}", 65 "called, type={:02X}, process_id={:016X}, data1_size={:016X}, data2_size={:016X}",
@@ -85,14 +79,8 @@ private:
85 const auto user_id = rp.PopRaw<u128>(); 79 const auto user_id = rp.PopRaw<u128>();
86 const auto process_id = rp.PopRaw<u64>(); 80 const auto process_id = rp.PopRaw<u64>();
87 81
88 const auto data1 = ctx.ReadBuffer(0); 82 const auto data1 = ctx.ReadBufferA(0);
89 const auto data2 = [&ctx] { 83 const auto data2 = ctx.ReadBufferX(0);
90 if (ctx.CanReadBuffer(1)) {
91 return ctx.ReadBuffer(1);
92 }
93
94 return std::span<const u8>{};
95 }();
96 84
97 LOG_DEBUG(Service_PREPO, 85 LOG_DEBUG(Service_PREPO,
98 "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, " 86 "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, "
@@ -137,14 +125,8 @@ private:
137 IPC::RequestParser rp{ctx}; 125 IPC::RequestParser rp{ctx};
138 const auto title_id = rp.PopRaw<u64>(); 126 const auto title_id = rp.PopRaw<u64>();
139 127
140 const auto data1 = ctx.ReadBuffer(0); 128 const auto data1 = ctx.ReadBufferA(0);
141 const auto data2 = [&ctx] { 129 const auto data2 = ctx.ReadBufferX(0);
142 if (ctx.CanReadBuffer(1)) {
143 return ctx.ReadBuffer(1);
144 }
145
146 return std::span<const u8>{};
147 }();
148 130
149 LOG_DEBUG(Service_PREPO, "called, title_id={:016X}, data1_size={:016X}, data2_size={:016X}", 131 LOG_DEBUG(Service_PREPO, "called, title_id={:016X}, data1_size={:016X}, data2_size={:016X}",
150 title_id, data1.size(), data2.size()); 132 title_id, data1.size(), data2.size());
@@ -161,14 +143,8 @@ private:
161 const auto user_id = rp.PopRaw<u128>(); 143 const auto user_id = rp.PopRaw<u128>();
162 const auto title_id = rp.PopRaw<u64>(); 144 const auto title_id = rp.PopRaw<u64>();
163 145
164 const auto data1 = ctx.ReadBuffer(0); 146 const auto data1 = ctx.ReadBufferA(0);
165 const auto data2 = [&ctx] { 147 const auto data2 = ctx.ReadBufferX(0);
166 if (ctx.CanReadBuffer(1)) {
167 return ctx.ReadBuffer(1);
168 }
169
170 return std::span<const u8>{};
171 }();
172 148
173 LOG_DEBUG(Service_PREPO, 149 LOG_DEBUG(Service_PREPO,
174 "called, user_id={:016X}{:016X}, title_id={:016X}, data1_size={:016X}, " 150 "called, user_id={:016X}{:016X}, title_id={:016X}, data1_size={:016X}, "
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index 8bb429578..cd2549232 100644
--- a/src/video_core/host_shaders/CMakeLists.txt
+++ b/src/video_core/host_shaders/CMakeLists.txt
@@ -19,6 +19,7 @@ set(SHADER_FILES
19 block_linear_unswizzle_2d.comp 19 block_linear_unswizzle_2d.comp
20 block_linear_unswizzle_3d.comp 20 block_linear_unswizzle_3d.comp
21 convert_abgr8_to_d24s8.frag 21 convert_abgr8_to_d24s8.frag
22 convert_abgr8_to_d32f.frag
22 convert_d32f_to_abgr8.frag 23 convert_d32f_to_abgr8.frag
23 convert_d24s8_to_abgr8.frag 24 convert_d24s8_to_abgr8.frag
24 convert_depth_to_float.frag 25 convert_depth_to_float.frag
diff --git a/src/video_core/host_shaders/convert_abgr8_to_d32f.frag b/src/video_core/host_shaders/convert_abgr8_to_d32f.frag
new file mode 100644
index 000000000..095b910c2
--- /dev/null
+++ b/src/video_core/host_shaders/convert_abgr8_to_d32f.frag
@@ -0,0 +1,15 @@
1// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#version 450
5
6layout(binding = 0) uniform sampler2D color_texture;
7
8void main() {
9 ivec2 coord = ivec2(gl_FragCoord.xy);
10 vec4 color = texelFetch(color_texture, coord, 0).abgr;
11
12 float value = color.a * (color.r + color.g + color.b) / 3.0f;
13
14 gl_FragDepth = value;
15}
diff --git a/src/video_core/host_shaders/convert_d32f_to_abgr8.frag b/src/video_core/host_shaders/convert_d32f_to_abgr8.frag
index 04cfef8b5..4e5a9f955 100644
--- a/src/video_core/host_shaders/convert_d32f_to_abgr8.frag
+++ b/src/video_core/host_shaders/convert_d32f_to_abgr8.frag
@@ -9,6 +9,6 @@ layout(location = 0) out vec4 color;
9 9
10void main() { 10void main() {
11 ivec2 coord = ivec2(gl_FragCoord.xy); 11 ivec2 coord = ivec2(gl_FragCoord.xy);
12 float depth = textureLod(depth_tex, coord, 0).r; 12 float depth = texelFetch(depth_tex, coord, 0).r;
13 color = vec4(depth, depth, depth, 1.0); 13 color = vec4(depth, depth, depth, 1.0);
14} 14}
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp
index f01d2394e..c3db09424 100644
--- a/src/video_core/renderer_vulkan/blit_image.cpp
+++ b/src/video_core/renderer_vulkan/blit_image.cpp
@@ -8,6 +8,7 @@
8#include "common/settings.h" 8#include "common/settings.h"
9#include "video_core/host_shaders/blit_color_float_frag_spv.h" 9#include "video_core/host_shaders/blit_color_float_frag_spv.h"
10#include "video_core/host_shaders/convert_abgr8_to_d24s8_frag_spv.h" 10#include "video_core/host_shaders/convert_abgr8_to_d24s8_frag_spv.h"
11#include "video_core/host_shaders/convert_abgr8_to_d32f_frag_spv.h"
11#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"
12#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"
13#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"
@@ -434,6 +435,7 @@ BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_,
434 convert_depth_to_float_frag(BuildShader(device, CONVERT_DEPTH_TO_FLOAT_FRAG_SPV)), 435 convert_depth_to_float_frag(BuildShader(device, CONVERT_DEPTH_TO_FLOAT_FRAG_SPV)),
435 convert_float_to_depth_frag(BuildShader(device, CONVERT_FLOAT_TO_DEPTH_FRAG_SPV)), 436 convert_float_to_depth_frag(BuildShader(device, CONVERT_FLOAT_TO_DEPTH_FRAG_SPV)),
436 convert_abgr8_to_d24s8_frag(BuildShader(device, CONVERT_ABGR8_TO_D24S8_FRAG_SPV)), 437 convert_abgr8_to_d24s8_frag(BuildShader(device, CONVERT_ABGR8_TO_D24S8_FRAG_SPV)),
438 convert_abgr8_to_d32f_frag(BuildShader(device, CONVERT_ABGR8_TO_D32F_FRAG_SPV)),
437 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)),
438 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)),
439 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)),
@@ -559,6 +561,13 @@ void BlitImageHelper::ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer,
559 Convert(*convert_abgr8_to_d24s8_pipeline, dst_framebuffer, src_image_view); 561 Convert(*convert_abgr8_to_d24s8_pipeline, dst_framebuffer, src_image_view);
560} 562}
561 563
564void BlitImageHelper::ConvertABGR8ToD32F(const Framebuffer* dst_framebuffer,
565 const ImageView& src_image_view) {
566 ConvertPipelineDepthTargetEx(convert_abgr8_to_d32f_pipeline, dst_framebuffer->RenderPass(),
567 convert_abgr8_to_d32f_frag);
568 Convert(*convert_abgr8_to_d32f_pipeline, dst_framebuffer, src_image_view);
569}
570
562void BlitImageHelper::ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, 571void BlitImageHelper::ConvertD32FToABGR8(const Framebuffer* dst_framebuffer,
563 ImageView& src_image_view) { 572 ImageView& src_image_view) {
564 ConvertPipelineColorTargetEx(convert_d32f_to_abgr8_pipeline, dst_framebuffer->RenderPass(), 573 ConvertPipelineColorTargetEx(convert_d32f_to_abgr8_pipeline, dst_framebuffer->RenderPass(),
diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h
index a032c71fb..b2104a59e 100644
--- a/src/video_core/renderer_vulkan/blit_image.h
+++ b/src/video_core/renderer_vulkan/blit_image.h
@@ -67,6 +67,8 @@ public:
67 67
68 void ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, const ImageView& src_image_view); 68 void ConvertABGR8ToD24S8(const Framebuffer* dst_framebuffer, const ImageView& src_image_view);
69 69
70 void ConvertABGR8ToD32F(const Framebuffer* dst_framebuffer, const ImageView& src_image_view);
71
70 void ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view); 72 void ConvertD32FToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view);
71 73
72 void ConvertD24S8ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view); 74 void ConvertD24S8ToABGR8(const Framebuffer* dst_framebuffer, ImageView& src_image_view);
@@ -130,6 +132,7 @@ private:
130 vk::ShaderModule convert_depth_to_float_frag; 132 vk::ShaderModule convert_depth_to_float_frag;
131 vk::ShaderModule convert_float_to_depth_frag; 133 vk::ShaderModule convert_float_to_depth_frag;
132 vk::ShaderModule convert_abgr8_to_d24s8_frag; 134 vk::ShaderModule convert_abgr8_to_d24s8_frag;
135 vk::ShaderModule convert_abgr8_to_d32f_frag;
133 vk::ShaderModule convert_d32f_to_abgr8_frag; 136 vk::ShaderModule convert_d32f_to_abgr8_frag;
134 vk::ShaderModule convert_d24s8_to_abgr8_frag; 137 vk::ShaderModule convert_d24s8_to_abgr8_frag;
135 vk::ShaderModule convert_s8d24_to_abgr8_frag; 138 vk::ShaderModule convert_s8d24_to_abgr8_frag;
@@ -149,6 +152,7 @@ private:
149 vk::Pipeline convert_d16_to_r16_pipeline; 152 vk::Pipeline convert_d16_to_r16_pipeline;
150 vk::Pipeline convert_r16_to_d16_pipeline; 153 vk::Pipeline convert_r16_to_d16_pipeline;
151 vk::Pipeline convert_abgr8_to_d24s8_pipeline; 154 vk::Pipeline convert_abgr8_to_d24s8_pipeline;
155 vk::Pipeline convert_abgr8_to_d32f_pipeline;
152 vk::Pipeline convert_d32f_to_abgr8_pipeline; 156 vk::Pipeline convert_d32f_to_abgr8_pipeline;
153 vk::Pipeline convert_d24s8_to_abgr8_pipeline; 157 vk::Pipeline convert_d24s8_to_abgr8_pipeline;
154 vk::Pipeline convert_s8d24_to_abgr8_pipeline; 158 vk::Pipeline convert_s8d24_to_abgr8_pipeline;
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 8fea825c0..de34f6d49 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -1194,6 +1194,11 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im
1194 return blit_image_helper.ConvertD16ToR16(dst, src_view); 1194 return blit_image_helper.ConvertD16ToR16(dst, src_view);
1195 } 1195 }
1196 break; 1196 break;
1197 case PixelFormat::A8B8G8R8_SRGB:
1198 if (src_view.format == PixelFormat::D32_FLOAT) {
1199 return blit_image_helper.ConvertD32FToABGR8(dst, src_view);
1200 }
1201 break;
1197 case PixelFormat::A8B8G8R8_UNORM: 1202 case PixelFormat::A8B8G8R8_UNORM:
1198 if (src_view.format == PixelFormat::S8_UINT_D24_UNORM) { 1203 if (src_view.format == PixelFormat::S8_UINT_D24_UNORM) {
1199 return blit_image_helper.ConvertD24S8ToABGR8(dst, src_view); 1204 return blit_image_helper.ConvertD24S8ToABGR8(dst, src_view);
@@ -1205,6 +1210,16 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im
1205 return blit_image_helper.ConvertD32FToABGR8(dst, src_view); 1210 return blit_image_helper.ConvertD32FToABGR8(dst, src_view);
1206 } 1211 }
1207 break; 1212 break;
1213 case PixelFormat::B8G8R8A8_SRGB:
1214 if (src_view.format == PixelFormat::D32_FLOAT) {
1215 return blit_image_helper.ConvertD32FToABGR8(dst, src_view);
1216 }
1217 break;
1218 case PixelFormat::B8G8R8A8_UNORM:
1219 if (src_view.format == PixelFormat::D32_FLOAT) {
1220 return blit_image_helper.ConvertD32FToABGR8(dst, src_view);
1221 }
1222 break;
1208 case PixelFormat::R32_FLOAT: 1223 case PixelFormat::R32_FLOAT:
1209 if (src_view.format == PixelFormat::D32_FLOAT) { 1224 if (src_view.format == PixelFormat::D32_FLOAT) {
1210 return blit_image_helper.ConvertD32ToR32(dst, src_view); 1225 return blit_image_helper.ConvertD32ToR32(dst, src_view);
@@ -1222,6 +1237,12 @@ void TextureCacheRuntime::ConvertImage(Framebuffer* dst, ImageView& dst_view, Im
1222 } 1237 }
1223 break; 1238 break;
1224 case PixelFormat::D32_FLOAT: 1239 case PixelFormat::D32_FLOAT:
1240 if (src_view.format == PixelFormat::A8B8G8R8_UNORM ||
1241 src_view.format == PixelFormat::B8G8R8A8_UNORM ||
1242 src_view.format == PixelFormat::A8B8G8R8_SRGB ||
1243 src_view.format == PixelFormat::B8G8R8A8_SRGB) {
1244 return blit_image_helper.ConvertABGR8ToD32F(dst, src_view);
1245 }
1225 if (src_view.format == PixelFormat::R32_FLOAT) { 1246 if (src_view.format == PixelFormat::R32_FLOAT) {
1226 return blit_image_helper.ConvertR32ToD32(dst, src_view); 1247 return blit_image_helper.ConvertR32ToD32(dst, src_view);
1227 } 1248 }