SDL_GPUStoreOp(3type)
π SDL_GPUStoreOp π
okay bestie, pull up a chair, we're talking about SDL_GPUStoreOp β it's a 3type from the SDL3 DATATYPES crew. it lives in the SDL3 GPU world and it's basically the answer to one very specific question: what happens to the contents of a texture attached to a render pass when the render pass ends? π
that's it. that's the whole job. it decides whether your pixels get saved, yeeted, or resolved. and honestly? iconic. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_gpu.h>
typedef enum SDL_GPUStoreOp
{
SDL_GPU_STOREOP_STORE, /**< The contents generated during the render pass will be written to memory. */
SDL_GPU_STOREOP_DONT_CARE, /**< The contents generated during the render pass are not needed and may be discarded. The contents will be undefined. */
SDL_GPU_STOREOP_RESOLVE, /**< The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture may then be discarded and will be undefined. */
SDL_GPU_STOREOP_RESOLVE_AND_STORE /**< The multisample contents generated during the render pass will be resolved to a non-multisample texture. The contents in the multisample texture will be written to memory. */
} SDL_GPUStoreOp;
πΈ DESCRIPTION πΈ
so you know how a render pass makes a whole bunch of pretty pixels and then just... ends? yeah. SDL_GPUStoreOp is the vibe check for those pixels. it tells the GPU how the contents of a texture attached to a render pass are treated at the end of the render pass. π
here's the lineup, no skips, every single one:
SDL_GPU_STOREOP_STOREβ the contents generated during the render pass will be written to memory. classic. responsible. your pixels are safe and saved. π«ΆSDL_GPU_STOREOP_DONT_CAREβ the contents generated during the render pass are not needed and may be discarded. heads up bestie, the contents will be undefined. π it's not "empty", it's undefined, which is the scarier word. don't go reading that texture afterwards and expect anything, fr fr.SDL_GPU_STOREOP_RESOLVEβ the multisample contents generated during the render pass will be resolved to a non-multisample texture. and then, plot twist: the contents in the multisample texture may then be discarded and will be undefined. so the resolve target is good, the multisample one is giving chaos. πSDL_GPU_STOREOP_RESOLVE_AND_STOREβ the multisample contents generated during the render pass will be resolved to a non-multisample texture, AND the contents in the multisample texture will be written to memory. it's the resolve but make it extra. both things kept. obsessed. β¨
lowkey important: those "undefined" ones are not a suggestion. if it says undefined, it means undefined. don't build your whole pipeline on it and then act surprised. π
π« AVAILABILITY π«
this enum has been out here serving since SDL 3.2.0. so if your SDL is older than that, sorry babe, no store ops for you. π
π¦ SEE ALSO π¦
SDL_BeginGPURenderPass(3)β like, the obvious one. you can't store op without a render pass, iykyk. π
and that's the whole page, bestie. go forth and resolve your multisample textures responsibly. πβ
this lil tutorial came to you from Simple Directmedia Layer, version SDL 3.4.18 β mwah, take care of her ππ
π¦ 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