diff options
| author | 2023-10-16 03:17:53 +1100 | |
|---|---|---|
| committer | 2023-10-16 03:17:53 +1100 | |
| commit | f40f65f5d2123c79ffa4c8587d20dada624b5047 (patch) | |
| tree | ff28db65b491e718ef79b001426a5f8b53c49bdb /src/video_core/host_shaders | |
| parent | missed this line when editing the copypasta (diff) | |
| download | yuzu-f40f65f5d2123c79ffa4c8587d20dada624b5047.tar.gz yuzu-f40f65f5d2123c79ffa4c8587d20dada624b5047.tar.xz yuzu-f40f65f5d2123c79ffa4c8587d20dada624b5047.zip | |
Another missing copy connected to Bravely Default II
adds blit_image_helper.ConvertABGR8ToD32F and fragment shader for performing ABGR and BGRA to D32F copies
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_abgr8_to_d32f.frag | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/video_core/host_shaders/CMakeLists.txt b/src/video_core/host_shaders/CMakeLists.txt index cf20f39f0..cff8e38d6 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_d32f_to_bgra8.frag | 24 | convert_d32f_to_bgra8.frag |
| 24 | convert_d24s8_to_abgr8.frag | 25 | convert_d24s8_to_abgr8.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..a1880b916 --- /dev/null +++ b/src/video_core/host_shaders/convert_abgr8_to_d32f.frag | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 Your Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #version 450 | ||
| 5 | |||
| 6 | layout(binding = 0) uniform sampler2D color_texture; | ||
| 7 | |||
| 8 | void main() { | ||
| 9 | ivec2 coord = ivec2(gl_FragCoord.xy); | ||
| 10 | vec4 color = texelFetch(color_texture, coord, 0).abgr; | ||
| 11 | |||
| 12 | uvec4 bytes = uvec4(color * (exp2(8) - 1.0f)) << uvec4(24, 16, 8, 0); | ||
| 13 | uint depth_unorm = bytes.x | bytes.y | bytes.z | bytes.w; | ||
| 14 | |||
| 15 | float depth_float = uintBitsToFloat(depth_unorm); | ||
| 16 | |||
| 17 | gl_FragDepth = depth_float; | ||
| 18 | } | ||