Skip to content

Commit

Permalink
Update yaml & add generator check workflow (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajveermalviya authored Jan 27, 2024
1 parent 4f86313 commit 6e93017
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 10 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/gen-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: gen-check
on:
pull_request:
jobs:
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '>=1.21.0'
- run: |
cd "${{ github.workspace }}"
make gen-check
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

gen: schema.json webgpu.yml
go run ./gen -schema schema.json -yaml webgpu.yml -header webgpu.h

gen-check: gen
@git diff --quiet -- webgpu.h || { git diff -- webgpu.h; exit 1; }
4 changes: 3 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
},
"returns": {
"type": "object",
"description": "Optional property, return type of the function",
"properties": {
"doc": {
"type": "string"
Expand All @@ -130,13 +131,14 @@
},
"returns_async": {
"type": "array",
"description": "List of async callback arguments",
"description": "Optional property, list of async callback arguments",
"items": {
"$ref": "#/definitions/ParameterType"
}
},
"args": {
"type": "array",
"description": "Optional property, list of function arguments",
"items": {
"$ref": "#/definitions/ParameterType"
}
Expand Down
18 changes: 9 additions & 9 deletions webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@ struct WGPUVertexState;
struct WGPUFragmentState;
struct WGPURenderPipelineDescriptor;

typedef enum WGPUWGSLFeatureName {
WGPUWGSLFeatureName_Undefined = 0x00000000,
WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001,
WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002,
WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003,
WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004,
WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF
} WGPUWGSLFeatureName WGPU_ENUM_ATTRIBUTE;

typedef enum WGPUAdapterType {
WGPUAdapterType_DiscreteGPU = 0x00000000,
WGPUAdapterType_IntegratedGPU = 0x00000001,
Expand Down Expand Up @@ -661,6 +652,15 @@ typedef enum WGPUVertexStepMode {
WGPUVertexStepMode_Force32 = 0x7FFFFFFF
} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE;

typedef enum WGPUWGSLFeatureName {
WGPUWGSLFeatureName_Undefined = 0x00000000,
WGPUWGSLFeatureName_ReadonlyAndReadwriteStorageTextures = 0x00000001,
WGPUWGSLFeatureName_Packed4x8IntegerDotProduct = 0x00000002,
WGPUWGSLFeatureName_UnrestrictedPointerParameters = 0x00000003,
WGPUWGSLFeatureName_PointerCompositeAccess = 0x00000004,
WGPUWGSLFeatureName_Force32 = 0x7FFFFFFF
} WGPUWGSLFeatureName WGPU_ENUM_ATTRIBUTE;

typedef enum WGPUBufferUsage {
WGPUBufferUsage_None = 0x00000000,
WGPUBufferUsage_MapRead = 0x00000001,
Expand Down
40 changes: 40 additions & 0 deletions webgpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ constants:
value: uint32_max
doc: |
TODO
- name: depth_slice_undefined
value: uint32_max
doc: |
TODO
- name: limit_u32_undefined
value: uint32_max
doc: |
Expand Down Expand Up @@ -1234,6 +1238,26 @@ enums:
doc: |
TODO
- name: WGSL_feature_name
doc: |
TODO
entries:
- name: undefined
doc: |
TODO
- name: readonly_and_readwrite_storage_textures
doc: |
TODO
- name: packed4x8_integer_dot_product
doc: |
TODO
- name: unrestricted_pointer_parameters
doc: |
TODO
- name: pointer_composite_access
doc: |
TODO
bitflags:
- name: buffer_usage
doc: |
Expand Down Expand Up @@ -2309,6 +2333,10 @@ structs:
TODO
type: object.texture_view
optional: true
- name: depth_slice
doc: |
TODO
type: uint32
- name: resolve_target
doc: |
TODO
Expand Down Expand Up @@ -3880,6 +3908,18 @@ objects:
TODO
type: struct.surface_descriptor
pointer: immutable
- name: has_WGSL_language_feature
doc: |
TODO
returns:
doc: |
TODO
type: bool
args:
- name: feature
doc: |
TODO
type: enum.WGSL_feature_name
- name: process_events
doc: |
TODO
Expand Down

0 comments on commit 6e93017

Please sign in to comment.