Skip to content

Commit

Permalink
gpu/utils: use correct limit for tex transfer slices
Browse files Browse the repository at this point in the history
We only need to use the max SSBO sizee for emulated transfers.
Otherwise, max_buf_size is sufficient.
  • Loading branch information
haasn committed Oct 19, 2023
1 parent 3bd1c97 commit 1633311
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gpu/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,13 @@ int pl_tex_transfer_slices(pl_gpu gpu, pl_fmt texel_fmt,
struct pl_tex_transfer_params **out_slices)
{
PL_ARRAY(struct pl_tex_transfer_params) slices = {0};
size_t max_size = gpu->limits.max_ssbo_size;
size_t max_size = params->buf ? gpu->limits.max_buf_size : SIZE_MAX;

pl_fmt fmt = params->tex->params.format;
if (fmt->emulated) {
pl_assert(texel_fmt);
size_t max_texel = gpu->limits.max_buffer_texels * texel_fmt->texel_size;
max_size = PL_MIN(max_size, max_texel);
max_size = PL_MIN(gpu->limits.max_ssbo_size, max_texel);
}

if (max_size < fmt->texel_size)
Expand Down

0 comments on commit 1633311

Please sign in to comment.