[dxvk] Add meta copy shaders for depth-stencil formats

This commit is contained in:
Philip Rebohle 2019-07-18 14:48:54 +02:00
parent 677e33b9c9
commit 89516e2da2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 63 additions and 0 deletions

View File

@ -20,6 +20,9 @@ dxvk_shaders = files([
'shaders/dxvk_copy_depth_1d.frag',
'shaders/dxvk_copy_depth_2d.frag',
'shaders/dxvk_copy_depth_ms.frag',
'shaders/dxvk_copy_depth_stencil_1d.frag',
'shaders/dxvk_copy_depth_stencil_2d.frag',
'shaders/dxvk_copy_depth_stencil_ms.frag',
'shaders/dxvk_mipgen_vert.vert',
'shaders/dxvk_mipgen_geom.geom',

View File

@ -0,0 +1,20 @@
#version 450
#extension GL_ARB_shader_stencil_export : enable
layout(set = 0, binding = 0)
uniform sampler1DArray s_depth;
layout(set = 0, binding = 1)
uniform usampler1DArray s_stencil;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
ivec2 coord = ivec2(gl_FragCoord.x + u_info.offset.x, gl_Layer);
gl_FragDepth = texelFetch(s_depth, coord, 0).r;
gl_FragStencilRefARB = int(texelFetch(s_stencil, coord, 0).r);
}

View File

@ -0,0 +1,20 @@
#version 450
#extension GL_ARB_shader_stencil_export : enable
layout(set = 0, binding = 0)
uniform sampler2DArray s_depth;
layout(set = 0, binding = 1)
uniform usampler2DArray s_stencil;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
ivec3 coord = ivec3(gl_FragCoord.xy + u_info.offset.xy, gl_Layer);
gl_FragDepth = texelFetch(s_depth, coord, 0).r;
gl_FragStencilRefARB = int(texelFetch(s_stencil, coord, 0).r);
}

View File

@ -0,0 +1,20 @@
#version 450
#extension GL_ARB_shader_stencil_export : enable
layout(set = 0, binding = 0)
uniform sampler2DMSArray s_depth;
layout(set = 0, binding = 1)
uniform usampler2DMSArray s_stencil;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
ivec3 coord = ivec3(gl_FragCoord.xy + u_info.offset.xy, gl_Layer);
gl_FragDepth = texelFetch(s_depth, coord, gl_SampleID).r;
gl_FragStencilRefARB = int(texelFetch(s_stencil, coord, gl_SampleID).r);
}