Skip to content

cf_generate_mipmaps

Category: graphics
GitHub: cute_graphics.h


Generates all remaining mip levels from the base level of the texture.

void cf_generate_mipmaps(CF_Texture texture);
Parameters Description
texture The texture to generate mipmaps for.

Remarks

This is useful when the base level has been updated manually (e.g., for dynamic or render target textures) and you want to downsample to fill in the full mip chain.

The downsampling runs as GPU blits, so on the SDL_GPU backends the texture must carry CF_TEXTURE_USAGE_COLOR_TARGET_BIT in addition to its sampler usage -- OR it into cf_texture_defaults's usage before cf_make_texture.

CF_TextureParams
CF_Texture
cf_make_texture
cf_destroy_texture
cf_texture_update
cf_texture_update_mip