#pragma once

#include <psp2/gxm.h>
#include <psp2/kernel/sysmem.h>

#define ALIGN(x, a) (((x) + ((a)-1)) & ~((a)-1))

namespace render::kernel
{

void *gpuAllocator(SceKernelMemBlockType type, SceGxmMemoryAttribFlags attribs, size_t size, SceUID *uid);
void *gpuVertexUsseAllocator(size_t size, SceUID *uid, unsigned int *offset);
void *gpuFragmentUsseAllocator(size_t size, SceUID *uid, unsigned int *offset);

void gpuFree(SceUID uid);
void gpuFragmentUsseFree(SceUID uid);
void gpuVertexUsseFree(SceUID uid);

} // namespace render::kernel