Skip to content

Commit

Permalink
Make TimestampWrites structs extensible, move nullability inside (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x authored Nov 13, 2024
1 parent 075474d commit 93e0c02
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 10 additions & 2 deletions webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,10 @@ typedef struct WGPUCompilationMessage {
} WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUComputePassTimestampWrites {
WGPUChainedStruct const * nextInChain;
/**
* Query set to write timestamps to. Null if timestamps should not be recorded.
*/
WGPUQuerySet querySet;
uint32_t beginningOfPassWriteIndex;
uint32_t endOfPassWriteIndex;
Expand Down Expand Up @@ -1656,6 +1660,10 @@ typedef struct WGPURenderPassMaxDrawCount {
} WGPURenderPassMaxDrawCount WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPURenderPassTimestampWrites {
WGPUChainedStruct const * nextInChain;
/**
* Query set to write timestamps to. Null if timestamps should not be recorded.
*/
WGPUQuerySet querySet;
uint32_t beginningOfPassWriteIndex;
uint32_t endOfPassWriteIndex;
Expand Down Expand Up @@ -2015,7 +2023,7 @@ typedef struct WGPUComputePassDescriptor {
* This is a \ref NonNullInputString.
*/
WGPUStringView label;
WGPU_NULLABLE WGPUComputePassTimestampWrites const * timestampWrites;
WGPUComputePassTimestampWrites timestampWrites;
} WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUDepthStencilState {
Expand Down Expand Up @@ -2172,7 +2180,7 @@ typedef struct WGPURenderPassDescriptor {
WGPURenderPassColorAttachment const * colorAttachments;
WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment;
WGPU_NULLABLE WGPUQuerySet occlusionQuerySet;
WGPU_NULLABLE WGPURenderPassTimestampWrites const * timestampWrites;
WGPURenderPassTimestampWrites timestampWrites;
} WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE;

typedef struct WGPUVertexState {
Expand Down
12 changes: 4 additions & 8 deletions webgpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1815,16 +1815,14 @@ structs:
doc: |
TODO
type: struct.compute_pass_timestamp_writes
pointer: immutable
optional: true
- name: compute_pass_timestamp_writes
doc: |
TODO
type: standalone
type: base_in
members:
- name: query_set
doc: |
TODO
Query set to write timestamps to. Null if timestamps should not be recorded.
type: object.query_set
- name: beginning_of_pass_write_index
doc: |
Expand Down Expand Up @@ -2404,8 +2402,6 @@ structs:
doc: |
TODO
type: struct.render_pass_timestamp_writes
pointer: immutable
optional: true
- name: render_pass_max_draw_count
doc: |
TODO
Expand All @@ -2420,11 +2416,11 @@ structs:
- name: render_pass_timestamp_writes
doc: |
TODO
type: standalone
type: base_in
members:
- name: query_set
doc: |
TODO
Query set to write timestamps to. Null if timestamps should not be recorded.
type: object.query_set
- name: beginning_of_pass_write_index
doc: |
Expand Down

0 comments on commit 93e0c02

Please sign in to comment.