gl: Fix compute invocation counts for format handling code

This commit is contained in:
kd-11 2022-07-17 13:59:14 +03:00 committed by kd-11
parent db0774a81b
commit 6a3f17cd36
2 changed files with 4 additions and 4 deletions

View file

@ -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);
}

View file

@ -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<u8>(caps.alignment);
mem_layout.swap_bytes = op.require_swap;
mem_layout.format = gl_format;
mem_layout.type = gl_type;