SDL_GPUSwa...Composition(3type)
π NAME π
okay bestie, so SDL_GPUSwapchainComposition is a lil enum that tells you the texture format and the colorspace of your swapchain textures. it's giving "which flavor of pixels are we serving today" β¨
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_gpu.h>
typedef enum SDL_GPUSwapchainComposition
{
SDL_GPU_SWAPCHAINCOMPOSITION_SDR,
SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR,
SDL_GPU_SWAPCHAINCOMPOSITION_HDR_EXTENDED_LINEAR,
SDL_GPU_SWAPCHAINCOMPOSITION_HDR10_ST2084
} SDL_GPUSwapchainComposition;
β¨ DESCRIPTION β¨
SDR is the one that's always gonna show up for you. like literally always supported, no questions asked π the other compositions? they might ghost you on certain systems, no cap π
so here's the tea: it is recommended to query SDL_WindowSupportsGPUSwapchainComposition after you claim the window, if you wanna change the swapchain composition away from SDR. do the vibe check first, bestie, don't just yolo it π«Ά
- SDR β
B8G8R8A8orR8G8B8A8swapchain. pixel values are in sRGB encoding. - SDR_LINEAR β
B8G8R8A8_SRGBorR8G8B8A8_SRGBswapchain. pixel values are stored in memory in sRGB encoding but accessed in shaders in "linear sRGB" encoding, which is sRGB but with a linear transfer function. it's giving sRGB but make it β¨differentβ¨ - HDR_EXTENDED_LINEAR β
R16G16B16A16_FLOATswapchain. pixel values are in extended linear sRGB encoding and it permits values outside of the[0, 1]range. main character energy, going beyond the bounds fr fr π₯ - HDR10_ST2084 β
A2R10G10B10orA2B10G10R10swapchain. pixel values are in BT.2020 ST2084 (PQ) encoding. iconic HDR behavior π
π¦ AVAILABILITY π¦
this enum has been available since SDL 3.2.0 π so if you're on something older, it's not here yet, sorry bestie π
π SEE ALSO π
SDL_SetGPUSwapchainParameters(3)SDL_WindowSupportsGPUSwapchainComposition(3)SDL_WaitAndAcquireGPUSwapchainTexture(3)
and that's the whole page, periodt π
this one came to you from Simple Directmedia Layer, version SDL 3.4.18, in the SDL3 DATATYPES manual, page SDL_GPUSwa...Composition(3type). go forth and compose your swapchain, queen πβ¨π
π¦ 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