Merge pull request #11795 from Squall-Leonhart/D32FToOther
[Vulkan]Implement missing copy formats for D32, ARGB8_SRGB and BGRA8_Unorm/SRGB
This commit is contained in:
commit
c5f1ec8040
6 changed files with 51 additions and 1 deletions
|
@ -19,6 +19,7 @@ set(SHADER_FILES
|
|||
block_linear_unswizzle_2d.comp
|
||||
block_linear_unswizzle_3d.comp
|
||||
convert_abgr8_to_d24s8.frag
|
||||
convert_abgr8_to_d32f.frag
|
||||
convert_d32f_to_abgr8.frag
|
||||
convert_d24s8_to_abgr8.frag
|
||||
convert_depth_to_float.frag
|
||||
|
|
15
src/video_core/host_shaders/convert_abgr8_to_d32f.frag
Normal file
15
src/video_core/host_shaders/convert_abgr8_to_d32f.frag
Normal file
|
@ -0,0 +1,15 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#version 450
|
||||
|
||||
layout(binding = 0) uniform sampler2D color_texture;
|
||||
|
||||
void main() {
|
||||
ivec2 coord = ivec2(gl_FragCoord.xy);
|
||||
vec4 color = texelFetch(color_texture, coord, 0).abgr;
|
||||
|
||||
float value = color.a * (color.r + color.g + color.b) / 3.0f;
|
||||
|
||||
gl_FragDepth = value;
|
||||
}
|
|
@ -9,6 +9,6 @@ layout(location = 0) out vec4 color;
|
|||
|
||||
void main() {
|
||||
ivec2 coord = ivec2(gl_FragCoord.xy);
|
||||
float depth = textureLod(depth_tex, coord, 0).r;
|
||||
float depth = texelFetch(depth_tex, coord, 0).r;
|
||||
color = vec4(depth, depth, depth, 1.0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue