Browse Source
[TEST] Added another MSAA depth stencil shaders to convert into non msaa + sanitize MSAA UINT/SINT path
android-meows
[TEST] Added another MSAA depth stencil shaders to convert into non msaa + sanitize MSAA UINT/SINT path
android-meows
8 changed files with 138 additions and 37 deletions
-
2src/video_core/host_shaders/CMakeLists.txt
-
20src/video_core/host_shaders/convert_msaa_to_non_msaa_depth.frag
-
23src/video_core/host_shaders/convert_msaa_to_non_msaa_depth_stencil.frag
-
29src/video_core/renderer_vulkan/blit_image.cpp
-
5src/video_core/renderer_vulkan/blit_image.h
-
10src/video_core/renderer_vulkan/vk_rasterizer.cpp
-
76src/video_core/renderer_vulkan/vk_texture_cache.cpp
-
10src/video_core/vulkan_common/vulkan_device.h
@ -0,0 +1,20 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project |
|||
// SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
#version 450 core |
|||
|
|||
layout(binding = 0) uniform sampler2DMS msaa_in; |
|||
|
|||
layout(push_constant) uniform PushConstants { |
|||
ivec2 dst_offset; |
|||
ivec2 src_offset; |
|||
ivec2 scale; |
|||
}; |
|||
|
|||
void main() { |
|||
const ivec2 coord = ivec2(gl_FragCoord.xy) - dst_offset + src_offset; |
|||
const ivec2 msaa_coord = coord / scale; |
|||
const ivec2 sample_offset = coord % scale; |
|||
const int sample_id = sample_offset.x + scale.x * sample_offset.y; |
|||
gl_FragDepth = texelFetch(msaa_in, msaa_coord, sample_id).r; |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project |
|||
// SPDX-License-Identifier: GPL-3.0-or-later |
|||
|
|||
#version 450 core |
|||
#extension GL_ARB_shader_stencil_export : require |
|||
|
|||
layout(binding = 0) uniform sampler2DMS depth_tex; |
|||
layout(binding = 1) uniform usampler2DMS stencil_tex; |
|||
|
|||
layout(push_constant) uniform PushConstants { |
|||
ivec2 dst_offset; |
|||
ivec2 src_offset; |
|||
ivec2 scale; |
|||
}; |
|||
|
|||
void main() { |
|||
const ivec2 coord = ivec2(gl_FragCoord.xy) - dst_offset + src_offset; |
|||
const ivec2 msaa_coord = coord / scale; |
|||
const ivec2 sample_offset = coord % scale; |
|||
const int sample_id = sample_offset.x + scale.x * sample_offset.y; |
|||
gl_FragDepth = texelFetch(depth_tex, msaa_coord, sample_id).r; |
|||
gl_FragStencilRefARB = int(texelFetch(stencil_tex, msaa_coord, sample_id).r); |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue