From 6a3f17cd364d1f747098a037097d84bec537095b Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 17 Jul 2022 13:59:14 +0300 Subject: [PATCH] gl: Fix compute invocation counts for format handling code --- rpcs3/Emu/RSX/GL/GLCompute.cpp | 6 +++--- rpcs3/Emu/RSX/GL/GLTexture.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLCompute.cpp b/rpcs3/Emu/RSX/GL/GLCompute.cpp index 6a552cb989..351a9c2fb2 100644 --- a/rpcs3/Emu/RSX/GL/GLCompute.cpp +++ b/rpcs3/Emu/RSX/GL/GLCompute.cpp @@ -309,7 +309,7 @@ namespace gl stencil_view->bind(cmd, GL_COMPUTE_BUFFER_SLOT(1)); dst->bind_range(gl::buffer::target::ssbo, GL_COMPUTE_BUFFER_SLOT(2), out_offset, row_pitch * 4 * region.height); - const int num_invocations = utils::aligned_div(region.width * region.height, optimal_kernel_size); + const int num_invocations = utils::aligned_div(region.width * region.height, optimal_kernel_size * optimal_group_size); compute_task::run(cmd, num_invocations); } @@ -348,7 +348,7 @@ namespace gl data_view->bind(cmd, GL_COMPUTE_BUFFER_SLOT(0)); dst->bind_range(gl::buffer::target::ssbo, GL_COMPUTE_BUFFER_SLOT(1), out_offset, row_pitch * 4 * region.height); - const int num_invocations = utils::aligned_div(region.width * region.height, optimal_kernel_size); + const int num_invocations = utils::aligned_div(region.width * region.height, optimal_kernel_size * optimal_group_size); compute_task::run(cmd, num_invocations); } @@ -385,7 +385,7 @@ namespace gl src->bind_range(gl::buffer::target::ssbo, GL_COMPUTE_BUFFER_SLOT(0), src_offset, row_length * bpp * dst_region.height); glBindImageTexture(GL_COMPUTE_IMAGE_SLOT(0), dst->id(), 0, GL_FALSE, 0, GL_WRITE_ONLY, dst->view_format()); - const int num_invocations = utils::aligned_div(dst_region.width * dst_region.height, optimal_kernel_size); + const int num_invocations = utils::aligned_div(dst_region.width * dst_region.height, optimal_kernel_size * optimal_group_size); compute_task::run(cmd, num_invocations); } diff --git a/rpcs3/Emu/RSX/GL/GLTexture.cpp b/rpcs3/Emu/RSX/GL/GLTexture.cpp index d0597fbbc4..a2b99b5e10 100644 --- a/rpcs3/Emu/RSX/GL/GLTexture.cpp +++ b/rpcs3/Emu/RSX/GL/GLTexture.cpp @@ -856,7 +856,7 @@ namespace gl if (driver_caps.ARB_compute_shader_supported) { // 0. Preconf - mem_layout.alignment = caps.alignment; + mem_layout.alignment = static_cast(caps.alignment); mem_layout.swap_bytes = op.require_swap; mem_layout.format = gl_format; mem_layout.type = gl_type;