diff options
Diffstat (limited to 'src/video_core/host_shaders')
| -rw-r--r-- | src/video_core/host_shaders/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/video_core/host_shaders/convert_d32f_to_abgr8.frag | 14 |
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 | |||
| 6 | layout(binding = 0) uniform sampler2D depth_tex; | ||
| 7 | |||
| 8 | layout(location = 0) out vec4 color; | ||
| 9 | |||
| 10 | void 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 | } | ||