diff --git a/gen/gen.go b/gen/gen.go index fc7d9f0..615e6c5 100644 --- a/gen/gen.go +++ b/gen/gen.go @@ -421,7 +421,18 @@ func (g *Generator) CType(typ any, pointerType PointerType) string { ctype = "float" case "float64", "float64_supertype": ctype = "double" - case "c_void": + case "c_void", + // Semantic aliases for c_void + "c_void_data_ptr", + "c_void_mapped_range_ptr", + "c_void_a_native_window", + "c_void_ca_metal_layer", + "c_void_h_instance", + "c_void_h_wnd", + "c_void_wl_display", + "c_void_wl_surface", + "c_void_x11_display", + "c_void_xcb_connection": ctype = "void" default: // Handle type names prefixed with the type category. diff --git a/schema.json b/schema.json index 28f59f9..d41c0e3 100644 --- a/schema.json +++ b/schema.json @@ -34,6 +34,16 @@ "type": "string", "enum": [ "c_void", + "c_void_data_ptr", + "c_void_mapped_range_ptr", + "c_void_a_native_window", + "c_void_ca_metal_layer", + "c_void_h_instance", + "c_void_h_wnd", + "c_void_wl_display", + "c_void_wl_surface", + "c_void_x11_display", + "c_void_xcb_connection", "bool", "nullable_string", "string_with_default_empty", diff --git a/webgpu.json b/webgpu.json index a772a4e..9b7b72a 100644 --- a/webgpu.json +++ b/webgpu.json @@ -2662,7 +2662,7 @@ "returns": { "doc": "", "pointer": "mutable", - "type": "c_void" + "type": "c_void_mapped_range_ptr" } }, { @@ -2683,7 +2683,7 @@ "returns": { "doc": "", "pointer": "immutable", - "type": "c_void" + "type": "c_void_mapped_range_ptr" } }, { @@ -2697,7 +2697,7 @@ "doc": "Destination, to read buffer data into.\n", "name": "data", "pointer": "mutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "Number of bytes of data to read from the buffer.\n(Note @ref WGPU_WHOLE_MAP_SIZE is *not* accepted here.)\n", @@ -2723,7 +2723,7 @@ "doc": "Source, to write buffer data from.\n", "name": "data", "pointer": "immutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "Number of bytes of data to write to the buffer.\n(Note @ref WGPU_WHOLE_MAP_SIZE is *not* accepted here.)\n", @@ -3142,7 +3142,7 @@ "doc": "TODO\n", "name": "data", "pointer": "immutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "TODO\n", @@ -3791,7 +3791,7 @@ "doc": "TODO\n", "name": "data", "pointer": "immutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "TODO\n", @@ -3814,7 +3814,7 @@ "doc": "TODO\n", "name": "data", "pointer": "immutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "TODO\n", @@ -3916,7 +3916,7 @@ "doc": "TODO\n", "name": "data", "pointer": "immutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "TODO\n", @@ -4175,7 +4175,7 @@ "doc": "TODO\n", "name": "data", "pointer": "immutable", - "type": "c_void" + "type": "c_void_data_ptr" }, { "doc": "TODO\n", @@ -6521,7 +6521,7 @@ "doc": "The pointer to the [`ANativeWindow`](https://developer.android.com/ndk/reference/group/a-native-window) that will be wrapped by the @ref WGPUSurface.", "name": "window", "pointer": "mutable", - "type": "c_void" + "type": "c_void_a_native_window" } ], "name": "surface_source_android_native_window", @@ -6537,7 +6537,7 @@ "doc": "The pointer to the [`CAMetalLayer`](https://developer.apple.com/documentation/quartzcore/cametallayer?language=objc) that will be wrapped by the @ref WGPUSurface.", "name": "layer", "pointer": "mutable", - "type": "c_void" + "type": "c_void_ca_metal_layer" } ], "name": "surface_source_metal_layer", @@ -6553,13 +6553,13 @@ "doc": "A [`wl_display`](https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_display) for this Wayland instance.", "name": "display", "pointer": "mutable", - "type": "c_void" + "type": "c_void_wl_display" }, { "doc": "A [`wl_surface`](https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_surface) that will be wrapped by the @ref WGPUSurface", "name": "surface", "pointer": "mutable", - "type": "c_void" + "type": "c_void_wl_surface" } ], "name": "surface_source_wayland_surface", @@ -6575,13 +6575,13 @@ "doc": "The [`HINSTANCE`](https://learn.microsoft.com/en-us/windows/win32/learnwin32/winmain--the-application-entry-point) for this application.\nMost commonly `GetModuleHandle(nullptr)`.\n", "name": "hinstance", "pointer": "mutable", - "type": "c_void" + "type": "c_void_h_instance" }, { "doc": "The [`HWND`](https://learn.microsoft.com/en-us/windows/apps/develop/ui-input/retrieve-hwnd) that will be wrapped by the @ref WGPUSurface.", "name": "hwnd", "pointer": "mutable", - "type": "c_void" + "type": "c_void_h_wnd" } ], "name": "surface_source_windows_HWND", @@ -6597,7 +6597,7 @@ "doc": "The `xcb_connection_t` for the connection to the X server.", "name": "connection", "pointer": "mutable", - "type": "c_void" + "type": "c_void_xcb_connection" }, { "doc": "The `xcb_window_t` for the window that will be wrapped by the @ref WGPUSurface.", @@ -6618,7 +6618,7 @@ "doc": "A pointer to the [`Display`](https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Opening_the_Display) connected to the X server.", "name": "display", "pointer": "mutable", - "type": "c_void" + "type": "c_void_x11_display" }, { "doc": "The [`Window`](https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Creating_Windows) that will be wrapped by the @ref WGPUSurface.", diff --git a/webgpu.yml b/webgpu.yml index bb9c264..db7b582 100644 --- a/webgpu.yml +++ b/webgpu.yml @@ -3117,7 +3117,7 @@ structs: members: - name: window doc: The pointer to the [`ANativeWindow`](https://developer.android.com/ndk/reference/group/a-native-window) that will be wrapped by the @ref WGPUSurface. - type: c_void + type: c_void_a_native_window pointer: mutable - name: surface_source_metal_layer doc: Chained in @ref WGPUSurfaceDescriptor to make an @ref WGPUSurface wrapping a [`CAMetalLayer`](https://developer.apple.com/documentation/quartzcore/cametallayer?language=objc). @@ -3127,7 +3127,7 @@ structs: members: - name: layer doc: The pointer to the [`CAMetalLayer`](https://developer.apple.com/documentation/quartzcore/cametallayer?language=objc) that will be wrapped by the @ref WGPUSurface. - type: c_void + type: c_void_ca_metal_layer pointer: mutable - name: surface_source_wayland_surface doc: Chained in @ref WGPUSurfaceDescriptor to make an @ref WGPUSurface wrapping a [Wayland](https://wayland.freedesktop.org/) [`wl_surface`](https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_surface). @@ -3137,11 +3137,11 @@ structs: members: - name: display doc: A [`wl_display`](https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_display) for this Wayland instance. - type: c_void + type: c_void_wl_display pointer: mutable - name: surface doc: A [`wl_surface`](https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_surface) that will be wrapped by the @ref WGPUSurface - type: c_void + type: c_void_wl_surface pointer: mutable - name: surface_source_windows_HWND doc: Chained in @ref WGPUSurfaceDescriptor to make an @ref WGPUSurface wrapping a Windows [`HWND`](https://learn.microsoft.com/en-us/windows/apps/develop/ui-input/retrieve-hwnd). @@ -3153,11 +3153,11 @@ structs: doc: | The [`HINSTANCE`](https://learn.microsoft.com/en-us/windows/win32/learnwin32/winmain--the-application-entry-point) for this application. Most commonly `GetModuleHandle(nullptr)`. - type: c_void + type: c_void_h_instance pointer: mutable - name: hwnd doc: The [`HWND`](https://learn.microsoft.com/en-us/windows/apps/develop/ui-input/retrieve-hwnd) that will be wrapped by the @ref WGPUSurface. - type: c_void + type: c_void_h_wnd pointer: mutable - name: surface_source_XCB_window doc: Chained in @ref WGPUSurfaceDescriptor to make an @ref WGPUSurface wrapping an [XCB](https://xcb.freedesktop.org/) `xcb_window_t`. @@ -3167,7 +3167,7 @@ structs: members: - name: connection doc: The `xcb_connection_t` for the connection to the X server. - type: c_void + type: c_void_xcb_connection pointer: mutable - name: window doc: The `xcb_window_t` for the window that will be wrapped by the @ref WGPUSurface. @@ -3180,7 +3180,7 @@ structs: members: - name: display doc: A pointer to the [`Display`](https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Opening_the_Display) connected to the X server. - type: c_void + type: c_void_x11_display pointer: mutable - name: window doc: The [`Window`](https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#Creating_Windows) that will be wrapped by the @ref WGPUSurface. @@ -3846,7 +3846,7 @@ objects: instead for better performance. returns: doc: "" - type: c_void + type: c_void_mapped_range_ptr pointer: mutable args: - name: offset @@ -3870,7 +3870,7 @@ objects: instead for better performance. returns: doc: "" - type: c_void + type: c_void_mapped_range_ptr pointer: immutable args: - name: offset @@ -3902,7 +3902,7 @@ objects: - name: data doc: | Destination, to read buffer data into. - type: c_void + type: c_void_data_ptr pointer: mutable - name: size doc: | @@ -3928,7 +3928,7 @@ objects: - name: data doc: | Source, to write buffer data from. - type: c_void + type: c_void_data_ptr pointer: immutable - name: size doc: | @@ -4250,7 +4250,7 @@ objects: - name: data doc: | TODO - type: c_void + type: c_void_data_ptr pointer: immutable - name: size doc: | @@ -4768,7 +4768,7 @@ objects: - name: data doc: | TODO - type: c_void + type: c_void_data_ptr pointer: immutable - name: size doc: | @@ -4786,7 +4786,7 @@ objects: - name: data doc: | TODO - type: c_void + type: c_void_data_ptr pointer: immutable - name: data_size doc: | @@ -4863,7 +4863,7 @@ objects: - name: data doc: | TODO - type: c_void + type: c_void_data_ptr pointer: immutable - name: size doc: | @@ -5061,7 +5061,7 @@ objects: - name: data doc: | TODO - type: c_void + type: c_void_data_ptr pointer: immutable - name: size doc: |