From 6e9301790c922ef1df6bceb3e706c543382c2685 Mon Sep 17 00:00:00 2001 From: Rajesh Malviya Date: Sat, 27 Jan 2024 12:22:48 +0530 Subject: [PATCH] Update yaml & add generator check workflow (#267) --- .github/workflows/gen-check.yml | 14 ++++++++++++ Makefile | 3 +++ schema.json | 4 +++- webgpu.h | 18 +++++++-------- webgpu.yml | 40 +++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/gen-check.yml diff --git a/.github/workflows/gen-check.yml b/.github/workflows/gen-check.yml new file mode 100644 index 00000000..c54316b3 --- /dev/null +++ b/.github/workflows/gen-check.yml @@ -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 diff --git a/Makefile b/Makefile index beba92d5..7841d30f 100644 --- a/Makefile +++ b/Makefile @@ -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; } diff --git a/schema.json b/schema.json index 0ad9f56c..0219512b 100644 --- a/schema.json +++ b/schema.json @@ -110,6 +110,7 @@ }, "returns": { "type": "object", + "description": "Optional property, return type of the function", "properties": { "doc": { "type": "string" @@ -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" } diff --git a/webgpu.h b/webgpu.h index 9bd0b6b6..76c50ea3 100644 --- a/webgpu.h +++ b/webgpu.h @@ -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, @@ -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, diff --git a/webgpu.yml b/webgpu.yml index 29aea19d..3934ad9f 100644 --- a/webgpu.yml +++ b/webgpu.yml @@ -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: | @@ -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: | @@ -2309,6 +2333,10 @@ structs: TODO type: object.texture_view optional: true + - name: depth_slice + doc: | + TODO + type: uint32 - name: resolve_target doc: | TODO @@ -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