GLuint texture_upload_hdr_from_pbo(GLuint pbo_id, void *ptr, int width, int height, GLuint reuse_tex_id)
Finalizes HDR upload from a PBO (Unmap -> Upload -> Mipmaps).
Definition: texture.c:259
float * texture_load_pixels(const char *path, int *width, int *height, int *channels)
Decodes an HDR image into RAM without uploading to GPU.
Definition: texture.c:20
void texture_ensure_pbo(GLuint *pbo_id, GLsizeiptr *current_size, GLsizeiptr required_size)
Ensures a PBO is allocated with sufficient size.
Definition: texture.c:75
GLuint texture_load_rgba_png(const char *path)
Loads a PNG image from disk and creates an OpenGL RGBA texture.
Definition: texture.c:331
GLuint texture_preallocate_hdr(int width, int height, GLuint old_tex)
Pre-allocates VRAM for an HDR texture (glTexStorage2D only).
Definition: texture.c:158
void texture_generate_hdr_mipmap(GLuint tex)
Generates mipmaps for an HDR texture.
Definition: texture.c:320
void * texture_map_pbo(GLuint pbo_id, size_t size_bytes)
Maps a PBO for writing.
Definition: texture.c:103