Skip to content

Commit

Permalink
gpu/utils: allow non-texel emulated format slices
Browse files Browse the repository at this point in the history
OpenGL has emulated texture formats that don't need texel storage buffer
emulation, so support this case also.

Note that this change does not actually do anything yet, but I plan on
re-using this helper in the (near) future.
  • Loading branch information
haasn committed Oct 19, 2023
1 parent 1633311 commit cded365
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gpu/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,7 @@ int pl_tex_transfer_slices(pl_gpu gpu, pl_fmt texel_fmt,
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);
if (fmt->emulated && texel_fmt) {
size_t max_texel = gpu->limits.max_buffer_texels * texel_fmt->texel_size;
max_size = PL_MIN(gpu->limits.max_ssbo_size, max_texel);
}
Expand Down

0 comments on commit cded365

Please sign in to comment.