summaryrefslogtreecommitdiff
path: root/src/video_core/host_shaders
diff options
context:
space:
mode:
authorGravatar Squall-Leonhart2023-10-04 19:07:05 +1100
committerGravatar Squall-Leonhart2023-10-04 19:07:05 +1100
commit9568d3bc60c428cd7e13ef67cc50cfdbdc7a7c8f (patch)
treebf75fb999488b2924da7c03b60dac5e880e54f30 /src/video_core/host_shaders
parentMerge pull request #11657 from liamwhite/new-codespell (diff)
downloadyuzu-9568d3bc60c428cd7e13ef67cc50cfdbdc7a7c8f.tar.gz
yuzu-9568d3bc60c428cd7e13ef67cc50cfdbdc7a7c8f.tar.xz
yuzu-9568d3bc60c428cd7e13ef67cc50cfdbdc7a7c8f.zip
Implements D32_Float to A8B8G8R8_UNORM format copy
Corrects some visual issues in games such as Disney SpeedStorm
Diffstat (limited to 'src/video_core/host_shaders')
-rw-r--r--src/video_core/host_shaders/CMakeLists.txt1
-rw-r--r--src/video_core/host_shaders/convert_d32f_to_abgr8.frag14
2 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt
index 6b912027f..8bb429578 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_d32f_to_abgr8.frag
22 convert_d24s8_to_abgr8.frag 23 convert_d24s8_to_abgr8.frag
23 convert_depth_to_float.frag 24 convert_depth_to_float.frag
24 convert_float_to_depth.frag 25 convert_float_to_depth.frag
diff --git a/src/video_core/host_shaders/convert_d32f_to_abgr8.frag b/src/video_core/host_shaders/convert_d32f_to_abgr8.frag
new file mode 100644
index 000000000..b7012a61d
--- /dev/null
+++ b/src/video_core/host_shaders/convert_d32f_to_abgr8.frag
@@ -0,0 +1,14 @@
1// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#version 450
5
6layout(binding = 0) uniform sampler2D depth_tex;
7
8layout(location = 0) out vec4 color;
9
10void main() {
11 ivec2 coord = ivec2(gl_FragCoord.xy);
12 float depth = textureLod(depth_tex, coord, 0).r;
13 color = vec4(vec3(depth), 1.0); // Convert depth to grayscale color
14}