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 β€” B8G8R8A8 or R8G8B8A8 swapchain. pixel values are in sRGB encoding.
  • SDR_LINEAR β€” B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. 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_FLOAT swapchain. 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 β€” A2R10G10B10 or A2B10G10R10 swapchain. 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 🌈


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