Files
Matthew Stanley c25931e3b7 vulkan: align packed upload offsets
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>
2026-07-21 15:54:07 -07:00

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