1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

vk: Fix more spec violations

This commit is contained in:
kd-11 2020-12-19 12:57:45 +03:00 committed by kd-11
parent 567d23d856
commit d9cb1a6319

View File

@ -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<const char*>& 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"