mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-11-30 16:48:41 +01:00
webgpu: Several wikiheaders fixes for the new WebGPU work.
This commit is contained in:
@@ -26,7 +26,7 @@ manpagesymbolfilterregex = \A[US]int\d+\Z
|
||||
headercategoryeval = s/\ASDL_test_?.*?\.h\Z//; s/\ASDL_main_impl\.h\Z//; s/\ASDL_?(.*?)\.h\Z/$1/; ucfirst();
|
||||
|
||||
quickrefenabled = 1
|
||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Messagebox,Clipboard,Dialog,Tray,Notification,GPU,Vulkan,Metal,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
|
||||
quickrefcategoryorder = Init,Hints,Error,Version,Properties,Log,Video,Events,Keyboard,Mouse,Touch,Gamepad,Joystick,Haptic,Audio,Time,Timer,Render,SharedObject,Thread,Mutex,Atomic,Filesystem,IOStream,AsyncIO,Storage,Pixels,Surface,Blendmode,Rect,Camera,Messagebox,Clipboard,Dialog,Tray,Notification,GPU,Vulkan,Metal,WGPU,Platform,Power,Sensor,Process,Bits,Endian,Assert,CPUInfo,Intrinsics,Locale,System,Misc,GUID,Main,Stdinc
|
||||
quickreftitle = SDL3 API Quick Reference
|
||||
quickrefurl = https://libsdl.org/
|
||||
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
|
||||
|
||||
+38
-35
@@ -277,6 +277,7 @@
|
||||
* Generally speaking, if you're using a modern browser you can use WebGPU.
|
||||
*
|
||||
* The backend requires these WebGPU features to run:
|
||||
*
|
||||
* - `BGRA8UnormStorage`
|
||||
* - `CoreFeaturesAndLimits`
|
||||
* - `Depth32FloatStencil8`
|
||||
@@ -287,6 +288,7 @@
|
||||
*
|
||||
* 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.
|
||||
@@ -2881,6 +2883,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGPUDeviceProperties(SDL_GPUD
|
||||
* **WGSL (WebGPU Shading Language)**
|
||||
*
|
||||
* For WGSL, use the following order:
|
||||
*
|
||||
* - 0: Sampled textures, followed by read-only storage textures, followed by
|
||||
* read-only storage buffers
|
||||
* - 1: Read-write storage textures, followed by read-write storage buffers
|
||||
@@ -2897,27 +2900,27 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGPUDeviceProperties(SDL_GPUD
|
||||
* like this:
|
||||
*
|
||||
* ```wgsl
|
||||
* // Sampled textures come first, followed by the sampler, in SDL slot order.
|
||||
* \@group(0) \@binding(0) var sampledTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(1) var samplerBoundToSlot0: sampler
|
||||
* \@group(0) \@binding(2) var sampledTextureBoundToSlot1: ...
|
||||
* \@group(0) \@binding(3) var samplerBoundToSlot1: sampler
|
||||
* // Any read-only storage textures come next, in SDL slot order.
|
||||
* \@group(0) \@binding(4) var readOnlyStorageTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(5) var readOnlyStorageTextureBoundToSlot1: ...
|
||||
* // Any read-only storage buffers come next, in SDL slot order.
|
||||
* \@group(0) \@binding(6) var<storage, ...> readOnlyStorageBufferBoundToSlot0: ...
|
||||
* \@group(0) \@binding(7) var<storage, ...> readOnlyStorageBufferBoundToSlot1: ...
|
||||
* // Read-write storage textures and buffers have their own bind group.
|
||||
* // Read-write storage textures go first, in SDL slot order.
|
||||
* \@group(1) \@binding(0) var readWriteStorageTextureBoundToSlot0: ...
|
||||
* \@group(1) \@binding(1) var readWriteStorageTextureBoundToSlot1: ...
|
||||
* // Any read-write storage textures come next, in SDL slot order.
|
||||
* \@group(1) \@binding(2) var<storage, ...> readWriteStorageBufferBoundToSlot0: ...
|
||||
* \@group(1) \@binding(3) var<storage, ...> readWriteStorageBufferBoundToSlot1: ...
|
||||
* // Any uniform buffers are in their own set, in SDL slot order.
|
||||
* \@group(2) \@binding(0) var<uniform> uniformBufferBoundToSlot0: ...
|
||||
* \@group(2) \@binding(1) var<uniform> uniformBufferBoundToSlot1: ...
|
||||
* // Sampled textures come first, followed by the sampler, in SDL slot order.
|
||||
* \@group(0) \@binding(0) var sampledTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(1) var samplerBoundToSlot0: sampler
|
||||
* \@group(0) \@binding(2) var sampledTextureBoundToSlot1: ...
|
||||
* \@group(0) \@binding(3) var samplerBoundToSlot1: sampler
|
||||
* // Any read-only storage textures come next, in SDL slot order.
|
||||
* \@group(0) \@binding(4) var readOnlyStorageTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(5) var readOnlyStorageTextureBoundToSlot1: ...
|
||||
* // Any read-only storage buffers come next, in SDL slot order.
|
||||
* \@group(0) \@binding(6) var<storage, ...> readOnlyStorageBufferBoundToSlot0: ...
|
||||
* \@group(0) \@binding(7) var<storage, ...> readOnlyStorageBufferBoundToSlot1: ...
|
||||
* // Read-write storage textures and buffers have their own bind group.
|
||||
* // Read-write storage textures go first, in SDL slot order.
|
||||
* \@group(1) \@binding(0) var readWriteStorageTextureBoundToSlot0: ...
|
||||
* \@group(1) \@binding(1) var readWriteStorageTextureBoundToSlot1: ...
|
||||
* // Any read-write storage textures come next, in SDL slot order.
|
||||
* \@group(1) \@binding(2) var<storage, ...> readWriteStorageBufferBoundToSlot0: ...
|
||||
* \@group(1) \@binding(3) var<storage, ...> readWriteStorageBufferBoundToSlot1: ...
|
||||
* // Any uniform buffers are in their own set, in SDL slot order.
|
||||
* \@group(2) \@binding(0) var<uniform> uniformBufferBoundToSlot0: ...
|
||||
* \@group(2) \@binding(1) var<uniform> uniformBufferBoundToSlot1: ...
|
||||
* ```
|
||||
*
|
||||
* ---
|
||||
@@ -3193,20 +3196,20 @@ extern SDL_DECLSPEC SDL_GPUSampler * SDLCALL SDL_CreateGPUSampler(
|
||||
* and 2 uniform buffers, its binding layout should look like this:
|
||||
*
|
||||
* ```wgsl
|
||||
* // Sampled textures come first, followed by the sampler, in SDL slot order.
|
||||
* \@group(0) \@binding(0) var sampledTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(1) var samplerBoundToSlot0: sampler
|
||||
* \@group(0) \@binding(2) var sampledTextureBoundToSlot1: ...
|
||||
* \@group(0) \@binding(3) var samplerBoundToSlot1: sampler
|
||||
* // Any storage textures come next, in SDL slot order.
|
||||
* \@group(0) \@binding(4) var storageTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(5) var storageTextureBoundToSlot1: ...
|
||||
* // Any storage buffers come next, in SDL slot order.
|
||||
* \@group(0) \@binding(6) var<storage, ...> storageBufferBoundToSlot0: ...
|
||||
* \@group(0) \@binding(7) var<storage, ...> storageBufferBoundToSlot1: ...
|
||||
* // Any uniform buffers are in their own set, in SDL slot order.
|
||||
* \@group(1) \@binding(0) var<uniform> uniformBufferBoundToSlot0: ...
|
||||
* \@group(1) \@binding(1) var<uniform> uniformBufferBoundToSlot1: ...
|
||||
* // Sampled textures come first, followed by the sampler, in SDL slot order.
|
||||
* \@group(0) \@binding(0) var sampledTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(1) var samplerBoundToSlot0: sampler
|
||||
* \@group(0) \@binding(2) var sampledTextureBoundToSlot1: ...
|
||||
* \@group(0) \@binding(3) var samplerBoundToSlot1: sampler
|
||||
* // Any storage textures come next, in SDL slot order.
|
||||
* \@group(0) \@binding(4) var storageTextureBoundToSlot0: ...
|
||||
* \@group(0) \@binding(5) var storageTextureBoundToSlot1: ...
|
||||
* // Any storage buffers come next, in SDL slot order.
|
||||
* \@group(0) \@binding(6) var<storage, ...> storageBufferBoundToSlot0: ...
|
||||
* \@group(0) \@binding(7) var<storage, ...> storageBufferBoundToSlot1: ...
|
||||
* // Any uniform buffers are in their own set, in SDL slot order.
|
||||
* \@group(1) \@binding(0) var<uniform> uniformBufferBoundToSlot0: ...
|
||||
* \@group(1) \@binding(1) var<uniform> uniformBufferBoundToSlot1: ...
|
||||
* ```
|
||||
*
|
||||
* ---
|
||||
|
||||
+27
-4
@@ -1,7 +1,30 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* WIKI CATEGORY: WGPU */
|
||||
|
||||
/**
|
||||
* # CategoryWGPU
|
||||
*
|
||||
* Experimental video support for WebGPU.
|
||||
* Video support for WebGPU.
|
||||
*/
|
||||
|
||||
#ifndef SDL_wgpu_h_
|
||||
@@ -36,7 +59,7 @@ WGPU_OBJECT_ATTRIBUTE(WGPUInstance)
|
||||
* \returns true on success or false on failure; call SDL_GetError() for more
|
||||
* information.
|
||||
*
|
||||
* \since This is part of SDL PR #16020, and is therefore not available in regular SDL.
|
||||
* \since This function is available since SDL 3.6.0.
|
||||
*
|
||||
* \sa SDL_WGPU_DestroySurface
|
||||
*/
|
||||
@@ -47,7 +70,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_WGPU_CreateSurface(SDL_Window *window, WGPU
|
||||
*
|
||||
* \param surface the surface to destroy.
|
||||
*
|
||||
* \since This is part of SDL PR #16020, and is therefore not available in regular SDL.
|
||||
* \since This function is available since SDL 3.6.0.
|
||||
*
|
||||
* \sa SDL_WGPU_CreateSurface
|
||||
*/
|
||||
@@ -58,4 +81,4 @@ extern SDL_DECLSPEC void SDLCALL SDL_WGPU_DestroySurface(WGPUSurface surface);
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif // SDL_wgpu_h_
|
||||
#endif /* SDL_wgpu_h_ */
|
||||
|
||||
Reference in New Issue
Block a user