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:
parent
b73b91a5c9
commit
c11d492597
16
src/dxvk/shaders/dxvk_copy_color_1d.frag
Normal file
16
src/dxvk/shaders/dxvk_copy_color_1d.frag
Normal 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);
|
||||
}
|
16
src/dxvk/shaders/dxvk_copy_color_2d.frag
Normal file
16
src/dxvk/shaders/dxvk_copy_color_2d.frag
Normal 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);
|
||||
}
|
17
src/dxvk/shaders/dxvk_copy_color_ms.frag
Normal file
17
src/dxvk/shaders/dxvk_copy_color_ms.frag
Normal 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);
|
||||
}
|
14
src/dxvk/shaders/dxvk_copy_depth_1d.frag
Normal file
14
src/dxvk/shaders/dxvk_copy_depth_1d.frag
Normal 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;
|
||||
}
|
14
src/dxvk/shaders/dxvk_copy_depth_2d.frag
Normal file
14
src/dxvk/shaders/dxvk_copy_depth_2d.frag
Normal 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;
|
||||
}
|
15
src/dxvk/shaders/dxvk_copy_depth_ms.frag
Normal file
15
src/dxvk/shaders/dxvk_copy_depth_ms.frag
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user