mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-26 18:25:35 -04:00
c25931e3b7
Pad each packed R16 upload region to an even texel count so subsequent VkBufferImageCopy offsets retain the required four-byte alignment. Co-authored-by: Martin Penkava <mpenkava1337@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
15 lines
399 B
C
15 lines
399 B
C
#ifndef PSX_GPU_VK_UPLOAD_H
|
|
#define PSX_GPU_VK_UPLOAD_H
|
|
|
|
#include <stddef.h>
|
|
|
|
/* R16 VkBufferImageCopy offsets must remain multiples of four bytes. Padding
|
|
* each packed region to an even texel count keeps every following offset
|
|
* aligned without changing the copied image extent. */
|
|
static inline size_t vk_upload_aligned_texels(size_t texels)
|
|
{
|
|
return (texels + 1u) & ~(size_t)1u;
|
|
}
|
|
|
|
#endif
|