Sync SDL3 wiki -> header

This commit is contained in:
SDL Wiki Bot 2024-09-27 19:50:13 +00:00
parent 05d0656bd6
commit 769ff47461

View file

@ -464,10 +464,15 @@ typedef enum SDL_GPUTextureFormat
* A texture must have at least one usage flag. Note that some usage flag * A texture must have at least one usage flag. Note that some usage flag
* combinations are invalid. * 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. * With regards to compute storage usage, READ | WRITE means that you can have
* 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. * shader A that only writes into the texture and shader B that only reads
* If you use SIMULTANEOUS, you are responsible for avoiding data races, as there is no data synchronization within a compute pass. * from the texture and bind the same texture to either shader respectively.
* Note that SIMULTANEOUS usage is only supported by a limited number of texture formats. * 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.
* *
* \since This datatype is available since SDL 3.0.0 * \since This datatype is available since SDL 3.0.0
* *
@ -542,8 +547,8 @@ typedef enum SDL_GPUCubeMapFace
* A buffer must have at least one usage flag. Note that some usage flag * A buffer must have at least one usage flag. Note that some usage flag
* combinations are invalid. * combinations are invalid.
* *
* Unlike textures, READ | WRITE can be used for simultaneous read-write usage. * Unlike textures, READ | WRITE can be used for simultaneous read-write
* The same data synchronization concerns as textures apply. * usage. The same data synchronization concerns as textures apply.
* *
* \since This datatype is available since SDL 3.0.0 * \since This datatype is available since SDL 3.0.0
* *
@ -2817,21 +2822,22 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPURenderPass(
* *
* A compute pass is defined by a set of texture subresources and buffers that * A compute pass is defined by a set of texture subresources and buffers that
* may be written to by compute pipelines. These textures and buffers must * may be written to by compute pipelines. These textures and buffers must
* have been created with the COMPUTE_STORAGE_WRITE bit or the COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE bit. * have been created with the COMPUTE_STORAGE_WRITE bit or the
* If you do not create a texture with COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE, you must not read from the texture in the compute pass. * COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE bit. If you do not create a texture
* All operations * with COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE, you must not read from the
* related to compute pipelines must take place inside of a compute pass. You * texture in the compute pass. All operations related to compute pipelines
* must not begin another compute pass, or a render pass or copy pass before * must take place inside of a compute pass. You must not begin another
* ending the compute pass. * compute pass, or a render pass or copy pass before ending the compute pass.
* *
* A VERY IMPORTANT NOTE - Reads and writes in compute passes are NOT implicitly synchronized. * A VERY IMPORTANT NOTE - Reads and writes in compute passes are NOT
* This means you may cause data races by both reading and writing a resource region in a compute pass, * implicitly synchronized. This means you may cause data races by both
* or by writing multiple times to a resource region. * reading and writing a resource region in a compute pass, or by writing
* If your compute work depends on reading the completed output from a previous * multiple times to a resource region. If your compute work depends on
* dispatch, you MUST end the current compute pass and begin a new one before * reading the completed output from a previous dispatch, you MUST end the
* you can safely access the data. Otherwise you will receive unexpected results. * current compute pass and begin a new one before you can safely access the
* Reading and writing a texture in the same compute pass is only supported by specific texture formats. * data. Otherwise you will receive unexpected results. Reading and writing a
* Make sure you check the format support! * texture in the same compute pass is only supported by specific texture
* formats. Make sure you check the format support!
* *
* \param command_buffer a command buffer. * \param command_buffer a command buffer.
* \param storage_texture_bindings an array of writeable storage texture * \param storage_texture_bindings an array of writeable storage texture