From d9cb1a63194eb5d2005c4453fc005ec84627c6dd Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 19 Dec 2020 12:57:45 +0300 Subject: [PATCH] vk: Fix more spec violations --- rpcs3/Emu/RSX/VK/VKResolveHelper.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKResolveHelper.h b/rpcs3/Emu/RSX/VK/VKResolveHelper.h index 952bb26518..012e412bce 100644 --- a/rpcs3/Emu/RSX/VK/VKResolveHelper.h +++ b/rpcs3/Emu/RSX/VK/VKResolveHelper.h @@ -173,11 +173,15 @@ namespace vk u8 samples_x = 1; u8 samples_y = 1; s32 static_parameters[4]; + s32 static_parameters_width = 2; depth_resolve_base() { renderpass_config.set_depth_mask(true); renderpass_config.enable_depth_test(VK_COMPARE_OP_ALWAYS); + + // Depth-stencil buffers are almost never filterable, and we do not need it here (1:1 mapping) + m_sampler_filter = VK_FILTER_NEAREST; } void build(const std::string& kernel, const std::string& extensions, const std::vector& inputs) @@ -197,7 +201,7 @@ namespace vk "#extension GL_ARB_separate_shader_objects : enable\n"; fs_src += extensions + "\n" - "layout(push_constant) uniform static_data{ ivec4 regs[1]; };\n"; + "layout(push_constant) uniform static_data{ ivec" + std::to_string(static_parameters_width) + " regs[1]; };\n"; int binding = 1; for (const auto& input : inputs) @@ -228,7 +232,7 @@ namespace vk void update_uniforms(vk::command_buffer& cmd, vk::glsl::program* /*program*/) override { - vkCmdPushConstants(cmd, m_pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, 8, static_parameters); + vkCmdPushConstants(cmd, m_pipeline_layout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, static_parameters_width * 4, static_parameters); } void update_sample_configuration(vk::image* msaa_image) @@ -332,6 +336,8 @@ namespace vk region.baseArrayLayer = 0; region.layerCount = 1; + static_parameters_width = 3; + build( " ivec2 out_coord = ivec2(gl_FragCoord.xy);\n" " ivec2 in_coord = (out_coord / regs[0].xy);\n" @@ -397,6 +403,8 @@ namespace vk region.baseArrayLayer = 0; region.layerCount = 1; + static_parameters_width = 3; + build( " ivec2 pixel_coord = ivec2(gl_FragCoord.xy);\n" " pixel_coord *= regs[0].xy;\n"