SDL_GPUShaderFormat(3type)
๐ SDL_GPUShaderFormat ๐
okay bestie, welcome to the SDL_GPUShaderFormat page โ it's a datatype from the SDL3 DATATYPES corner of the manual, and no cap, it's lowkey the whole personality test for your shader code. let's get into it ๐ซถ
โจ NAME โจ
SDL_GPUShaderFormat โ literally just says what format your shader code is in. that's it. that's the whole job. ๐
โจ SYNOPSIS โจ
#include <SDL3/SDL_gpu.h>
typedef Uint32 SDL_GPUShaderFormat;
#define SDL_GPU_SHADERFORMAT_INVALID 0
#define SDL_GPU_SHADERFORMAT_PRIVATE (1u << 0) /**< Shaders for NDA'd platforms. */
#define SDL_GPU_SHADERFORMAT_SPIRV (1u << 1) /**< SPIR-V shaders for Vulkan. */
#define SDL_GPU_SHADERFORMAT_DXBC (1u << 2) /**< DXBC SM5_1 shaders for D3D12. */
#define SDL_GPU_SHADERFORMAT_DXIL (1u << 3) /**< DXIL SM6_0 shaders for D3D12. */
#define SDL_GPU_SHADERFORMAT_MSL (1u << 4) /**< MSL shaders for Metal. */
#define SDL_GPU_SHADERFORMAT_METALLIB (1u << 5) /**< Precompiled metallib shaders for Metal. */
so it's a Uint32 under the hood โ a lil bitfield situation, one bit per format, iykyk. ๐ here's the roster:
SDL_GPU_SHADERFORMAT_INVALID=0โ the nothing-burger. no format, no vibes. ๐SDL_GPU_SHADERFORMAT_PRIVATE=(1u << 0)โ shaders for NDA'd platforms. ๐คซ secret business, we don't talk about it.SDL_GPU_SHADERFORMAT_SPIRV=(1u << 1)โ SPIR-V shaders, and they're for Vulkan. ๐SDL_GPU_SHADERFORMAT_DXBC=(1u << 2)โ DXBC SM5_1 shaders, for D3D12. ๐ฎSDL_GPU_SHADERFORMAT_DXIL=(1u << 3)โ DXIL SM6_0 shaders, also for D3D12. ๐ฎโจSDL_GPU_SHADERFORMAT_MSL=(1u << 4)โ MSL shaders, for Metal. ๐SDL_GPU_SHADERFORMAT_METALLIB=(1u << 5)โ precompiled metallib shaders, for Metal. already cooked, no compiling needed ๐ฅ
โจ DESCRIPTION โจ
each format is matched to one specific backend that actually accepts it. like, it's giving "you're MY format, you go with THIS backend." one format, one backend, iconic pairing behavior. ๐
โจ AVAILABILITY โจ
this datatype has been around since SDL 3.2.0. she's not new new, she's established. ๐
โจ SEE ALSO โจ
SDL_CreateGPUShader(3)โ go make a shader, bestie ๐ธ
reminder fr fr: keep every one of those (1u << n) values exactly as they are. don't get cute and rename them, they're doing bitshift math and the math is not negotiable. ๐
mwah, that's the whole page ๐ this beauty ships with Simple Directmedia Layer, version SDL 3.4.18, dated with the SDL_GPUShaderFormat(3type) energy it deserves โ go forth and shader, my love ๐ฆ๐
๐ฆ 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