1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 04:24:11 +01:00

[dxvk] Add meta copy shaders

Used to copy between depth and color images.
This commit is contained in:
Philip Rebohle 2018-09-27 11:29:39 +02:00
parent b73b91a5c9
commit c11d492597
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
6 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#version 450
layout(set = 0, binding = 0)
uniform sampler1DArray s_image;
layout(location = 0) out vec4 o_color;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
o_color = texelFetch(s_image,
ivec2(gl_FragCoord.x + u_info.offset.x, gl_Layer), 0);
}

View File

@ -0,0 +1,16 @@
#version 450
layout(set = 0, binding = 0)
uniform sampler2DArray s_image;
layout(location = 0) out vec4 o_color;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
o_color = texelFetch(s_image,
ivec3(gl_FragCoord.xy + u_info.offset, gl_Layer), 0);
}

View File

@ -0,0 +1,17 @@
#version 450
layout(set = 0, binding = 0)
uniform sampler2DMSArray s_image;
layout(location = 0) out vec4 o_color;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
o_color = texelFetch(s_image,
ivec3(gl_FragCoord.xy + u_info.offset, gl_Layer),
gl_SampleID);
}

View File

@ -0,0 +1,14 @@
#version 450
layout(set = 0, binding = 0)
uniform sampler1DArray s_image;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
gl_FragDepth = texelFetch(s_image,
ivec2(gl_FragCoord.x + u_info.offset.x, gl_Layer), 0).r;
}

View File

@ -0,0 +1,14 @@
#version 450
layout(set = 0, binding = 0)
uniform sampler2DArray s_image;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
gl_FragDepth = texelFetch(s_image,
ivec3(gl_FragCoord.xy + u_info.offset, gl_Layer), 0).r;
}

View File

@ -0,0 +1,15 @@
#version 450
layout(set = 0, binding = 0)
uniform sampler2DMSArray s_image;
layout(push_constant)
uniform u_info_t {
ivec2 offset;
} u_info;
void main() {
gl_FragDepth = texelFetch(s_image,
ivec3(gl_FragCoord.xy + u_info.offset, gl_Layer),
gl_SampleID).r;
}