Sync SDL3 wiki -> headers.

This commit is contained in:
Ryan C. Gordon
2026-11-29 20:28:02 -05:00
parent 2c52c10441
commit 7a56d55a54
2 changed files with 37 additions and 34 deletions
+36 -33
View File
@@ -273,8 +273,9 @@
*
* SDL driver name: "webgpu"
*
* WebGPU support is complicated and rapidly updating, so there's no exact list.
* Generally speaking, if you're using a modern browser you can use WebGPU.
* WebGPU support is complicated and rapidly updating, so there's no exact
* list. Generally speaking, if you're using a modern browser you can use
* WebGPU.
*
* The backend requires these WebGPU features to run:
*
@@ -286,25 +287,24 @@
* - `IndirectFirstInstance`
* - `RG11B10UfloatRenderable`
*
* The backend also optionally supports some features. These features are not required
* for the backend to run, but they are required for specific SDLGPU functionality:
* The backend also optionally supports some features. These features are not
* required for the backend to run, but they are required for specific SDLGPU
* functionality:
*
* - `Float32Blendable`
* Required for blending Float32 textures. The backend will safely disable blending
* if this is unsupported.
* - `Float32Blendable` Required for blending Float32 textures. The backend
* will safely disable blending if this is unsupported.
* - `TextureCompressionASTC`
* - `TextureCompressionASTCSliced3D`
* Required for ASTC texture format support.
* - `TextureCompressionASTCSliced3D` Required for ASTC texture format
* support.
* - `TextureCompressionBC`
* - `TextureCompressionBCSliced3D`
* Required for BC texture format support
* - `TextureCompressionBCSliced3D` Required for BC texture format support
* - `TextureFormatsTier1`
* - `TextureFormatsTier2`
* Required for a lot of stuff, mostly related to texture sampling & access. It's
* too much to list here.
* - `TextureFormatsTier2` Required for a lot of stuff, mostly related to
* texture sampling & access. It's too much to list here.
*
* Both all required and optional features will be requested automatically during
* device creation. If debug mode is enabled, any unsupported features will be logged.
* Both all required and optional features will be requested automatically
* during device creation. If debug mode is enabled, any unsupported features
* will be logged.
*
* ## Coordinate System
*
@@ -2889,10 +2889,10 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGPUDeviceProperties(SDL_GPUD
* - 1: Read-write storage textures, followed by read-write storage buffers
* - 2: Uniform buffers
*
* Note that WebGPU does not differentiate between simultaneous read-write and non-simultaneous
* read-write. This means that any storage bind with both READ & WRITE accesses will be treated
* as if it were simultaneous. If simultaneous RW is unsupported, the backend will fall back
* to write-only.
* Note that WebGPU does not differentiate between simultaneous read-write and
* non-simultaneous read-write. This means that any storage bind with both
* READ & WRITE accesses will be treated as if it were simultaneous. If
* simultaneous RW is unsupported, the backend will fall back to write-only.
*
* **Example**
*
@@ -3177,18 +3177,21 @@ extern SDL_DECLSPEC SDL_GPUSampler * SDLCALL SDL_CreateGPUSampler(
* resources must appear at consecutive bindings (1, 2, etc), leaving no gaps
* in the set.
*
* All sampled textures must come first in the binding order, followed by their
* associated sampler, in order of how they are bound via `SDL_BindGPU*Samplers()`.
* All sampled textures must come first in the binding order, followed by
* their associated sampler, in order of how they are bound via
* `SDL_BindGPU*Samplers()`.
*
* All storage textures must come after all samplers and sampled textures
* in the binding order, in order of how they are bound via `SDL_Bind*StorageTextures()`.
* All storage textures must come after all samplers and sampled textures in
* the binding order, in order of how they are bound via
* `SDL_Bind*StorageTextures()`.
*
* All storage buffers must come after all storage textures in the binding
* order, in order of how they are bound via `SDL_Bind*StorageBuffers()`.
*
* Note that WebGPU has... odd alignment rules. All types must be aligned to a power of
* two, but can be any size.
* Consult the [WebGPU spec](https://www.w3.org/TR/WGSL/#alignment-and-size) for more.
* Note that WebGPU has... odd alignment rules. All types must be aligned to a
* power of two, but can be any size. Consult the
* [WebGPU spec](https://www.w3.org/TR/WGSL/#alignment-and-size)
* for more.
*
* **Example**
*
@@ -4358,9 +4361,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_EndGPUComputePass(
* SDL_UnmapGPUTransferBuffer. The memory is owned by the graphics driver - do
* NOT call SDL_free() on the returned pointer.
*
* Note that for the WebGPU backend, mapping download buffers is a very expensive
* procedure. Mapping download buffers with the WebGPU backend is strongly
* discouraged.
* Note that for the WebGPU backend, mapping download buffers is a very
* expensive procedure. Mapping download buffers with the WebGPU backend is
* strongly discouraged.
*
* \param device a GPU context.
* \param transfer_buffer a transfer buffer.
@@ -4420,9 +4423,9 @@ extern SDL_DECLSPEC SDL_GPUCopyPass * SDLCALL SDL_BeginGPUCopyPass(
* 512 bytes. If they are not, SDL will make a temporary copy of the data that
* is properly aligned, but this adds overhead to the transfer process. Apps
* can avoid this by aligning their data appropriately, or using a different
* GPU backend than Direct3D 12.
* Note that the WebGPU backend inherits Direct3D's 256-byte BPR alignment
* rules, and therefore also presents the same behaviour.
* GPU backend than Direct3D 12. Note that the WebGPU backend inherits
* Direct3D's 256-byte BPR alignment rules, and therefore also presents the
* same behaviour.
*
* \param copy_pass a copy pass handle.
* \param source the source transfer buffer with image layout information.
+1 -1
View File
@@ -49,13 +49,13 @@ WGPU_OBJECT_ATTRIBUTE(WGPUInstance)
/**
* Create a new WebGPU surface.
*
* This will not configure the surface.
*
* \param window the window which the surface will attach itself to.
* \param instance a WebGPU instance.
* \param surface a pointer to a WGPUSurface handle to output the newly
* created WebGPU surface.
*
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*