GPU: Note buffer alignment requirements

This commit is contained in:
cosmonaut
2025-01-21 15:07:34 -08:00
parent 5bf077f1f1
commit 799093799a

View File

@@ -2494,6 +2494,9 @@ extern SDL_DECLSPEC SDL_GPUTexture *SDLCALL SDL_CreateGPUTexture(
* Note that certain combinations of usage flags are invalid. For example, a
* buffer cannot have both the VERTEX and INDEX flags.
*
* If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions.
* In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
*
* For better understanding of underlying concepts and memory management with
* SDL GPU API, you may refer
* [this blog post](https://moonside.games/posts/sdl-gpu-concepts-cycling/)
@@ -2796,6 +2799,9 @@ extern SDL_DECLSPEC SDL_GPUCommandBuffer *SDLCALL SDL_AcquireGPUCommandBuffer(
*
* Subsequent draw calls will use this uniform data.
*
* The data being pushed must respect std140 layout conventions.
* In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
*
* \param command_buffer a command buffer.
* \param slot_index the vertex uniform slot to push data to.
* \param data client data to write.
@@ -2835,6 +2841,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_PushGPUFragmentUniformData(
* Pushes data to a uniform slot on the command buffer.
*
* Subsequent draw calls will use this uniform data.
* The data being pushed must respect std140 layout conventions.
* In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
*
* \param command_buffer a command buffer.
* \param slot_index the uniform slot to push data to.