SDL_GPUSamplerCreateInfo(3type)
π SDL_GPUSamplerCreateInfo π
okay bestie, welcome to the SDL3 DATATYPES corner of the manual πΈ this one is literally just a lil struct that tells SDL how you want your sampler to behave. that's it. that's the whole vibe. no cap.
β¨ NAME β¨
SDL_GPUSamplerCreateInfo β a structure specifying the parameters of a sampler. it's giving "recipe card for texture lookups" π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_gpu.h>
typedef struct SDL_GPUSamplerCreateInfo
{
SDL_GPUFilter min_filter; /**< The minification filter to apply to lookups. */
SDL_GPUFilter mag_filter; /**< The magnification filter to apply to lookups. */
SDL_GPUSamplerMipmapMode mipmap_mode; /**< The mipmap filter to apply to lookups. */
SDL_GPUSamplerAddressMode address_mode_u; /**< The addressing mode for U coordinates outside [0, 1). */
SDL_GPUSamplerAddressMode address_mode_v; /**< The addressing mode for V coordinates outside [0, 1). */
SDL_GPUSamplerAddressMode address_mode_w; /**< The addressing mode for W coordinates outside [0, 1). */
float mip_lod_bias; /**< The bias to be added to mipmap LOD calculation. */
float max_anisotropy; /**< The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored. */
SDL_GPUCompareOp compare_op; /**< The comparison operator to apply to fetched data before filtering. */
float min_lod; /**< Clamps the minimum of the computed LOD value. */
float max_lod; /**< Clamps the maximum of the computed LOD value. */
bool enable_anisotropy; /**< true to enable anisotropic filtering. */
bool enable_compare; /**< true to enable comparison against a reference value during lookups. */
Uint8 padding1;
Uint8 padding2;
SDL_PropertiesID props; /**< A properties ID for extensions. Should be 0 if no extensions are needed. */
} SDL_GPUSamplerCreateInfo;
β¨ DESCRIPTION β¨
okay so real talk for a sec, bestie π«Ά note that mip_lod_bias is a no-op for the Metal driver. like, it just does nothing there. for Metal, LOD bias must be applied via shader instead. so if you're on Metal and you're wondering why your bias isn't biasingβ¦ that's why. it's not you, it's the driver π
β¨ AVAILABILITY β¨
this one's been around since SDL 3.2.0. vintage-ish. iconic. π
β¨ SEE ALSO β¨
SDL_CreateGPUSampler(3)SDL_GPUFilter(3type)SDL_GPUSamplerMipmapMode(3type)SDL_GPUSamplerAddressMode(3type)SDL_GPUCompareOp(3type)
and that's the whole page, bestie!! go forth and sample responsibly ππ¦
this lil transmission came to you from Simple Directmedia Layer, version SDL 3.4.18 β mwah, stay slay, drink water, and don't forget to set your props to 0 if you don't need extensions π
π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms