diff --git a/src/dxvk/dxvk_meta_copy.cpp b/src/dxvk/dxvk_meta_copy.cpp index a3be19c8..45339af7 100644 --- a/src/dxvk/dxvk_meta_copy.cpp +++ b/src/dxvk/dxvk_meta_copy.cpp @@ -9,9 +9,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -84,11 +81,7 @@ namespace dxvk { m_color { createShaderModule(dxvk_copy_color_1d), createShaderModule(dxvk_copy_color_2d), - createShaderModule(dxvk_copy_color_ms) }, - m_depth { - createShaderModule(dxvk_copy_depth_1d), - createShaderModule(dxvk_copy_depth_2d), - createShaderModule(dxvk_copy_depth_ms) } { + createShaderModule(dxvk_copy_color_ms) } { if (device->features().vk12.shaderOutputLayer) { m_shaderVert = createShaderModule(dxvk_fullscreen_layer_vert); } else { @@ -119,9 +112,6 @@ namespace dxvk { m_vkd->vkDestroyShaderModule(m_vkd->device(), m_depthStencil.fragMs, nullptr); m_vkd->vkDestroyShaderModule(m_vkd->device(), m_depthStencil.frag2D, nullptr); m_vkd->vkDestroyShaderModule(m_vkd->device(), m_depthStencil.frag1D, nullptr); - m_vkd->vkDestroyShaderModule(m_vkd->device(), m_depth.fragMs, nullptr); - m_vkd->vkDestroyShaderModule(m_vkd->device(), m_depth.frag2D, nullptr); - m_vkd->vkDestroyShaderModule(m_vkd->device(), m_depth.frag1D, nullptr); m_vkd->vkDestroyShaderModule(m_vkd->device(), m_color.fragMs, nullptr); m_vkd->vkDestroyShaderModule(m_vkd->device(), m_color.frag2D, nullptr); m_vkd->vkDestroyShaderModule(m_vkd->device(), m_color.frag1D, nullptr); @@ -313,7 +303,7 @@ namespace dxvk { std::array, 3> shaderSets = {{ { &m_color, VK_IMAGE_ASPECT_COLOR_BIT }, - { &m_depth, VK_IMAGE_ASPECT_DEPTH_BIT }, + { &m_color, VK_IMAGE_ASPECT_DEPTH_BIT }, { &m_depthStencil, VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT }, }}; diff --git a/src/dxvk/meson.build b/src/dxvk/meson.build index 2bf46c5f..c8fa9bda 100644 --- a/src/dxvk/meson.build +++ b/src/dxvk/meson.build @@ -20,9 +20,6 @@ dxvk_shaders = files([ 'shaders/dxvk_copy_color_1d.frag', 'shaders/dxvk_copy_color_2d.frag', 'shaders/dxvk_copy_color_ms.frag', - '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', diff --git a/src/dxvk/shaders/dxvk_copy_color_1d.frag b/src/dxvk/shaders/dxvk_copy_color_1d.frag index b91067d9..b2a0da86 100644 --- a/src/dxvk/shaders/dxvk_copy_color_1d.frag +++ b/src/dxvk/shaders/dxvk_copy_color_1d.frag @@ -13,6 +13,8 @@ uniform u_info_t { } u_info; void main() { - o_color = texelFetch(s_image, + vec4 color = texelFetch(s_image, ivec2(gl_FragCoord.x + u_info.offset.x, gl_Layer), 0); -} \ No newline at end of file + o_color = color; + gl_FragDepth = color.r; +} diff --git a/src/dxvk/shaders/dxvk_copy_color_2d.frag b/src/dxvk/shaders/dxvk_copy_color_2d.frag index 99a0cc27..dc53373e 100644 --- a/src/dxvk/shaders/dxvk_copy_color_2d.frag +++ b/src/dxvk/shaders/dxvk_copy_color_2d.frag @@ -13,6 +13,8 @@ uniform u_info_t { } u_info; void main() { - o_color = texelFetch(s_image, + vec4 color = texelFetch(s_image, ivec3(gl_FragCoord.xy + u_info.offset, gl_Layer), 0); -} \ No newline at end of file + o_color = color; + gl_FragDepth = color.r; +} diff --git a/src/dxvk/shaders/dxvk_copy_color_ms.frag b/src/dxvk/shaders/dxvk_copy_color_ms.frag index b7a79057..20072d3f 100644 --- a/src/dxvk/shaders/dxvk_copy_color_ms.frag +++ b/src/dxvk/shaders/dxvk_copy_color_ms.frag @@ -13,7 +13,9 @@ uniform u_info_t { } u_info; void main() { - o_color = texelFetch(s_image, + vec4 color = texelFetch(s_image, ivec3(gl_FragCoord.xy + u_info.offset, gl_Layer), gl_SampleID); -} \ No newline at end of file + o_color = color; + gl_FragDepth = color.r; +} diff --git a/src/dxvk/shaders/dxvk_copy_depth_1d.frag b/src/dxvk/shaders/dxvk_copy_depth_1d.frag deleted file mode 100644 index acf62729..00000000 --- a/src/dxvk/shaders/dxvk_copy_depth_1d.frag +++ /dev/null @@ -1,16 +0,0 @@ -#version 450 - -#extension GL_EXT_samplerless_texture_functions : require - -layout(set = 0, binding = 0) -uniform texture1DArray 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; -} \ No newline at end of file diff --git a/src/dxvk/shaders/dxvk_copy_depth_2d.frag b/src/dxvk/shaders/dxvk_copy_depth_2d.frag deleted file mode 100644 index dabcd4a5..00000000 --- a/src/dxvk/shaders/dxvk_copy_depth_2d.frag +++ /dev/null @@ -1,16 +0,0 @@ -#version 450 - -#extension GL_EXT_samplerless_texture_functions : require - -layout(set = 0, binding = 0) -uniform texture2DArray 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; -} \ No newline at end of file diff --git a/src/dxvk/shaders/dxvk_copy_depth_ms.frag b/src/dxvk/shaders/dxvk_copy_depth_ms.frag deleted file mode 100644 index 44c07c30..00000000 --- a/src/dxvk/shaders/dxvk_copy_depth_ms.frag +++ /dev/null @@ -1,17 +0,0 @@ -#version 450 - -#extension GL_EXT_samplerless_texture_functions : require - -layout(set = 0, binding = 0) -uniform texture2DMSArray 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; -} \ No newline at end of file