Skip to content

Commit

Permalink
Merge branch 'main' into vertex-extensible
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x authored Nov 13, 2024
2 parents afc53af + bac5208 commit f34323a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions doc/articles/Surfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Surfaces that can be presented to using `webgpu.h` (but not necessarily by all i
- `wl_surface` on Wayland systems with @ref WGPUSurfaceSourceWaylandSurface
- `xcb_window_t` using XCB windows with @ref WGPUSurfaceSourceXCBWindow

Note, if the same environment-specific object is used as the output of two different things simultaneously (two different `WGPUSurface`s, or one `WGPUSurface` and something else outside `webgpu.h`), the behavior is undefined.

For example, creating an @ref WGPUSurface from an `HWND` is done like so:

```c
Expand Down
2 changes: 1 addition & 1 deletion gen/yml.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ParameterType struct {
type Callback struct {
Name string `yaml:"name"`
Doc string `yaml:"doc"`
Style string `yaml:"type"`
Style string `yaml:"style"`
Args []ParameterType `yaml:"args"`
}

Expand Down
10 changes: 10 additions & 0 deletions webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1293,62 +1293,71 @@ typedef struct WGPUChainedStructOut {
*/
typedef struct WGPUBufferMapCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUBufferMapCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUBufferMapCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUCompilationInfoCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUCompilationInfoCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUCompilationInfoCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUCreateComputePipelineAsyncCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUCreateComputePipelineAsyncCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUCreateComputePipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUCreateRenderPipelineAsyncCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUCreateRenderPipelineAsyncCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUCreateRenderPipelineAsyncCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUDeviceLostCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUDeviceLostCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUDeviceLostCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUPopErrorScopeCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUPopErrorScopeCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUPopErrorScopeCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUQueueWorkDoneCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPUQueueWorkDoneCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPUQueueWorkDoneCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPURequestAdapterCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPURequestAdapterCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
} WGPURequestAdapterCallbackInfo WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPURequestDeviceCallbackInfo {
WGPUChainedStruct const * nextInChain;
WGPUCallbackMode mode;
WGPURequestDeviceCallback callback;
WGPU_NULLABLE void* userdata1;
WGPU_NULLABLE void* userdata2;
Expand Down Expand Up @@ -1920,6 +1929,7 @@ typedef struct WGPUSurfaceSourceXlibWindow {
* See @ref Surface-Presenting for more details.
*/
typedef struct WGPUSurfaceTexture {
WGPUChainedStructOut * nextInChain;
/**
* The @ref WGPUTexture representing the frame that will be shown on the surface.
* It is @ref ReturnedWithOwnership from @ref wgpuSurfaceGetCurrentTexture.
Expand Down
2 changes: 1 addition & 1 deletion webgpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2804,7 +2804,7 @@ structs:
doc: |
Queried each frame from a @ref WGPUSurface to get a @ref WGPUTexture to render to along with some metadata.
See @ref Surface-Presenting for more details.
type: standalone
type: base_out
members:
- name: texture
doc: |
Expand Down

0 comments on commit f34323a

Please sign in to comment.