SDL_GPUTextureUsageFlags - Specifies how a texture is intended to be used by the client.
Contents
Availability
This datatype is available since SDL 3.2.0.
Description
A texture must have at least one usage flag. Note that some usage flag combinations are invalid.
With regards to compute storage usage, READ | WRITE means that you can have shader A that only writes
into the texture and shader B that only reads from the texture and bind the same texture to either shader
respectively. SIMULTANEOUS means that you can do reads and writes within the same shader or compute
pass. It also implies that atomic ops can be used, since those are read-modify-write operations. If you
use SIMULTANEOUS, you are responsible for avoiding data races, as there is no data synchronization within
a compute pass. Note that SIMULTANEOUS usage is only supported by a limited number of texture formats.
Header File
Defined in SDL3/SDL_gpu.h
Name
SDL_GPUTextureUsageFlags - Specifies how a texture is intended to be used by the client.
See Also
•(3), SDL_CreateGPUTexture(3) Simple Directmedia Layer SDL 3.2.10 SDL_GPUTextureUsageFlags(3type)
Synopsis
#include"SDL3/SDL.h"typedefUint32SDL_GPUTextureUsageFlags;#defineSDL_GPU_TEXTUREUSAGE_SAMPLER(1u<<0)/**<Texturesupportssampling.*/#defineSDL_GPU_TEXTUREUSAGE_COLOR_TARGET(1u<<1)/**<Textureisacolorrendertarget.*/#defineSDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET(1u<<2)/**<Textureisadepthstenciltarget.*/#defineSDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ(1u<<3)/**<Texturesupportsstoragereadsingraphicsstages.*/#defineSDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ(1u<<4)/**<Texturesupportsstoragereadsinthecomputestage.*/#defineSDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE(1u<<5)/**<Texturesupportsstoragewritesinthecomputestage.*/#defineSDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE(1u<<6)/**<Texturesupportsreadsandwritesinthesamecomputeshader.ThisisNOTequivalenttoREAD|WRITE.*/
