From 39ed9b582242469316d4a5f7b53e699276191d70 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Tue, 26 Jul 2022 23:03:54 -0700 Subject: [PATCH] gpu: correct implementation invocations Signed-off-by: Stephen Gutekanst --- gpu/src/adapter.zig | 18 +- gpu/src/bind_group.zig | 8 +- gpu/src/bind_group_layout.zig | 8 +- gpu/src/buffer.zig | 22 +- gpu/src/command_buffer.zig | 8 +- gpu/src/command_encoder.zig | 40 +- gpu/src/compute_pass_encoder.zig | 32 +- gpu/src/compute_pipeline.zig | 10 +- gpu/src/device.zig | 70 +-- gpu/src/external_texture.zig | 10 +- gpu/src/instance.zig | 10 +- gpu/src/interface.zig | 830 +++++++++++++++--------------- gpu/src/pipeline_layout.zig | 8 +- gpu/src/query_set.zig | 14 +- gpu/src/queue.zig | 18 +- gpu/src/render_bundle.zig | 6 +- gpu/src/render_bundle_encoder.zig | 32 +- gpu/src/render_pass_encoder.zig | 50 +- gpu/src/render_pipeline.zig | 10 +- gpu/src/sampler.zig | 8 +- gpu/src/shader_module.zig | 10 +- gpu/src/surface.zig | 6 +- gpu/src/swap_chain.zig | 12 +- gpu/src/texture.zig | 28 +- gpu/src/texture_view.zig | 8 +- 25 files changed, 638 insertions(+), 638 deletions(-) diff --git a/gpu/src/adapter.zig b/gpu/src/adapter.zig index f9b5ae24..968f2398 100644 --- a/gpu/src/adapter.zig +++ b/gpu/src/adapter.zig @@ -5,40 +5,40 @@ const DeviceDescriptor = @import("device.zig").DeviceDescriptor; const FeatureName = @import("types.zig").FeatureName; const SupportedLimits = @import("types.zig").SupportedLimits; const RequestDeviceStatus = @import("types.zig").RequestDeviceStatus; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Adapter = *opaque { pub inline fn createDevice(adapter: Adapter, descriptor: ?*const DeviceDescriptor) ?Device { - return impl.createDevice(adapter, descriptor); + return Impl.createDevice(adapter, descriptor); } /// Call once with null to determine the array length, and again to fetch the feature list. pub inline fn enumerateFeatures(adapter: Adapter, features: ?[*]FeatureName) usize { - return impl.adapterEnumerateFeatures(adapter, features); + return Impl.adapterEnumerateFeatures(adapter, features); } pub inline fn getLimits(adapter: Adapter, limits: *SupportedLimits) bool { - return impl.adapterGetLimits(adapter, limits); + return Impl.adapterGetLimits(adapter, limits); } pub inline fn getProperties(adapter: Adapter, properties: *AdapterProperties) void { - impl.adapterGetProperties(adapter, properties); + Impl.adapterGetProperties(adapter, properties); } pub inline fn hasFeature(adapter: Adapter, feature: FeatureName) bool { - return impl.adapterHasFeature(adapter, feature); + return Impl.adapterHasFeature(adapter, feature); } pub inline fn requestDevice(adapter: Adapter, descriptor: ?*const DeviceDescriptor, callback: RequestDeviceCallback, userdata: *anyopaque) void { - impl.adapterRequestDevice(adapter, descriptor, callback, userdata); + Impl.adapterRequestDevice(adapter, descriptor, callback, userdata); } pub inline fn reference(adapter: Adapter) void { - impl.adapterReference(adapter); + Impl.adapterReference(adapter); } pub inline fn release(adapter: Adapter) void { - impl.adapterRelease(adapter); + Impl.adapterRelease(adapter); } }; diff --git a/gpu/src/bind_group.zig b/gpu/src/bind_group.zig index 3a2cf440..7918e8fc 100644 --- a/gpu/src/bind_group.zig +++ b/gpu/src/bind_group.zig @@ -3,19 +3,19 @@ const Sampler = @import("sampler.zig").Sampler; const TextureView = @import("texture_view.zig").TextureView; const ChainedStruct = @import("types.zig").ChainedStruct; const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const BindGroup = *opaque { pub inline fn setLabel(bind_group: BindGroup, label: [*:0]const u8) void { - impl.bindGroupSetLabel(bind_group, label); + Impl.bindGroupSetLabel(bind_group, label); } pub inline fn reference(bind_group: BindGroup) void { - impl.bindGroupReference(bind_group); + Impl.bindGroupReference(bind_group); } pub inline fn release(bind_group: BindGroup) void { - impl.bindGroupRelease(bind_group); + Impl.bindGroupRelease(bind_group); } }; diff --git a/gpu/src/bind_group_layout.zig b/gpu/src/bind_group_layout.zig index 2d422103..76cdb8a3 100644 --- a/gpu/src/bind_group_layout.zig +++ b/gpu/src/bind_group_layout.zig @@ -7,19 +7,19 @@ const SamplerBindingLayout = @import("sampler.zig").SamplerBindingLayout; const Texture = @import("texture.zig").Texture; const TextureBindingLayout = @import("texture.zig").TextureBindingLayout; const StorageTextureBindingLayout = @import("types.zig").StorageTextureBindingLayout; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const BindGroupLayout = *opaque { pub inline fn setLabel(bind_group_layout: BindGroupLayout, label: [*:0]const u8) void { - impl.bindGroupLayoutSetLabel(bind_group_layout, label); + Impl.bindGroupLayoutSetLabel(bind_group_layout, label); } pub inline fn reference(bind_group_layout: BindGroupLayout) void { - impl.bindGroupLayoutReference(bind_group_layout); + Impl.bindGroupLayoutReference(bind_group_layout); } pub inline fn release(bind_group_layout: BindGroupLayout) void { - impl.bindGroupLayoutRelease(bind_group_layout); + Impl.bindGroupLayoutRelease(bind_group_layout); } }; diff --git a/gpu/src/buffer.zig b/gpu/src/buffer.zig index 80580f73..c6435eec 100644 --- a/gpu/src/buffer.zig +++ b/gpu/src/buffer.zig @@ -1,47 +1,47 @@ const std = @import("std"); const ChainedStruct = @import("types.zig").ChainedStruct; const MapModeFlags = @import("types.zig").MapModeFlags; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Buffer = *opaque { pub inline fn destroy(buffer: Buffer) void { - impl.bufferDestroy(buffer); + Impl.bufferDestroy(buffer); } pub inline fn bufferGetConstMappedRange(buffer: Buffer, offset: usize, size: usize) ?*const anyopaque { - return impl.bufferGetConstMappedRange(buffer, offset, size); + return Impl.bufferGetConstMappedRange(buffer, offset, size); } pub inline fn bufferGetMappedRange(buffer: Buffer, offset: usize, size: usize) ?*anyopaque { - return impl.bufferGetMappedRange(buffer, offset, size); + return Impl.bufferGetMappedRange(buffer, offset, size); } pub inline fn bufferGetSize(buffer: Buffer) u64 { - return impl.bufferGetSize(buffer); + return Impl.bufferGetSize(buffer); } pub inline fn bufferGetUsage(buffer: Buffer) BufferUsage { - return impl.bufferGetUsage(buffer); + return Impl.bufferGetUsage(buffer); } pub inline fn bufferMapAsync(buffer: Buffer, mode: MapModeFlags, offset: usize, size: usize, callback: BufferMapCallback, userdata: *anyopaque) void { - impl.bufferMapAsync(buffer, mode, offset, size, callback, userdata); + Impl.bufferMapAsync(buffer, mode, offset, size, callback, userdata); } pub inline fn bufferSetLabel(buffer: Buffer, label: [*:0]const u8) void { - impl.bufferSetLabel(buffer, label); + Impl.bufferSetLabel(buffer, label); } pub inline fn bufferUnmap(buffer: Buffer) void { - impl.bufferUnmap(buffer); + Impl.bufferUnmap(buffer); } pub inline fn bufferReference(buffer: Buffer) void { - impl.bufferReference(buffer); + Impl.bufferReference(buffer); } pub inline fn bufferRelease(buffer: Buffer) void { - impl.bufferRelease(buffer); + Impl.bufferRelease(buffer); } }; diff --git a/gpu/src/command_buffer.zig b/gpu/src/command_buffer.zig index a401ef66..b63ed138 100644 --- a/gpu/src/command_buffer.zig +++ b/gpu/src/command_buffer.zig @@ -1,17 +1,17 @@ const ChainedStruct = @import("types.zig").ChainedStruct; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const CommandBuffer = *opaque { pub inline fn setLabel(command_buffer: CommandBuffer, label: [*:0]const u8) void { - impl.commandBufferSetLabel(command_buffer, label); + Impl.commandBufferSetLabel(command_buffer, label); } pub inline fn reference(command_buffer: CommandBuffer) void { - impl.commandBufferReference(command_buffer); + Impl.commandBufferReference(command_buffer); } pub inline fn release(command_buffer: CommandBuffer) void { - impl.commandBufferRelease(command_buffer); + Impl.commandBufferRelease(command_buffer); } }; diff --git a/gpu/src/command_encoder.zig b/gpu/src/command_encoder.zig index 080276f0..2eed83ea 100644 --- a/gpu/src/command_encoder.zig +++ b/gpu/src/command_encoder.zig @@ -10,85 +10,85 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const ImageCopyBuffer = @import("types.zig").ImageCopyBuffer; const ImageCopyTexture = @import("types.zig").ImageCopyTexture; const Extent3D = @import("types.zig").Extent3D; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const CommandEncoder = *opaque { pub inline fn beginComputePass(command_encoder: CommandEncoder, descriptor: ?*const ComputePassDescriptor) ComputePassEncoder { - return impl.commandEncoderBeginComputePass(command_encoder, descriptor); + return Impl.commandEncoderBeginComputePass(command_encoder, descriptor); } pub inline fn beginRenderPass(command_encoder: CommandEncoder, descriptor: *const RenderPassDescriptor) RenderPassEncoder { - return impl.commandEncoderBeginRenderPass(command_encoder, descriptor); + return Impl.commandEncoderBeginRenderPass(command_encoder, descriptor); } pub inline fn clearBuffer(command_encoder: CommandEncoder, buffer: Buffer, offset: u64, size: u64) void { - impl.commandEncoderClearBuffer(command_encoder, buffer, offset, size); + Impl.commandEncoderClearBuffer(command_encoder, buffer, offset, size); } pub inline fn copyBufferToBuffer(command_encoder: CommandEncoder, source: Buffer, source_offset: u64, destination: Buffer, destination_offset: u64, size: u64) void { - impl.commandEncoderCopyBufferToBuffer(command_encoder, source, source_offset, destination, destination_offset, size); + Impl.commandEncoderCopyBufferToBuffer(command_encoder, source, source_offset, destination, destination_offset, size); } pub inline fn copyBufferToTexture(command_encoder: CommandEncoder, source: *const ImageCopyBuffer, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void { - impl.commandEncoderCopyBufferToTexture(command_encoder, source, destination, copy_size); + Impl.commandEncoderCopyBufferToTexture(command_encoder, source, destination, copy_size); } pub inline fn copyTextureToBuffer(command_encoder: CommandEncoder, source: *const ImageCopyTexture, destination: *const ImageCopyBuffer, copy_size: *const Extent3D) void { - impl.commandEncoderCopyTextureToBuffer(command_encoder, source, destination, copy_size); + Impl.commandEncoderCopyTextureToBuffer(command_encoder, source, destination, copy_size); } pub inline fn copyTextureToTexture(command_encoder: CommandEncoder, source: *const ImageCopyTexture, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void { - impl.commandEncoderCopyTextureToTexture(command_encoder, source, destination, copy_size); + Impl.commandEncoderCopyTextureToTexture(command_encoder, source, destination, copy_size); } // Note: the only difference between this and the non-internal variant is that this one checks // internal usage. pub inline fn copyTextureToTextureInternal(command_encoder: CommandEncoder, source: *const ImageCopyTexture, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void { - impl.commandEncoderCopyTextureToTextureInternal(command_encoder, source, destination, copy_size); + Impl.commandEncoderCopyTextureToTextureInternal(command_encoder, source, destination, copy_size); } pub inline fn finish(command_encoder: CommandEncoder, descriptor: ?*const CommandBufferDescriptor) CommandBuffer { - return impl.commandEncoderFinish(command_encoder, descriptor); + return Impl.commandEncoderFinish(command_encoder, descriptor); } pub inline fn injectValidationError(command_encoder: CommandEncoder, message: [*:0]const u8) void { - impl.commandEncoderInjectValidationError(command_encoder, message); + Impl.commandEncoderInjectValidationError(command_encoder, message); } pub inline fn insertDebugMarker(command_encoder: CommandEncoder, marker_label: [*:0]const u8) void { - impl.commandEncoderInsertDebugMarker(command_encoder, marker_label); + Impl.commandEncoderInsertDebugMarker(command_encoder, marker_label); } pub inline fn popDebugGroup(command_encoder: CommandEncoder) void { - impl.commandEncoderPopDebugGroup(command_encoder); + Impl.commandEncoderPopDebugGroup(command_encoder); } pub inline fn pushDebugGroup(command_encoder: CommandEncoder, group_label: [*:0]const u8) void { - impl.commandEncoderPushDebugGroup(command_encoder, group_label); + Impl.commandEncoderPushDebugGroup(command_encoder, group_label); } pub inline fn resolveQuerySet(command_encoder: CommandEncoder, query_set: QuerySet, first_query: u32, query_count: u32, destination: Buffer, destination_offset: u64) void { - impl.commandEncoderResolveQuerySet(command_encoder, query_set, first_query, query_count, destination, destination_offset); + Impl.commandEncoderResolveQuerySet(command_encoder, query_set, first_query, query_count, destination, destination_offset); } pub inline fn setLabel(command_encoder: CommandEncoder, label: [*:0]const u8) void { - impl.commandEncoderSetLabel(command_encoder, label); + Impl.commandEncoderSetLabel(command_encoder, label); } pub inline fn writeBuffer(command_encoder: CommandEncoder, buffer: Buffer, buffer_offset: u64, data: [*]const u8, size: u64) void { - impl.commandEncoderWriteBuffer(command_encoder, buffer, buffer_offset, data, size); + Impl.commandEncoderWriteBuffer(command_encoder, buffer, buffer_offset, data, size); } pub inline fn writeTimestamp(command_encoder: CommandEncoder, query_set: QuerySet, query_index: u32) void { - impl.commandEncoderWriteTimestamp(command_encoder, query_set, query_index); + Impl.commandEncoderWriteTimestamp(command_encoder, query_set, query_index); } pub inline fn reference(command_encoder: CommandEncoder) void { - impl.commandEncoderReference(command_encoder); + Impl.commandEncoderReference(command_encoder); } pub inline fn release(command_encoder: CommandEncoder) void { - impl.commandEncoderRelease(command_encoder); + Impl.commandEncoderRelease(command_encoder); } }; diff --git a/gpu/src/compute_pass_encoder.zig b/gpu/src/compute_pass_encoder.zig index b2a17421..c6569503 100644 --- a/gpu/src/compute_pass_encoder.zig +++ b/gpu/src/compute_pass_encoder.zig @@ -1,66 +1,66 @@ const Buffer = @import("buffer.zig").Buffer; const BindGroup = @import("bind_group.zig").BindGroup; const ComputePipeline = @import("compute_pipeline.zig").ComputePipeline; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const ComputePassEncoder = *opaque { pub inline fn dispatch(compute_pass_encoder: ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) void { - impl.computePassEncoderDispatch(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); + Impl.computePassEncoderDispatch(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); } pub inline fn dispatchIndirect(compute_pass_encoder: ComputePassEncoder, indirect_buffer: Buffer, indirect_offset: u64) void { - impl.computePassEncoderDispatchIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); + Impl.computePassEncoderDispatchIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); } pub inline fn dispatchWorkgroups(compute_pass_encoder: ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) void { - impl.computePassEncoderDispatchWorkgroups(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); + Impl.computePassEncoderDispatchWorkgroups(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); } pub inline fn dispatchWorkgroupsIndirect(compute_pass_encoder: ComputePassEncoder, indirect_buffer: Buffer, indirect_offset: u64) void { - impl.computePassEncoderDispatchWorkgroupsIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); + Impl.computePassEncoderDispatchWorkgroupsIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); } pub inline fn end(compute_pass_encoder: ComputePassEncoder) void { - impl.computePassEncoderEnd(compute_pass_encoder); + Impl.computePassEncoderEnd(compute_pass_encoder); } pub inline fn endPass(compute_pass_encoder: ComputePassEncoder) void { - impl.computePassEncoderEndPass(compute_pass_encoder); + Impl.computePassEncoderEndPass(compute_pass_encoder); } pub inline fn insertDebugMarker(compute_pass_encoder: ComputePassEncoder, marker_label: [*:0]const u8) void { - impl.computePassEncoderInsertDebugMarker(compute_pass_encoder, marker_label); + Impl.computePassEncoderInsertDebugMarker(compute_pass_encoder, marker_label); } pub inline fn popDebugGroup(compute_pass_encoder: ComputePassEncoder) void { - impl.computePassEncoderPopDebugGroup(compute_pass_encoder); + Impl.computePassEncoderPopDebugGroup(compute_pass_encoder); } pub inline fn pushDebugGroup(compute_pass_encoder: ComputePassEncoder, group_label: [*:0]const u8) void { - impl.computePassEncoderPushDebugGroup(compute_pass_encoder, group_label); + Impl.computePassEncoderPushDebugGroup(compute_pass_encoder, group_label); } pub inline fn setBindGroup(compute_pass_encoder: ComputePassEncoder, group_index: u32, group: BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) void { - impl.computePassEncoderSetBindGroup(compute_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); + Impl.computePassEncoderSetBindGroup(compute_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); } pub inline fn setLabel(compute_pass_encoder: ComputePassEncoder, label: [*:0]const u8) void { - impl.computePassEncoderSetLabel(compute_pass_encoder, label); + Impl.computePassEncoderSetLabel(compute_pass_encoder, label); } pub inline fn setPipeline(compute_pass_encoder: ComputePassEncoder, pipeline: ComputePipeline) void { - impl.computePassEncoderSetPipeline(compute_pass_encoder, pipeline); + Impl.computePassEncoderSetPipeline(compute_pass_encoder, pipeline); } pub inline fn writeTimestamp(compute_pass_encoder: ComputePassEncoder, pipeline: ComputePipeline) void { - impl.computePassEncoderWriteTimestamp(compute_pass_encoder, pipeline); + Impl.computePassEncoderWriteTimestamp(compute_pass_encoder, pipeline); } pub inline fn reference(compute_pass_encoder: ComputePassEncoder) void { - impl.computePassEncoderReference(compute_pass_encoder); + Impl.computePassEncoderReference(compute_pass_encoder); } pub inline fn release(compute_pass_encoder: ComputePassEncoder) void { - impl.computePassEncoderRelease(compute_pass_encoder); + Impl.computePassEncoderRelease(compute_pass_encoder); } }; diff --git a/gpu/src/compute_pipeline.zig b/gpu/src/compute_pipeline.zig index e684bfd2..b5e47033 100644 --- a/gpu/src/compute_pipeline.zig +++ b/gpu/src/compute_pipeline.zig @@ -2,23 +2,23 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const ProgrammableStageDescriptor = @import("types.zig").ProgrammableStageDescriptor; const PipelineLayout = @import("pipeline_layout.zig").PipelineLayout; const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const ComputePipeline = *opaque { pub inline fn getBindGroupLayout(compute_pipeline: ComputePipeline, group_index: u32) BindGroupLayout { - return impl.computePipelineGetBindGroupLayout(compute_pipeline, group_index); + return Impl.computePipelineGetBindGroupLayout(compute_pipeline, group_index); } pub inline fn setLabel(compute_pipeline: ComputePipeline, label: [*:0]const u8) void { - impl.computePipelineSetLabel(compute_pipeline, label); + Impl.computePipelineSetLabel(compute_pipeline, label); } pub inline fn reference(compute_pipeline: ComputePipeline) void { - impl.computePipelineReference(compute_pipeline); + Impl.computePipelineReference(compute_pipeline); } pub inline fn release(compute_pipeline: ComputePipeline) void { - impl.computePipelineRelease(compute_pipeline); + Impl.computePipelineRelease(compute_pipeline); } }; diff --git a/gpu/src/device.zig b/gpu/src/device.zig index 5d83cdcb..e818c0eb 100644 --- a/gpu/src/device.zig +++ b/gpu/src/device.zig @@ -39,143 +39,143 @@ const ErrorCallback = @import("types.zig").ErrorCallback; const LoggingCallback = @import("types.zig").LoggingCallback; const CreateComputePipelineAsyncCallback = @import("types.zig").CreateComputePipelineAsyncCallback; const CreateRenderPipelineAsyncCallback = @import("types.zig").CreateRenderPipelineAsyncCallback; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Device = *opaque { pub inline fn createBindGroup(device: Device, descriptor: *const BindGroupDescriptor) BindGroup { - return impl.deviceCreateBindGroup(device, descriptor); + return Impl.deviceCreateBindGroup(device, descriptor); } pub inline fn createBindGroupLayout(device: Device, descriptor: *const BindGroupLayoutDescriptor) BindGroupLayout { - return impl.deviceCreateBindGroupLayout(device, descriptor); + return Impl.deviceCreateBindGroupLayout(device, descriptor); } pub inline fn createBuffer(device: Device, descriptor: *const BufferDescriptor) Buffer { - return impl.deviceCreateBuffer(device, descriptor); + return Impl.deviceCreateBuffer(device, descriptor); } pub inline fn createCommandEncoder(device: Device, descriptor: ?*const CommandEncoderDescriptor) CommandEncoder { - return impl.deviceCreateCommandEncoder(device, descriptor); + return Impl.deviceCreateCommandEncoder(device, descriptor); } pub inline fn createComputePipeline(device: Device, descriptor: *const ComputePipelineDescriptor) ComputePipeline { - return impl.deviceCreateComputePipeline(device, descriptor); + return Impl.deviceCreateComputePipeline(device, descriptor); } pub inline fn createComputePipelineAsync(device: Device, descriptor: *const ComputePipelineDescriptor, callback: CreateComputePipelineAsyncCallback, userdata: *anyopaque) void { - impl.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata); + Impl.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata); } pub inline fn createErrorBuffer(device: Device) Buffer { - return impl.deviceCreateErrorBuffer(device); + return Impl.deviceCreateErrorBuffer(device); } pub inline fn createErrorExternalTexture(device: Device) ExternalTexture { - return impl.deviceCreateErrorExternalTexture(device); + return Impl.deviceCreateErrorExternalTexture(device); } pub inline fn createExternalTexture(device: Device, external_texture_descriptor: *const ExternalTextureDescriptor) ExternalTexture { - return impl.deviceCreateExternalTexture(device, external_texture_descriptor); + return Impl.deviceCreateExternalTexture(device, external_texture_descriptor); } pub inline fn createPipelineLayout(device: Device, pipeline_layout_descriptor: *const PipelineLayoutDescriptor) PipelineLayout { - return impl.deviceCreatePipelineLayout(device, pipeline_layout_descriptor); + return Impl.deviceCreatePipelineLayout(device, pipeline_layout_descriptor); } pub inline fn createQuerySet(device: Device, descriptor: *const QuerySetDescriptor) QuerySet { - return impl.deviceCreateQuerySet(device, descriptor); + return Impl.deviceCreateQuerySet(device, descriptor); } pub inline fn createRenderBundleEncoder(device: Device, descriptor: *const RenderBundleEncoderDescriptor) RenderBundleEncoder { - return impl.deviceCreateRenderBundleEncoder(device, descriptor); + return Impl.deviceCreateRenderBundleEncoder(device, descriptor); } pub inline fn createRenderPipeline(device: Device, descriptor: *const RenderPipelineDescriptor) RenderPipeline { - return impl.deviceCreateRenderPipeline(device, descriptor); + return Impl.deviceCreateRenderPipeline(device, descriptor); } pub inline fn createRenderPipelineAsync(device: Device, descriptor: *const RenderPipelineDescriptor, callback: CreateRenderPipelineAsyncCallback, userdata: *anyopaque) void { - impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata); + Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata); } pub inline fn createSampler(device: Device, descriptor: ?*const SamplerDescriptor) Sampler { - return impl.deviceCreateSampler(device, descriptor); + return Impl.deviceCreateSampler(device, descriptor); } pub inline fn createShaderModule(device: Device, descriptor: *const ShaderModuleDescriptor) ShaderModule { - return impl.deviceCreateShaderModule(device, descriptor); + return Impl.deviceCreateShaderModule(device, descriptor); } pub inline fn createSwapChain(device: Device, surface: ?Surface, descriptor: *const SwapChainDescriptor) SwapChain { - return impl.deviceCreateSwapChain(device, surface, descriptor); + return Impl.deviceCreateSwapChain(device, surface, descriptor); } pub inline fn createTexture(device: Device, descriptor: *const TextureDescriptor) Texture { - return impl.deviceCreateTexture(device, descriptor); + return Impl.deviceCreateTexture(device, descriptor); } pub inline fn destroy(device: Device) void { - impl.deviceDestroy(device); + Impl.deviceDestroy(device); } pub inline fn enumerateFeatures(device: Device, features: [*]FeatureName) usize { - return impl.deviceEnumerateFeatures(device, features); + return Impl.deviceEnumerateFeatures(device, features); } pub inline fn getLimits(device: Device, limits: *SupportedLimits) bool { - return impl.deviceGetLimits(device, limits); + return Impl.deviceGetLimits(device, limits); } pub inline fn getQueue(device: Device) Queue { - return impl.deviceGetQueue(device); + return Impl.deviceGetQueue(device); } pub inline fn hasFeature(device: Device, feature: FeatureName) bool { - return impl.deviceHasFeature(device, feature); + return Impl.deviceHasFeature(device, feature); } pub inline fn injectError(device: Device, typ: ErrorType, message: [*:0]const u8) void { - impl.deviceInjectError(device, typ, message); + Impl.deviceInjectError(device, typ, message); } pub inline fn loseForTesting(device: Device) void { - impl.deviceLoseForTesting(device); + Impl.deviceLoseForTesting(device); } pub inline fn popErrorScope(device: Device, callback: ErrorCallback, userdata: *anyopaque) bool { - return impl.devicePopErrorScope(device, callback, userdata); + return Impl.devicePopErrorScope(device, callback, userdata); } pub inline fn pushErrorScope(device: Device, filter: ErrorFilter) void { - impl.devicePushErrorScope(device, filter); + Impl.devicePushErrorScope(device, filter); } pub inline fn setDeviceLostCallback(device: Device, callback: DeviceLostCallback, userdata: *anyopaque) void { - impl.deviceSetDeviceLostCallback(device, callback, userdata); + Impl.deviceSetDeviceLostCallback(device, callback, userdata); } pub inline fn setLabel(device: Device, label: [*:0]const u8) void { - impl.deviceSetLabel(device, label); + Impl.deviceSetLabel(device, label); } pub inline fn setLoggingCallback(device: Device, callback: LoggingCallback, userdata: *anyopaque) void { - impl.deviceSetLoggingCallback(device, callback, userdata); + Impl.deviceSetLoggingCallback(device, callback, userdata); } pub inline fn setUncapturedErrorCallback(device: Device, callback: ErrorCallback, userdata: *anyopaque) void { - impl.deviceSetUncapturedErrorCallback(device, callback, userdata); + Impl.deviceSetUncapturedErrorCallback(device, callback, userdata); } pub inline fn tick(device: Device) void { - impl.deviceTick(device); + Impl.deviceTick(device); } pub inline fn reference(device: Device) void { - impl.deviceReference(device); + Impl.deviceReference(device); } pub inline fn release(device: Device) void { - impl.deviceRelease(device); + Impl.deviceRelease(device); } }; diff --git a/gpu/src/external_texture.zig b/gpu/src/external_texture.zig index 6a075992..c24bd170 100644 --- a/gpu/src/external_texture.zig +++ b/gpu/src/external_texture.zig @@ -1,22 +1,22 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const TextureView = @import("texture_view.zig").TextureView; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const ExternalTexture = *opaque { pub inline fn destroy(external_texture: ExternalTexture) void { - impl.externalTextureDestroy(external_texture); + Impl.externalTextureDestroy(external_texture); } pub inline fn setLabel(external_texture: ExternalTexture, label: [*:0]const u8) void { - impl.externalTextureSetLabel(external_texture, label); + Impl.externalTextureSetLabel(external_texture, label); } pub inline fn reference(external_texture: ExternalTexture) void { - impl.externalTextureReference(external_texture); + Impl.externalTextureReference(external_texture); } pub inline fn release(external_texture: ExternalTexture) void { - impl.externalTextureRelease(external_texture); + Impl.externalTextureRelease(external_texture); } }; diff --git a/gpu/src/instance.zig b/gpu/src/instance.zig index 1276d70f..93e932c0 100644 --- a/gpu/src/instance.zig +++ b/gpu/src/instance.zig @@ -4,23 +4,23 @@ const Surface = @import("surface.zig").Surface; const SurfaceDescriptor = @import("surface.zig").SurfaceDescriptor; const Adapter = @import("adapter.zig").Adapter; const RequestAdapterOptions = @import("main.zig").RequestAdapterOptions; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Instance = *opaque { pub inline fn createSurface(instance: Instance, descriptor: *const SurfaceDescriptor) Surface { - return impl.instanceCreateSurface(instance, descriptor); + return Impl.instanceCreateSurface(instance, descriptor); } pub inline fn requestAdapter(instance: Instance, options: *const RequestAdapterOptions, callback: RequestAdapterCallback, userdata: *anyopaque) void { - impl.instanceRequestAdapter(instance, options, callback, userdata); + Impl.instanceRequestAdapter(instance, options, callback, userdata); } pub inline fn reference(instance: Instance) void { - impl.instanceReference(instance); + Impl.instanceReference(instance); } pub inline fn release(instance: Instance) void { - impl.instanceRelease(instance); + Impl.instanceRelease(instance); } }; diff --git a/gpu/src/interface.zig b/gpu/src/interface.zig index 5cf4db2b..0e22cfb5 100644 --- a/gpu/src/interface.zig +++ b/gpu/src/interface.zig @@ -4,1241 +4,1241 @@ const gpu = @import("main.zig"); /// The gpu.Interface implementation that is used by the entire program. Only one may exist, since /// it is resolved fully at comptime with no vtable indirection, etc. -pub const impl = blk: { +pub const Impl = blk: { if (@import("builtin").is_test) { - break :blk StubInterface{}; + break :blk StubInterface; } else { const root = @import("root"); - if (!@hasField(root, "gpu_interface")) @compileError("expected to find `pub const gpu_interface: gpu.Interface(T) = T{};` in root file"); - _ = gpu.Interface(@TypeOf(root.gpu_interface)); // verify the type - break :blk root.gpu_interface; + if (!@hasField(root, "GPUInterface")) @compileError("expected to find `pub const GPUInterface = T;` in root file"); + _ = gpu.Interface(@TypeOf(root.GPUInterface)); // verify the type + break :blk root.GPUInterface; } }; /// Verifies that a gpu.Interface implementation exposes the expected function declarations. -pub fn Interface(comptime Impl: type) type { - assertDecl(Impl, "createInstance", fn (descriptor: ?*const InstanceDescriptor) callconv(.Inline) ?Instance); - assertDecl(Impl, "getProcAddress", fn (device: gpu.Device, proc_name: [*:0]const u8) callconv(.Inline) ?gpu.Proc); - assertDecl(Impl, "adapterCreateDevice", fn (adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor) callconv(.Inline) ?gpu.Device); - assertDecl(Impl, "adapterEnumerateFeatures", fn (adapter: gpu.Adapter, features: ?[*]gpu.FeatureName) callconv(.Inline) usize); - assertDecl(Impl, "adapterGetLimits", fn (adapter: gpu.Adapter, limits: *gpu.SupportedLimits) callconv(.Inline) bool); - assertDecl(Impl, "adapterGetProperties", fn (adapter: gpu.Adapter, properties: *gpu.AdapterProperties) callconv(.Inline) void); - assertDecl(Impl, "adapterHasFeature", fn (adapter: gpu.Adapter, feature: gpu.FeatureName) callconv(.Inline) bool); - assertDecl(Impl, "adapterRequestDevice", fn (adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "adapterReference", fn (adapter: gpu.Adapter) callconv(.Inline) void); - assertDecl(Impl, "adapterRelease", fn (adapter: gpu.Adapter) callconv(.Inline) void); - assertDecl(Impl, "bindGroupSetLabel", fn (bind_group: gpu.BindGroup, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "bindGroupReference", fn (bind_group: gpu.BindGroup) callconv(.Inline) void); - assertDecl(Impl, "bindGroupRelease", fn (bind_group: gpu.BindGroup) callconv(.Inline) void); - assertDecl(Impl, "bindGroupLayoutSetLabel", fn (bind_group_layout: gpu.BindGroupLayout, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "bindGroupLayoutReference", fn (bind_group_layout: gpu.BindGroupLayout) callconv(.Inline) void); - assertDecl(Impl, "bindGroupLayoutRelease", fn (bind_group_layout: gpu.BindGroupLayout) callconv(.Inline) void); - assertDecl(Impl, "bufferDestroy", fn (buffer: gpu.Buffer) callconv(.Inline) void); - assertDecl(Impl, "bufferGetConstMappedRange", fn (buffer: gpu.Buffer, offset: usize, size: usize) callconv(.Inline) ?*const anyopaque); - assertDecl(Impl, "bufferGetMappedRange", fn (buffer: gpu.Buffer, offset: usize, size: usize) callconv(.Inline) ?*anyopaque); - assertDecl(Impl, "bufferGetSize", fn (buffer: gpu.Buffer) callconv(.Inline) u64); - assertDecl(Impl, "bufferGetUsage", fn (buffer: gpu.Buffer) callconv(.Inline) gpu.BufferUsage); - assertDecl(Impl, "bufferMapAsync", fn (buffer: gpu.Buffer, mode: gpu.MapMode, offset: usize, size: usize, callback: gpu.BufferMapCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "bufferSetLabel", fn (buffer: gpu.Buffer, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "bufferUnmap", fn (buffer: gpu.Buffer) callconv(.Inline) void); - assertDecl(Impl, "bufferReference", fn (buffer: gpu.Buffer) callconv(.Inline) void); - assertDecl(Impl, "bufferRelease", fn (buffer: gpu.Buffer) callconv(.Inline) void); - assertDecl(Impl, "commandBufferSetLabel", fn (command_buffer: gpu.CommandBuffer, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "commandBufferReference", fn (command_buffer: gpu.CommandBuffer) callconv(.Inline) void); - assertDecl(Impl, "commandBufferRelease", fn (command_buffer: gpu.CommandBuffer) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderBeginComputePass", fn (command_encoder: gpu.CommandEncoder, descriptor: ?*const gpu.ComputePassDescriptor) callconv(.Inline) gpu.ComputePassEncoder); - assertDecl(Impl, "commandEncoderBeginRenderPass", fn (command_encoder: gpu.CommandEncoder, descriptor: *const gpu.RenderPassDescriptor) callconv(.Inline) gpu.RenderPassEncoder); - assertDecl(Impl, "commandEncoderClearBuffer", fn (command_encoder: gpu.CommandEncoder, buffer: gpu.Buffer, offset: u64, size: u64) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderCopyBufferToBuffer", fn (command_encoder: gpu.CommandEncoder, source: gpu.Buffer, source_offset: u64, destination: gpu.Buffer, destination_offset: u64, size: u64) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderCopyBufferToTexture", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyBuffer, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderCopyTextureToBuffer", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyBuffer, copy_size: *const gpu.Extent3D) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderCopyTextureToTexture", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderCopyTextureToTextureInternal", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderFinish", fn (command_encoder: gpu.CommandEncoder, descriptor: ?*const gpu.CommandBufferDescriptor) callconv(.Inline) gpu.CommandBuffer); - assertDecl(Impl, "commandEncoderInjectValidationError", fn (command_encoder: gpu.CommandEncoder, message: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderInsertDebugMarker", fn (command_encoder: gpu.CommandEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderPopDebugGroup", fn (command_encoder: gpu.CommandEncoder) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderPushDebugGroup", fn (command_encoder: gpu.CommandEncoder, group_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderResolveQuerySet", fn (command_encoder: gpu.CommandEncoder, query_set: gpu.QuerySet, first_query: u32, query_count: u32, destination: gpu.Buffer, destination_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderSetLabel", fn (command_encoder: gpu.CommandEncoder, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderWriteBuffer", fn (command_encoder: gpu.CommandEncoder, buffer: gpu.Buffer, buffer_offset: u64, data: [*]const u8, size: u64) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderWriteTimestamp", fn (command_encoder: gpu.CommandEncoder, query_set: gpu.QuerySet, query_index: u32) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderReference", fn (command_encoder: gpu.CommandEncoder) callconv(.Inline) void); - assertDecl(Impl, "commandEncoderRelease", fn (command_encoder: gpu.CommandEncoder) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderDispatch", fn (compute_pass_encoder: gpu.ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderDispatchIndirect", fn (compute_pass_encoder: gpu.ComputePassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderDispatchWorkgroups", fn (compute_pass_encoder: gpu.ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderDispatchWorkgroupsIndirect", fn (compute_pass_encoder: gpu.ComputePassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderEnd", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderEndPass", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderInsertDebugMarker", fn (compute_pass_encoder: gpu.ComputePassEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderPopDebugGroup", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderPushDebugGroup", fn (compute_pass_encoder: gpu.ComputePassEncoder, group_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderSetBindGroup", fn (compute_pass_encoder: gpu.ComputePassEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderSetLabel", fn (compute_pass_encoder: gpu.ComputePassEncoder, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderSetPipeline", fn (compute_pass_encoder: gpu.ComputePassEncoder, pipeline: gpu.ComputePipeline) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderWriteTimestamp", fn (compute_pass_encoder: gpu.ComputePassEncoder, pipeline: gpu.ComputePipeline) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderReference", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); - assertDecl(Impl, "computePassEncoderRelease", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); - assertDecl(Impl, "computePipelineGetBindGroupLayout", fn (compute_pipeline: gpu.ComputePipeline, group_index: u32) callconv(.Inline) gpu.BindGroupLayout); - assertDecl(Impl, "computePipelineSetLabel", fn (compute_pipeline: gpu.ComputePipeline, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "computePipelineReference", fn (compute_pipeline: gpu.ComputePipeline) callconv(.Inline) void); - assertDecl(Impl, "computePipelineRelease", fn (compute_pipeline: gpu.ComputePipeline) callconv(.Inline) void); - assertDecl(Impl, "deviceCreateBindGroup", fn (device: gpu.Device, descriptor: *const gpu.BindGroupDescriptor) callconv(.Inline) gpu.BindGroup); - assertDecl(Impl, "deviceCreateBindGroupLayout", fn (device: gpu.Device, descriptor: *const gpu.BindGroupLayoutDescriptor) callconv(.Inline) gpu.BindGroupLayout); - assertDecl(Impl, "deviceCreateBuffer", fn (device: gpu.Device, descriptor: *const gpu.BufferDescriptor) callconv(.Inline) gpu.Buffer); - assertDecl(Impl, "deviceCreateCommandEncoder", fn (device: gpu.Device, descriptor: ?*const gpu.CommandEncoderDescriptor) callconv(.Inline) gpu.CommandEncoder); - assertDecl(Impl, "deviceCreateComputePipeline", fn (device: gpu.Device, descriptor: *const gpu.ComputePipelineDescriptor) callconv(.Inline) gpu.ComputePipeline); - assertDecl(Impl, "deviceCreateComputePipelineAsync", fn (device: gpu.Device, descriptor: *const gpu.ComputePipelineDescriptor, callback: gpu.CreateComputePipelineAsyncCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "deviceCreateErrorBuffer", fn (device: gpu.Device) callconv(.Inline) gpu.Buffer); - assertDecl(Impl, "deviceCreateErrorExternalTexture", fn (device: gpu.Device) callconv(.Inline) gpu.ExternalTexture); - assertDecl(Impl, "deviceCreateExternalTexture", fn (device: gpu.Device, external_texture_descriptor: *const gpu.ExternalTextureDescriptor) callconv(.Inline) gpu.ExternalTexture); - assertDecl(Impl, "deviceCreatePipelineLayout", fn (device: gpu.Device, pipeline_layout_descriptor: *const gpu.PipelineLayoutDescriptor) callconv(.Inline) gpu.PipelineLayout); - assertDecl(Impl, "deviceCreateQuerySet", fn (device: gpu.Device, descriptor: *const gpu.QuerySetDescriptor) callconv(.Inline) gpu.QuerySet); - assertDecl(Impl, "deviceCreateRenderBundleEncoder", fn (device: gpu.Device, descriptor: *const gpu.RenderBundleEncoderDescriptor) callconv(.Inline) gpu.RenderBundleEncoder); - assertDecl(Impl, "deviceCreateRenderPipeline", fn (device: gpu.Device, descriptor: *const gpu.RenderPipelineDescriptor) callconv(.Inline) gpu.RenderPipeline); - assertDecl(Impl, "deviceCreateRenderPipelineAsync", fn (device: gpu.Device, descriptor: *const gpu.RenderPipelineDescriptor, callback: gpu.CreateRenderPipelineAsyncCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "deviceCreateSampler", fn (device: gpu.Device, descriptor: ?*const gpu.SamplerDescriptor) callconv(.Inline) gpu.Sampler); - assertDecl(Impl, "deviceCreateShaderModule", fn (device: gpu.Device, descriptor: *const gpu.ShaderModuleDescriptor) callconv(.Inline) gpu.ShaderModule); - assertDecl(Impl, "deviceCreateSwapChain", fn (device: gpu.Device, surface: ?gpu.Surface, descriptor: *const gpu.SwapChainDescriptor) callconv(.Inline) gpu.SwapChain); - assertDecl(Impl, "deviceCreateTexture", fn (device: gpu.Device, descriptor: *const gpu.TextureDescriptor) callconv(.Inline) gpu.Texture); - assertDecl(Impl, "deviceDestroy", fn (device: gpu.Device) callconv(.Inline) void); - assertDecl(Impl, "deviceEnumerateFeatures", fn (device: gpu.Device, features: [*]gpu.FeatureName) callconv(.Inline) usize); - assertDecl(Impl, "deviceGetLimits", fn (device: gpu.Device, limits: *gpu.SupportedLimits) callconv(.Inline) bool); - assertDecl(Impl, "deviceGetQueue", fn (device: gpu.Device) callconv(.Inline) gpu.Queue); - assertDecl(Impl, "deviceHasFeature", fn (device: gpu.Device, feature: gpu.FeatureName) callconv(.Inline) bool); - assertDecl(Impl, "deviceInjectError", fn (device: gpu.Device, typ: gpu.ErrorType, message: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "deviceLoseForTesting", fn (device: gpu.Device) callconv(.Inline) void); - assertDecl(Impl, "devicePopErrorScope", fn (device: gpu.Device, callback: gpu.ErrorCallback, userdata: *anyopaque) callconv(.Inline) bool); - assertDecl(Impl, "devicePushErrorScope", fn (device: gpu.Device, filter: gpu.ErrorFilter) callconv(.Inline) void); - assertDecl(Impl, "deviceSetDeviceLostCallback", fn (device: gpu.Device, callback: gpu.DeviceLostCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "deviceSetLabel", fn (device: gpu.Device, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "deviceSetLoggingCallback", fn (device: gpu.Device, callback: gpu.LoggingCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "deviceSetUncapturedErrorCallback", fn (device: gpu.Device, callback: gpu.ErrorCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "deviceTick", fn (device: gpu.Device) callconv(.Inline) void); - assertDecl(Impl, "deviceReference", fn (device: gpu.Device) callconv(.Inline) void); - assertDecl(Impl, "deviceRelease", fn (device: gpu.Device) callconv(.Inline) void); - assertDecl(Impl, "externalTextureDestroy", fn (external_texture: gpu.ExternalTexture) callconv(.Inline) void); - assertDecl(Impl, "externalTextureSetLabel", fn (external_texture: gpu.ExternalTexture, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "externalTextureReference", fn (external_texture: gpu.ExternalTexture) callconv(.Inline) void); - assertDecl(Impl, "externalTextureRelease", fn (external_texture: gpu.ExternalTexture) callconv(.Inline) void); - assertDecl(Impl, "instanceCreateSurface", fn (instance: gpu.Instance, descriptor: *const gpu.SurfaceDescriptor) callconv(.Inline) gpu.Surface); - assertDecl(Impl, "instanceRequestAdapter", fn (instance: gpu.Instance, options: *const gpu.RequestAdapterOptions, callback: gpu.RequestAdapterCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "instanceReference", fn (instance: gpu.Instance) callconv(.Inline) void); - assertDecl(Impl, "instanceRelease", fn (instance: gpu.Instance) callconv(.Inline) void); - assertDecl(Impl, "pipelineLayoutSetLabel", fn (pipeline_layout: gpu.PipelineLayout, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "pipelineLayoutReference", fn (pipeline_layout: gpu.PipelineLayout) callconv(.Inline) void); - assertDecl(Impl, "pipelineLayoutRelease", fn (pipeline_layout: gpu.PipelineLayout) callconv(.Inline) void); - assertDecl(Impl, "querySetDestroy", fn (query_set: gpu.QuerySet) callconv(.Inline) void); - assertDecl(Impl, "querySetGetCount", fn (query_set: gpu.QuerySet) callconv(.Inline) u32); - assertDecl(Impl, "querySetGetType", fn (query_set: gpu.QuerySet) callconv(.Inline) gpu.QueryType); - assertDecl(Impl, "querySetSetLabel", fn (query_set: gpu.QuerySet, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "querySetReference", fn (query_set: gpu.QuerySet) callconv(.Inline) void); - assertDecl(Impl, "querySetRelease", fn (query_set: gpu.QuerySet) callconv(.Inline) void); - assertDecl(Impl, "queueCopyTextureForBrowser", fn (queue: gpu.Queue, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D, options: *const gpu.CopyTextureForBrowserOptions) callconv(.Inline) void); - assertDecl(Impl, "queueOnSubmittedWorkDone", fn (queue: gpu.Queue, signal_value: u64, callback: gpu.QueueWorkDoneCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "queueSetLabel", fn (queue: gpu.Queue, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "queueSubmit", fn (queue: gpu.Queue, command_count: u32, commands: [*]gpu.CommandBuffer) callconv(.Inline) void); - assertDecl(Impl, "queueWriteBuffer", fn (queue: gpu.Queue, buffer: gpu.Buffer, buffer_offset: u64, data: *anyopaque, size: usize) callconv(.Inline) void); - assertDecl(Impl, "queueWriteTexture", fn (queue: gpu.Queue, data: *anyopaque, data_size: usize, data_layout: *const gpu.TextureDataLayout, write_size: *const gpu.Extent3D) callconv(.Inline) void); - assertDecl(Impl, "queueReference", fn (queue: gpu.Queue) callconv(.Inline) void); - assertDecl(Impl, "queueRelease", fn (queue: gpu.Queue) callconv(.Inline) void); - assertDecl(Impl, "renderBundleReference", fn (render_bundle: gpu.RenderBundle) callconv(.Inline) void); - assertDecl(Impl, "renderBundleRelease", fn (render_bundle: gpu.RenderBundle) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderDraw", fn (render_bundle_encoder: gpu.RenderBundleEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderDrawIndexed", fn (render_bundle_encoder: gpu.RenderBundleEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderDrawIndexedIndirect", fn (render_bundle_encoder: gpu.RenderBundleEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderDrawIndirect", fn (render_bundle_encoder: gpu.RenderBundleEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderFinish", fn (render_bundle_encoder: gpu.RenderBundleEncoder, descriptor: ?*const gpu.RenderBundleDescriptor) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderInsertDebugMarker", fn (render_bundle_encoder: gpu.RenderBundleEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderPopDebugGroup", fn (render_bundle_encoder: gpu.RenderBundleEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderPushDebugGroup", fn (render_bundle_encoder: gpu.RenderBundleEncoder, group_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderSetBindGroup", fn (render_bundle_encoder: gpu.RenderBundleEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderSetIndexBuffer", fn (render_bundle_encoder: gpu.RenderBundleEncoder, buffer: gpu.Buffer, format: gpu.IndexFormat, offset: u64, size: u64) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderSetLabel", fn (render_bundle_encoder: gpu.RenderBundleEncoder, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderSetPipeline", fn (render_bundle_encoder: gpu.RenderBundleEncoder, pipeline: gpu.RenderPipeline) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderSetVertexBuffer", fn (render_bundle_encoder: gpu.RenderBundleEncoder, slot: u32, buffer: gpu.Buffer, offset: u64, size: u64) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderReference", fn (render_bundle_encoder: gpu.RenderBundleEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderBundleEncoderRelease", fn (render_bundle_encoder: gpu.RenderBundleEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderBeginOcclusionQuery", fn (render_pass_encoder: gpu.RenderPassEncoder, query_index: u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderDraw", fn (render_pass_encoder: gpu.RenderPassEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderDrawIndexed", fn (render_pass_encoder: gpu.RenderPassEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderDrawIndexedIndirect", fn (render_pass_encoder: gpu.RenderPassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderDrawIndirect", fn (render_pass_encoder: gpu.RenderPassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderEnd", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderEndOcclusionQuery", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderEndPass", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderExecuteBundles", fn (render_pass_encoder: gpu.RenderPassEncoder, bundles_count: u32, bundles: [*]const gpu.RenderBundle) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderInsertDebugMarker", fn (render_pass_encoder: gpu.RenderPassEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderPopDebugGroup", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderPushDebugGroup", fn (render_pass_encoder: gpu.RenderPassEncoder, group_label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetBindGroup", fn (render_pass_encoder: gpu.RenderPassEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetBlendConstant", fn (render_pass_encoder: gpu.RenderPassEncoder, color: *const gpu.Color) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetIndexBuffer", fn (render_pass_encoder: gpu.RenderPassEncoder, buffer: gpu.Buffer, format: gpu.IndexFormat, offset: u64, size: u64) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetLabel", fn (render_pass_encoder: gpu.RenderPassEncoder, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetPipeline", fn (render_pass_encoder: gpu.RenderPassEncoder, pipeline: gpu.RenderPipeline) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetScissorRect", fn (render_pass_encoder: gpu.RenderPassEncoder, x: u32, y: u32, width: u32, height: u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetStencilReference", fn (render_pass_encoder: gpu.RenderPassEncoder, reference: u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetVertexBuffer", fn (render_pass_encoder: gpu.RenderPassEncoder, slot: u32, buffer: gpu.Buffer, offset: u64, size: u64) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderSetViewport", fn (render_pass_encoder: gpu.RenderPassEncoder, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderWriteTimestamp", fn (render_pass_encoder: gpu.RenderPassEncoder, query_set: gpu.QuerySet, query_index: u32) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderReference", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPassEncoderRelease", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); - assertDecl(Impl, "renderPipelineGetBindGroupLayout", fn (render_pipeline: gpu.RenderPipeline, group_index: u32) callconv(.Inline) gpu.BindGroupLayout); - assertDecl(Impl, "renderPipelineSetLabel", fn (render_pipeline: gpu.RenderPipeline, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "renderPipelineReference", fn (render_pipeline: gpu.RenderPipeline) callconv(.Inline) void); - assertDecl(Impl, "renderPipelineRelease", fn (render_pipeline: gpu.RenderPipeline) callconv(.Inline) void); - assertDecl(Impl, "samplerSetLabel", fn (sampler: gpu.Sampler, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "samplerReference", fn (sampler: gpu.Sampler) callconv(.Inline) void); - assertDecl(Impl, "samplerRelease", fn (sampler: gpu.Sampler) callconv(.Inline) void); - assertDecl(Impl, "shaderModuleGetCompilationInfo", fn (shader_module: gpu.ShaderModule, callback: gpu.CompilationInfoCallback, userdata: *anyopaque) callconv(.Inline) void); - assertDecl(Impl, "shaderModuleSetLabel", fn (shader_module: gpu.ShaderModule, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "shaderModuleReference", fn (shader_module: gpu.ShaderModule) callconv(.Inline) void); - assertDecl(Impl, "shaderModuleRelease", fn (shader_module: gpu.ShaderModule) callconv(.Inline) void); - assertDecl(Impl, "surfaceReference", fn (surface: gpu.Surface) callconv(.Inline) void); - assertDecl(Impl, "surfaceRelease", fn (surface: gpu.Surface) callconv(.Inline) void); - assertDecl(Impl, "swapChainConfigure", fn (swap_chain: gpu.SwapChain, format: gpu.TextureFormat, allowed_usage: gpu.TextureUsageFlags, width: u32, height: u32) callconv(.Inline) void); - assertDecl(Impl, "swapChainGetCurrentTextureView", fn (swap_chain: gpu.SwapChain) callconv(.Inline) gpu.TextureView); - assertDecl(Impl, "swapChainPresent", fn (swap_chain: gpu.SwapChain) callconv(.Inline) void); - assertDecl(Impl, "swapChainReference", fn (swap_chain: gpu.SwapChain) callconv(.Inline) void); - assertDecl(Impl, "swapChainRelease", fn (swap_chain: gpu.SwapChain) callconv(.Inline) void); - assertDecl(Impl, "textureCreateView", fn (texture: gpu.Texture, descriptor: ?*const gpu.TextureViewDescriptor) callconv(.Inline) gpu.TextureView); - assertDecl(Impl, "textureDestroy", fn (texture: gpu.Texture) callconv(.Inline) void); - assertDecl(Impl, "textureGetDepthOrArrayLayers", fn (texture: gpu.Texture) callconv(.Inline) u32); - assertDecl(Impl, "textureGetDimension", fn (texture: gpu.Texture) callconv(.Inline) gpu.TextureDimension); - assertDecl(Impl, "textureGetFormat", fn (texture: gpu.Texture) callconv(.Inline) gpu.TextureFormat); - assertDecl(Impl, "textureGetHeight", fn (texture: gpu.Texture) callconv(.Inline) u32); - assertDecl(Impl, "textureGetMipLevelCount", fn (texture: gpu.Texture) callconv(.Inline) u32); - assertDecl(Impl, "textureGetSampleCount", fn (texture: gpu.Texture) callconv(.Inline) u32); - assertDecl(Impl, "textureGetUsage", fn (texture: gpu.Texture) callconv(.Inline) gpu.TextureUsageFlags); - assertDecl(Impl, "textureGetWidth", fn (texture: gpu.Texture) callconv(.Inline) u32); - assertDecl(Impl, "textureSetLabel", fn (texture: gpu.Texture, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "textureReference", fn (texture: gpu.Texture) callconv(.Inline) void); - assertDecl(Impl, "textureRelease", fn (texture: gpu.Texture) callconv(.Inline) void); - assertDecl(Impl, "textureViewSetLabel", fn (texture_view: gpu.TextureView, label: [*:0]const u8) callconv(.Inline) void); - assertDecl(Impl, "textureViewReference", fn (texture_view: gpu.TextureView) callconv(.Inline) void); - assertDecl(Impl, "textureViewRelease", fn (texture_view: gpu.TextureView) callconv(.Inline) void); - return Impl; +pub fn Interface(comptime T: type) type { + assertDecl(T, "createInstance", fn (descriptor: ?*const InstanceDescriptor) callconv(.Inline) ?Instance); + assertDecl(T, "getProcAddress", fn (device: gpu.Device, proc_name: [*:0]const u8) callconv(.Inline) ?gpu.Proc); + assertDecl(T, "adapterCreateDevice", fn (adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor) callconv(.Inline) ?gpu.Device); + assertDecl(T, "adapterEnumerateFeatures", fn (adapter: gpu.Adapter, features: ?[*]gpu.FeatureName) callconv(.Inline) usize); + assertDecl(T, "adapterGetLimits", fn (adapter: gpu.Adapter, limits: *gpu.SupportedLimits) callconv(.Inline) bool); + assertDecl(T, "adapterGetProperties", fn (adapter: gpu.Adapter, properties: *gpu.AdapterProperties) callconv(.Inline) void); + assertDecl(T, "adapterHasFeature", fn (adapter: gpu.Adapter, feature: gpu.FeatureName) callconv(.Inline) bool); + assertDecl(T, "adapterRequestDevice", fn (adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "adapterReference", fn (adapter: gpu.Adapter) callconv(.Inline) void); + assertDecl(T, "adapterRelease", fn (adapter: gpu.Adapter) callconv(.Inline) void); + assertDecl(T, "bindGroupSetLabel", fn (bind_group: gpu.BindGroup, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "bindGroupReference", fn (bind_group: gpu.BindGroup) callconv(.Inline) void); + assertDecl(T, "bindGroupRelease", fn (bind_group: gpu.BindGroup) callconv(.Inline) void); + assertDecl(T, "bindGroupLayoutSetLabel", fn (bind_group_layout: gpu.BindGroupLayout, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "bindGroupLayoutReference", fn (bind_group_layout: gpu.BindGroupLayout) callconv(.Inline) void); + assertDecl(T, "bindGroupLayoutRelease", fn (bind_group_layout: gpu.BindGroupLayout) callconv(.Inline) void); + assertDecl(T, "bufferDestroy", fn (buffer: gpu.Buffer) callconv(.Inline) void); + assertDecl(T, "bufferGetConstMappedRange", fn (buffer: gpu.Buffer, offset: usize, size: usize) callconv(.Inline) ?*const anyopaque); + assertDecl(T, "bufferGetMappedRange", fn (buffer: gpu.Buffer, offset: usize, size: usize) callconv(.Inline) ?*anyopaque); + assertDecl(T, "bufferGetSize", fn (buffer: gpu.Buffer) callconv(.Inline) u64); + assertDecl(T, "bufferGetUsage", fn (buffer: gpu.Buffer) callconv(.Inline) gpu.BufferUsage); + assertDecl(T, "bufferMapAsync", fn (buffer: gpu.Buffer, mode: gpu.MapMode, offset: usize, size: usize, callback: gpu.BufferMapCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "bufferSetLabel", fn (buffer: gpu.Buffer, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "bufferUnmap", fn (buffer: gpu.Buffer) callconv(.Inline) void); + assertDecl(T, "bufferReference", fn (buffer: gpu.Buffer) callconv(.Inline) void); + assertDecl(T, "bufferRelease", fn (buffer: gpu.Buffer) callconv(.Inline) void); + assertDecl(T, "commandBufferSetLabel", fn (command_buffer: gpu.CommandBuffer, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "commandBufferReference", fn (command_buffer: gpu.CommandBuffer) callconv(.Inline) void); + assertDecl(T, "commandBufferRelease", fn (command_buffer: gpu.CommandBuffer) callconv(.Inline) void); + assertDecl(T, "commandEncoderBeginComputePass", fn (command_encoder: gpu.CommandEncoder, descriptor: ?*const gpu.ComputePassDescriptor) callconv(.Inline) gpu.ComputePassEncoder); + assertDecl(T, "commandEncoderBeginRenderPass", fn (command_encoder: gpu.CommandEncoder, descriptor: *const gpu.RenderPassDescriptor) callconv(.Inline) gpu.RenderPassEncoder); + assertDecl(T, "commandEncoderClearBuffer", fn (command_encoder: gpu.CommandEncoder, buffer: gpu.Buffer, offset: u64, size: u64) callconv(.Inline) void); + assertDecl(T, "commandEncoderCopyBufferToBuffer", fn (command_encoder: gpu.CommandEncoder, source: gpu.Buffer, source_offset: u64, destination: gpu.Buffer, destination_offset: u64, size: u64) callconv(.Inline) void); + assertDecl(T, "commandEncoderCopyBufferToTexture", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyBuffer, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) callconv(.Inline) void); + assertDecl(T, "commandEncoderCopyTextureToBuffer", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyBuffer, copy_size: *const gpu.Extent3D) callconv(.Inline) void); + assertDecl(T, "commandEncoderCopyTextureToTexture", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) callconv(.Inline) void); + assertDecl(T, "commandEncoderCopyTextureToTextureInternal", fn (command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) callconv(.Inline) void); + assertDecl(T, "commandEncoderFinish", fn (command_encoder: gpu.CommandEncoder, descriptor: ?*const gpu.CommandBufferDescriptor) callconv(.Inline) gpu.CommandBuffer); + assertDecl(T, "commandEncoderInjectValidationError", fn (command_encoder: gpu.CommandEncoder, message: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "commandEncoderInsertDebugMarker", fn (command_encoder: gpu.CommandEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "commandEncoderPopDebugGroup", fn (command_encoder: gpu.CommandEncoder) callconv(.Inline) void); + assertDecl(T, "commandEncoderPushDebugGroup", fn (command_encoder: gpu.CommandEncoder, group_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "commandEncoderResolveQuerySet", fn (command_encoder: gpu.CommandEncoder, query_set: gpu.QuerySet, first_query: u32, query_count: u32, destination: gpu.Buffer, destination_offset: u64) callconv(.Inline) void); + assertDecl(T, "commandEncoderSetLabel", fn (command_encoder: gpu.CommandEncoder, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "commandEncoderWriteBuffer", fn (command_encoder: gpu.CommandEncoder, buffer: gpu.Buffer, buffer_offset: u64, data: [*]const u8, size: u64) callconv(.Inline) void); + assertDecl(T, "commandEncoderWriteTimestamp", fn (command_encoder: gpu.CommandEncoder, query_set: gpu.QuerySet, query_index: u32) callconv(.Inline) void); + assertDecl(T, "commandEncoderReference", fn (command_encoder: gpu.CommandEncoder) callconv(.Inline) void); + assertDecl(T, "commandEncoderRelease", fn (command_encoder: gpu.CommandEncoder) callconv(.Inline) void); + assertDecl(T, "computePassEncoderDispatch", fn (compute_pass_encoder: gpu.ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) callconv(.Inline) void); + assertDecl(T, "computePassEncoderDispatchIndirect", fn (compute_pass_encoder: gpu.ComputePassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); + assertDecl(T, "computePassEncoderDispatchWorkgroups", fn (compute_pass_encoder: gpu.ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) callconv(.Inline) void); + assertDecl(T, "computePassEncoderDispatchWorkgroupsIndirect", fn (compute_pass_encoder: gpu.ComputePassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); + assertDecl(T, "computePassEncoderEnd", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); + assertDecl(T, "computePassEncoderEndPass", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); + assertDecl(T, "computePassEncoderInsertDebugMarker", fn (compute_pass_encoder: gpu.ComputePassEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "computePassEncoderPopDebugGroup", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); + assertDecl(T, "computePassEncoderPushDebugGroup", fn (compute_pass_encoder: gpu.ComputePassEncoder, group_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "computePassEncoderSetBindGroup", fn (compute_pass_encoder: gpu.ComputePassEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) callconv(.Inline) void); + assertDecl(T, "computePassEncoderSetLabel", fn (compute_pass_encoder: gpu.ComputePassEncoder, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "computePassEncoderSetPipeline", fn (compute_pass_encoder: gpu.ComputePassEncoder, pipeline: gpu.ComputePipeline) callconv(.Inline) void); + assertDecl(T, "computePassEncoderWriteTimestamp", fn (compute_pass_encoder: gpu.ComputePassEncoder, pipeline: gpu.ComputePipeline) callconv(.Inline) void); + assertDecl(T, "computePassEncoderReference", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); + assertDecl(T, "computePassEncoderRelease", fn (compute_pass_encoder: gpu.ComputePassEncoder) callconv(.Inline) void); + assertDecl(T, "computePipelineGetBindGroupLayout", fn (compute_pipeline: gpu.ComputePipeline, group_index: u32) callconv(.Inline) gpu.BindGroupLayout); + assertDecl(T, "computePipelineSetLabel", fn (compute_pipeline: gpu.ComputePipeline, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "computePipelineReference", fn (compute_pipeline: gpu.ComputePipeline) callconv(.Inline) void); + assertDecl(T, "computePipelineRelease", fn (compute_pipeline: gpu.ComputePipeline) callconv(.Inline) void); + assertDecl(T, "deviceCreateBindGroup", fn (device: gpu.Device, descriptor: *const gpu.BindGroupDescriptor) callconv(.Inline) gpu.BindGroup); + assertDecl(T, "deviceCreateBindGroupLayout", fn (device: gpu.Device, descriptor: *const gpu.BindGroupLayoutDescriptor) callconv(.Inline) gpu.BindGroupLayout); + assertDecl(T, "deviceCreateBuffer", fn (device: gpu.Device, descriptor: *const gpu.BufferDescriptor) callconv(.Inline) gpu.Buffer); + assertDecl(T, "deviceCreateCommandEncoder", fn (device: gpu.Device, descriptor: ?*const gpu.CommandEncoderDescriptor) callconv(.Inline) gpu.CommandEncoder); + assertDecl(T, "deviceCreateComputePipeline", fn (device: gpu.Device, descriptor: *const gpu.ComputePipelineDescriptor) callconv(.Inline) gpu.ComputePipeline); + assertDecl(T, "deviceCreateComputePipelineAsync", fn (device: gpu.Device, descriptor: *const gpu.ComputePipelineDescriptor, callback: gpu.CreateComputePipelineAsyncCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "deviceCreateErrorBuffer", fn (device: gpu.Device) callconv(.Inline) gpu.Buffer); + assertDecl(T, "deviceCreateErrorExternalTexture", fn (device: gpu.Device) callconv(.Inline) gpu.ExternalTexture); + assertDecl(T, "deviceCreateExternalTexture", fn (device: gpu.Device, external_texture_descriptor: *const gpu.ExternalTextureDescriptor) callconv(.Inline) gpu.ExternalTexture); + assertDecl(T, "deviceCreatePipelineLayout", fn (device: gpu.Device, pipeline_layout_descriptor: *const gpu.PipelineLayoutDescriptor) callconv(.Inline) gpu.PipelineLayout); + assertDecl(T, "deviceCreateQuerySet", fn (device: gpu.Device, descriptor: *const gpu.QuerySetDescriptor) callconv(.Inline) gpu.QuerySet); + assertDecl(T, "deviceCreateRenderBundleEncoder", fn (device: gpu.Device, descriptor: *const gpu.RenderBundleEncoderDescriptor) callconv(.Inline) gpu.RenderBundleEncoder); + assertDecl(T, "deviceCreateRenderPipeline", fn (device: gpu.Device, descriptor: *const gpu.RenderPipelineDescriptor) callconv(.Inline) gpu.RenderPipeline); + assertDecl(T, "deviceCreateRenderPipelineAsync", fn (device: gpu.Device, descriptor: *const gpu.RenderPipelineDescriptor, callback: gpu.CreateRenderPipelineAsyncCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "deviceCreateSampler", fn (device: gpu.Device, descriptor: ?*const gpu.SamplerDescriptor) callconv(.Inline) gpu.Sampler); + assertDecl(T, "deviceCreateShaderModule", fn (device: gpu.Device, descriptor: *const gpu.ShaderModuleDescriptor) callconv(.Inline) gpu.ShaderModule); + assertDecl(T, "deviceCreateSwapChain", fn (device: gpu.Device, surface: ?gpu.Surface, descriptor: *const gpu.SwapChainDescriptor) callconv(.Inline) gpu.SwapChain); + assertDecl(T, "deviceCreateTexture", fn (device: gpu.Device, descriptor: *const gpu.TextureDescriptor) callconv(.Inline) gpu.Texture); + assertDecl(T, "deviceDestroy", fn (device: gpu.Device) callconv(.Inline) void); + assertDecl(T, "deviceEnumerateFeatures", fn (device: gpu.Device, features: [*]gpu.FeatureName) callconv(.Inline) usize); + assertDecl(T, "deviceGetLimits", fn (device: gpu.Device, limits: *gpu.SupportedLimits) callconv(.Inline) bool); + assertDecl(T, "deviceGetQueue", fn (device: gpu.Device) callconv(.Inline) gpu.Queue); + assertDecl(T, "deviceHasFeature", fn (device: gpu.Device, feature: gpu.FeatureName) callconv(.Inline) bool); + assertDecl(T, "deviceInjectError", fn (device: gpu.Device, typ: gpu.ErrorType, message: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "deviceLoseForTesting", fn (device: gpu.Device) callconv(.Inline) void); + assertDecl(T, "devicePopErrorScope", fn (device: gpu.Device, callback: gpu.ErrorCallback, userdata: *anyopaque) callconv(.Inline) bool); + assertDecl(T, "devicePushErrorScope", fn (device: gpu.Device, filter: gpu.ErrorFilter) callconv(.Inline) void); + assertDecl(T, "deviceSetDeviceLostCallback", fn (device: gpu.Device, callback: gpu.DeviceLostCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "deviceSetLabel", fn (device: gpu.Device, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "deviceSetLoggingCallback", fn (device: gpu.Device, callback: gpu.LoggingCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "deviceSetUncapturedErrorCallback", fn (device: gpu.Device, callback: gpu.ErrorCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "deviceTick", fn (device: gpu.Device) callconv(.Inline) void); + assertDecl(T, "deviceReference", fn (device: gpu.Device) callconv(.Inline) void); + assertDecl(T, "deviceRelease", fn (device: gpu.Device) callconv(.Inline) void); + assertDecl(T, "externalTextureDestroy", fn (external_texture: gpu.ExternalTexture) callconv(.Inline) void); + assertDecl(T, "externalTextureSetLabel", fn (external_texture: gpu.ExternalTexture, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "externalTextureReference", fn (external_texture: gpu.ExternalTexture) callconv(.Inline) void); + assertDecl(T, "externalTextureRelease", fn (external_texture: gpu.ExternalTexture) callconv(.Inline) void); + assertDecl(T, "instanceCreateSurface", fn (instance: gpu.Instance, descriptor: *const gpu.SurfaceDescriptor) callconv(.Inline) gpu.Surface); + assertDecl(T, "instanceRequestAdapter", fn (instance: gpu.Instance, options: *const gpu.RequestAdapterOptions, callback: gpu.RequestAdapterCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "instanceReference", fn (instance: gpu.Instance) callconv(.Inline) void); + assertDecl(T, "instanceRelease", fn (instance: gpu.Instance) callconv(.Inline) void); + assertDecl(T, "pipelineLayoutSetLabel", fn (pipeline_layout: gpu.PipelineLayout, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "pipelineLayoutReference", fn (pipeline_layout: gpu.PipelineLayout) callconv(.Inline) void); + assertDecl(T, "pipelineLayoutRelease", fn (pipeline_layout: gpu.PipelineLayout) callconv(.Inline) void); + assertDecl(T, "querySetDestroy", fn (query_set: gpu.QuerySet) callconv(.Inline) void); + assertDecl(T, "querySetGetCount", fn (query_set: gpu.QuerySet) callconv(.Inline) u32); + assertDecl(T, "querySetGetType", fn (query_set: gpu.QuerySet) callconv(.Inline) gpu.QueryType); + assertDecl(T, "querySetSetLabel", fn (query_set: gpu.QuerySet, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "querySetReference", fn (query_set: gpu.QuerySet) callconv(.Inline) void); + assertDecl(T, "querySetRelease", fn (query_set: gpu.QuerySet) callconv(.Inline) void); + assertDecl(T, "queueCopyTextureForBrowser", fn (queue: gpu.Queue, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D, options: *const gpu.CopyTextureForBrowserOptions) callconv(.Inline) void); + assertDecl(T, "queueOnSubmittedWorkDone", fn (queue: gpu.Queue, signal_value: u64, callback: gpu.QueueWorkDoneCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "queueSetLabel", fn (queue: gpu.Queue, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "queueSubmit", fn (queue: gpu.Queue, command_count: u32, commands: [*]gpu.CommandBuffer) callconv(.Inline) void); + assertDecl(T, "queueWriteBuffer", fn (queue: gpu.Queue, buffer: gpu.Buffer, buffer_offset: u64, data: *anyopaque, size: usize) callconv(.Inline) void); + assertDecl(T, "queueWriteTexture", fn (queue: gpu.Queue, data: *anyopaque, data_size: usize, data_layout: *const gpu.TextureDataLayout, write_size: *const gpu.Extent3D) callconv(.Inline) void); + assertDecl(T, "queueReference", fn (queue: gpu.Queue) callconv(.Inline) void); + assertDecl(T, "queueRelease", fn (queue: gpu.Queue) callconv(.Inline) void); + assertDecl(T, "renderBundleReference", fn (render_bundle: gpu.RenderBundle) callconv(.Inline) void); + assertDecl(T, "renderBundleRelease", fn (render_bundle: gpu.RenderBundle) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderDraw", fn (render_bundle_encoder: gpu.RenderBundleEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderDrawIndexed", fn (render_bundle_encoder: gpu.RenderBundleEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderDrawIndexedIndirect", fn (render_bundle_encoder: gpu.RenderBundleEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderDrawIndirect", fn (render_bundle_encoder: gpu.RenderBundleEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderFinish", fn (render_bundle_encoder: gpu.RenderBundleEncoder, descriptor: ?*const gpu.RenderBundleDescriptor) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderInsertDebugMarker", fn (render_bundle_encoder: gpu.RenderBundleEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderPopDebugGroup", fn (render_bundle_encoder: gpu.RenderBundleEncoder) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderPushDebugGroup", fn (render_bundle_encoder: gpu.RenderBundleEncoder, group_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderSetBindGroup", fn (render_bundle_encoder: gpu.RenderBundleEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderSetIndexBuffer", fn (render_bundle_encoder: gpu.RenderBundleEncoder, buffer: gpu.Buffer, format: gpu.IndexFormat, offset: u64, size: u64) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderSetLabel", fn (render_bundle_encoder: gpu.RenderBundleEncoder, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderSetPipeline", fn (render_bundle_encoder: gpu.RenderBundleEncoder, pipeline: gpu.RenderPipeline) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderSetVertexBuffer", fn (render_bundle_encoder: gpu.RenderBundleEncoder, slot: u32, buffer: gpu.Buffer, offset: u64, size: u64) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderReference", fn (render_bundle_encoder: gpu.RenderBundleEncoder) callconv(.Inline) void); + assertDecl(T, "renderBundleEncoderRelease", fn (render_bundle_encoder: gpu.RenderBundleEncoder) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderBeginOcclusionQuery", fn (render_pass_encoder: gpu.RenderPassEncoder, query_index: u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderDraw", fn (render_pass_encoder: gpu.RenderPassEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderDrawIndexed", fn (render_pass_encoder: gpu.RenderPassEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderDrawIndexedIndirect", fn (render_pass_encoder: gpu.RenderPassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderDrawIndirect", fn (render_pass_encoder: gpu.RenderPassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderEnd", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderEndOcclusionQuery", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderEndPass", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderExecuteBundles", fn (render_pass_encoder: gpu.RenderPassEncoder, bundles_count: u32, bundles: [*]const gpu.RenderBundle) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderInsertDebugMarker", fn (render_pass_encoder: gpu.RenderPassEncoder, marker_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderPopDebugGroup", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderPushDebugGroup", fn (render_pass_encoder: gpu.RenderPassEncoder, group_label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetBindGroup", fn (render_pass_encoder: gpu.RenderPassEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetBlendConstant", fn (render_pass_encoder: gpu.RenderPassEncoder, color: *const gpu.Color) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetIndexBuffer", fn (render_pass_encoder: gpu.RenderPassEncoder, buffer: gpu.Buffer, format: gpu.IndexFormat, offset: u64, size: u64) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetLabel", fn (render_pass_encoder: gpu.RenderPassEncoder, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetPipeline", fn (render_pass_encoder: gpu.RenderPassEncoder, pipeline: gpu.RenderPipeline) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetScissorRect", fn (render_pass_encoder: gpu.RenderPassEncoder, x: u32, y: u32, width: u32, height: u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetStencilReference", fn (render_pass_encoder: gpu.RenderPassEncoder, reference: u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetVertexBuffer", fn (render_pass_encoder: gpu.RenderPassEncoder, slot: u32, buffer: gpu.Buffer, offset: u64, size: u64) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderSetViewport", fn (render_pass_encoder: gpu.RenderPassEncoder, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderWriteTimestamp", fn (render_pass_encoder: gpu.RenderPassEncoder, query_set: gpu.QuerySet, query_index: u32) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderReference", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); + assertDecl(T, "renderPassEncoderRelease", fn (render_pass_encoder: gpu.RenderPassEncoder) callconv(.Inline) void); + assertDecl(T, "renderPipelineGetBindGroupLayout", fn (render_pipeline: gpu.RenderPipeline, group_index: u32) callconv(.Inline) gpu.BindGroupLayout); + assertDecl(T, "renderPipelineSetLabel", fn (render_pipeline: gpu.RenderPipeline, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "renderPipelineReference", fn (render_pipeline: gpu.RenderPipeline) callconv(.Inline) void); + assertDecl(T, "renderPipelineRelease", fn (render_pipeline: gpu.RenderPipeline) callconv(.Inline) void); + assertDecl(T, "samplerSetLabel", fn (sampler: gpu.Sampler, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "samplerReference", fn (sampler: gpu.Sampler) callconv(.Inline) void); + assertDecl(T, "samplerRelease", fn (sampler: gpu.Sampler) callconv(.Inline) void); + assertDecl(T, "shaderModuleGetCompilationInfo", fn (shader_module: gpu.ShaderModule, callback: gpu.CompilationInfoCallback, userdata: *anyopaque) callconv(.Inline) void); + assertDecl(T, "shaderModuleSetLabel", fn (shader_module: gpu.ShaderModule, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "shaderModuleReference", fn (shader_module: gpu.ShaderModule) callconv(.Inline) void); + assertDecl(T, "shaderModuleRelease", fn (shader_module: gpu.ShaderModule) callconv(.Inline) void); + assertDecl(T, "surfaceReference", fn (surface: gpu.Surface) callconv(.Inline) void); + assertDecl(T, "surfaceRelease", fn (surface: gpu.Surface) callconv(.Inline) void); + assertDecl(T, "swapChainConfigure", fn (swap_chain: gpu.SwapChain, format: gpu.TextureFormat, allowed_usage: gpu.TextureUsageFlags, width: u32, height: u32) callconv(.Inline) void); + assertDecl(T, "swapChainGetCurrentTextureView", fn (swap_chain: gpu.SwapChain) callconv(.Inline) gpu.TextureView); + assertDecl(T, "swapChainPresent", fn (swap_chain: gpu.SwapChain) callconv(.Inline) void); + assertDecl(T, "swapChainReference", fn (swap_chain: gpu.SwapChain) callconv(.Inline) void); + assertDecl(T, "swapChainRelease", fn (swap_chain: gpu.SwapChain) callconv(.Inline) void); + assertDecl(T, "textureCreateView", fn (texture: gpu.Texture, descriptor: ?*const gpu.TextureViewDescriptor) callconv(.Inline) gpu.TextureView); + assertDecl(T, "textureDestroy", fn (texture: gpu.Texture) callconv(.Inline) void); + assertDecl(T, "textureGetDepthOrArrayLayers", fn (texture: gpu.Texture) callconv(.Inline) u32); + assertDecl(T, "textureGetDimension", fn (texture: gpu.Texture) callconv(.Inline) gpu.TextureDimension); + assertDecl(T, "textureGetFormat", fn (texture: gpu.Texture) callconv(.Inline) gpu.TextureFormat); + assertDecl(T, "textureGetHeight", fn (texture: gpu.Texture) callconv(.Inline) u32); + assertDecl(T, "textureGetMipLevelCount", fn (texture: gpu.Texture) callconv(.Inline) u32); + assertDecl(T, "textureGetSampleCount", fn (texture: gpu.Texture) callconv(.Inline) u32); + assertDecl(T, "textureGetUsage", fn (texture: gpu.Texture) callconv(.Inline) gpu.TextureUsageFlags); + assertDecl(T, "textureGetWidth", fn (texture: gpu.Texture) callconv(.Inline) u32); + assertDecl(T, "textureSetLabel", fn (texture: gpu.Texture, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "textureReference", fn (texture: gpu.Texture) callconv(.Inline) void); + assertDecl(T, "textureRelease", fn (texture: gpu.Texture) callconv(.Inline) void); + assertDecl(T, "textureViewSetLabel", fn (texture_view: gpu.TextureView, label: [*:0]const u8) callconv(.Inline) void); + assertDecl(T, "textureViewReference", fn (texture_view: gpu.TextureView) callconv(.Inline) void); + assertDecl(T, "textureViewRelease", fn (texture_view: gpu.TextureView) callconv(.Inline) void); + return T; } -fn assertDecl(comptime Impl: anytype, comptime name: []const u8, comptime T: type) void { - if (!@hasDecl(Impl, name)) @compileError("gpu.Interface missing declaration: " ++ @typeName(T)); - const Decl = @TypeOf(@field(Impl, name)); - if (Decl != T) @compileError("gpu.Interface field '" ++ name ++ "'\n\texpected type: " ++ @typeName(T) ++ "\n\t found type: " ++ @typeName(Decl)); +fn assertDecl(comptime T: anytype, comptime name: []const u8, comptime Decl: type) void { + if (!@hasDecl(T, name)) @compileError("gpu.Interface missing declaration: " ++ @typeName(Decl)); + const FoundDecl = @TypeOf(@field(T, name)); + if (FoundDecl != Decl) @compileError("gpu.Interface field '" ++ name ++ "'\n\texpected type: " ++ @typeName(Decl) ++ "\n\t found type: " ++ @typeName(FoundDecl)); } /// Exports C ABI function declarations for the given gpu.Interface implementation. -pub fn Export(comptime Impl: type) type { - _ = Interface(Impl); // verify implementation is a valid interface +pub fn Export(comptime T: type) type { + _ = Interface(T); // verify implementation is a valid interface return struct { // WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPUInstanceDescriptor const * descriptor); export fn wgpuCreateInstance(descriptor: ?*const InstanceDescriptor) ?Instance { - return Impl.createInstance(descriptor); + return T.createInstance(descriptor); } // WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName); export fn wgpuGetProcAddress(device: gpu.Device, proc_name: [*:0]const u8) ?gpu.Proc { - return Impl.getProcAddress(device, proc_name); + return T.getProcAddress(device, proc_name); } // WGPU_EXPORT WGPUDevice wgpuAdapterCreateDevice(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor /* nullable */); export fn wgpuAdapterCreateDevice(adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor) ?gpu.Device { - return Impl.adapterCreateDevice(adapter, descriptor); + return T.adapterCreateDevice(adapter, descriptor); } // WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * features); export fn wgpuAdapterEnumerateFeatures(adapter: gpu.Adapter, features: ?[*]gpu.FeatureName) usize { - return Impl.adapterEnumerateFeatures(adapter, features); + return T.adapterEnumerateFeatures(adapter, features); } // WGPU_EXPORT bool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits); export fn wgpuAdapterGetLimits(adapter: gpu.Adapter, limits: *gpu.SupportedLimits) bool { - return Impl.adapterGetLimits(adapter, limits); + return T.adapterGetLimits(adapter, limits); } // WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties); export fn wgpuAdapterGetProperties(adapter: gpu.Adapter, properties: *gpu.AdapterProperties) void { - return Impl.adapterGetProperties(adapter, properties); + return T.adapterGetProperties(adapter, properties); } // WGPU_EXPORT bool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature); export fn wgpuAdapterHasFeature(adapter: gpu.Adapter, feature: gpu.FeatureName) bool { - return Impl.adapterHasFeature(adapter, feature); + return T.adapterHasFeature(adapter, feature); } // NOTE: descriptor is nullable, see https://bugs.chromium.org/p/dawn/issues/detail?id=1502 // WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata); export fn wgpuAdapterRequestDevice(adapter: gpu.Adapter, descriptor: ?*const gpu.DeviceDescriptor, callback: gpu.RequestDeviceCallback, userdata: *anyopaque) void { - Impl.adapterRequestDevice(adapter, descriptor, callback, userdata); + T.adapterRequestDevice(adapter, descriptor, callback, userdata); } // WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter); export fn wgpuAdapterReference(adapter: gpu.Adapter) void { - Impl.adapterReference(adapter); + T.adapterReference(adapter); } // WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter); export fn wgpuAdapterRelease(adapter: gpu.Adapter) void { - Impl.adapterRelease(adapter); + T.adapterRelease(adapter); } // WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label); export fn wgpuBindGroupSetLabel(bind_group: gpu.BindGroup, label: [*:0]const u8) void { - Impl.bindGroupSetLabel(bind_group, label); + T.bindGroupSetLabel(bind_group, label); } // WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup); export fn wgpuBindGroupReference(bind_group: gpu.BindGroup) void { - Impl.bindGroupReference(bind_group); + T.bindGroupReference(bind_group); } // WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup); export fn wgpuBindGroupRelease(bind_group: gpu.BindGroup) void { - Impl.bindGroupRelease(bind_group); + T.bindGroupRelease(bind_group); } // WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label); export fn wgpuBindGroupLayoutSetLabel(bind_group_layout: gpu.BindGroupLayout, label: [*:0]const u8) void { - Impl.bindGroupLayoutSetLabel(bind_group_layout, label); + T.bindGroupLayoutSetLabel(bind_group_layout, label); } // WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout); export fn wgpuBindGroupLayoutReference(bind_group_layout: gpu.BindGroupLayout) void { - Impl.bindGroupLayoutReference(bind_group_layout); + T.bindGroupLayoutReference(bind_group_layout); } // WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout); export fn wgpuBindGroupLayoutRelease(bind_group_layout: gpu.BindGroupLayout) void { - Impl.bindGroupLayoutRelease(bind_group_layout); + T.bindGroupLayoutRelease(bind_group_layout); } // WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer); export fn wgpuBufferDestroy(buffer: gpu.Buffer) void { - Impl.bufferDestroy(buffer); + T.bufferDestroy(buffer); } // WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size); export fn wgpuBufferGetConstMappedRange(buffer: gpu.Buffer, offset: usize, size: usize) ?*const anyopaque { - return Impl.bufferGetConstMappedRange(buffer, offset, size); + return T.bufferGetConstMappedRange(buffer, offset, size); } // WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size); export fn wgpuBufferGetMappedRange(buffer: gpu.Buffer, offset: usize, size: usize) ?*anyopaque { - return Impl.bufferGetMappedRange(buffer, offset, size); + return T.bufferGetMappedRange(buffer, offset, size); } // WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer); export fn wgpuBufferGetSize(buffer: gpu.Buffer) u64 { - return Impl.bufferGetSize(buffer); + return T.bufferGetSize(buffer); } // WGPU_EXPORT WGPUBufferUsage wgpuBufferGetUsage(WGPUBuffer buffer); export fn wgpuBufferGetUsage(buffer: gpu.Buffer) gpu.BufferUsage { - return Impl.bufferGetUsage(buffer); + return T.bufferGetUsage(buffer); } // TODO: Zig cannot currently export a packed struct gpu.MapModeFlags, so we use a u32 for // now. // WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata); export fn wgpuBufferMapAsync(buffer: gpu.Buffer, mode: u32, offset: usize, size: usize, callback: gpu.BufferMapCallback, userdata: *anyopaque) void { - Impl.bufferMapAsync(buffer, @bitCast(gpu.MapMode, mode), offset, size, callback, userdata); + T.bufferMapAsync(buffer, @bitCast(gpu.MapMode, mode), offset, size, callback, userdata); } // WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label); export fn wgpuBufferSetLabel(buffer: gpu.Buffer, label: [*:0]const u8) void { - Impl.bufferSetLabel(buffer, label); + T.bufferSetLabel(buffer, label); } // WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer); export fn wgpuBufferUnmap(buffer: gpu.Buffer) void { - Impl.bufferUnmap(buffer); + T.bufferUnmap(buffer); } // WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer); export fn wgpuBufferReference(buffer: gpu.Buffer) void { - Impl.bufferReference(buffer); + T.bufferReference(buffer); } // WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer); export fn wgpuBufferRelease(buffer: gpu.Buffer) void { - Impl.bufferRelease(buffer); + T.bufferRelease(buffer); } // WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label); export fn wgpuCommandBufferSetLabel(command_buffer: gpu.CommandBuffer, label: [*:0]const u8) void { - Impl.commandBufferSetLabel(command_buffer, label); + T.commandBufferSetLabel(command_buffer, label); } // WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer); export fn wgpuCommandBufferReference(command_buffer: gpu.CommandBuffer) void { - Impl.commandBufferReference(command_buffer); + T.commandBufferReference(command_buffer); } // WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer); export fn wgpuCommandBufferRelease(command_buffer: gpu.CommandBuffer) void { - Impl.commandBufferRelease(command_buffer); + T.commandBufferRelease(command_buffer); } // WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor /* nullable */); export fn wgpuCommandEncoderBeginComputePass(command_encoder: gpu.CommandEncoder, descriptor: ?*const gpu.ComputePassDescriptor) gpu.ComputePassEncoder { - return Impl.commandEncoderBeginComputePass(command_encoder, descriptor); + return T.commandEncoderBeginComputePass(command_encoder, descriptor); } // WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor); export fn wgpuCommandEncoderBeginRenderPass(command_encoder: gpu.CommandEncoder, descriptor: *const gpu.RenderPassDescriptor) gpu.RenderPassEncoder { - return Impl.commandEncoderBeginRenderPass(command_encoder, descriptor); + return T.commandEncoderBeginRenderPass(command_encoder, descriptor); } // WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size); export fn wgpuCommandEncoderClearBuffer(command_encoder: gpu.CommandEncoder, buffer: gpu.Buffer, offset: u64, size: u64) void { - Impl.commandEncoderClearBuffer(command_encoder, buffer, offset, size); + T.commandEncoderClearBuffer(command_encoder, buffer, offset, size); } // WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size); export fn wgpuCommandEncoderCopyBufferToBuffer(command_encoder: gpu.CommandEncoder, source: gpu.Buffer, source_offset: u64, destination: gpu.Buffer, destination_offset: u64, size: u64) void { - Impl.commandEncoderCopyBufferToBuffer(command_encoder, source, source_offset, destination, destination_offset, size); + T.commandEncoderCopyBufferToBuffer(command_encoder, source, source_offset, destination, destination_offset, size); } // WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); export fn wgpuCommandEncoderCopyBufferToTexture(command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyBuffer, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) void { - Impl.commandEncoderCopyBufferToTexture(command_encoder, source, destination, copy_size); + T.commandEncoderCopyBufferToTexture(command_encoder, source, destination, copy_size); } // WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize); export fn wgpuCommandEncoderCopyTextureToBuffer(command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyBuffer, copy_size: *const gpu.Extent3D) void { - Impl.commandEncoderCopyTextureToBuffer(command_encoder, source, destination, copy_size); + T.commandEncoderCopyTextureToBuffer(command_encoder, source, destination, copy_size); } // WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); export fn wgpuCommandEncoderCopyTextureToTexture(command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) void { - Impl.commandEncoderCopyTextureToTexture(command_encoder, source, destination, copy_size); + T.commandEncoderCopyTextureToTexture(command_encoder, source, destination, copy_size); } // WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTextureInternal(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize); export fn wgpuCommandEncoderCopyTextureToTextureInternal(command_encoder: gpu.CommandEncoder, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D) void { - Impl.commandEncoderCopyTextureToTextureInternal(command_encoder, source, destination, copy_size); + T.commandEncoderCopyTextureToTextureInternal(command_encoder, source, destination, copy_size); } // WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor /* nullable */); export fn wgpuCommandEncoderFinish(command_encoder: gpu.CommandEncoder, descriptor: ?*const gpu.CommandBufferDescriptor) gpu.CommandBuffer { - return Impl.commandEncoderFinish(command_encoder, descriptor); + return T.commandEncoderFinish(command_encoder, descriptor); } // WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message); export fn wgpuCommandEncoderInjectValidationError(command_encoder: gpu.CommandEncoder, message: [*:0]const u8) void { - Impl.commandEncoderInjectValidationError(command_encoder, message); + T.commandEncoderInjectValidationError(command_encoder, message); } // WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel); export fn wgpuCommandEncoderInsertDebugMarker(command_encoder: gpu.CommandEncoder, marker_label: [*:0]const u8) void { - Impl.commandEncoderInsertDebugMarker(command_encoder, marker_label); + T.commandEncoderInsertDebugMarker(command_encoder, marker_label); } // WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder); export fn wgpuCommandEncoderPopDebugGroup(command_encoder: gpu.CommandEncoder) void { - Impl.commandEncoderPopDebugGroup(command_encoder); + T.commandEncoderPopDebugGroup(command_encoder); } // WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel); export fn wgpuCommandEncoderPushDebugGroup(command_encoder: gpu.CommandEncoder, group_label: [*:0]const u8) void { - Impl.commandEncoderPushDebugGroup(command_encoder, group_label); + T.commandEncoderPushDebugGroup(command_encoder, group_label); } // WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset); export fn wgpuCommandEncoderResolveQuerySet(command_encoder: gpu.CommandEncoder, query_set: gpu.QuerySet, first_query: u32, query_count: u32, destination: gpu.Buffer, destination_offset: u64) void { - Impl.commandEncoderResolveQuerySet(command_encoder, query_set, first_query, query_count, destination, destination_offset); + T.commandEncoderResolveQuerySet(command_encoder, query_set, first_query, query_count, destination, destination_offset); } // WGPU_EXPORT void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, char const * label); export fn wgpuCommandEncoderSetLabel(command_encoder: gpu.CommandEncoder, label: [*:0]const u8) void { - Impl.commandEncoderSetLabel(command_encoder, label); + T.commandEncoderSetLabel(command_encoder, label); } // WGPU_EXPORT void wgpuCommandEncoderWriteBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size); export fn wgpuCommandEncoderWriteBuffer(command_encoder: gpu.CommandEncoder, buffer: gpu.Buffer, buffer_offset: u64, data: [*]const u8, size: u64) void { - Impl.commandEncoderWriteBuffer(command_encoder, buffer, buffer_offset, data, size); + T.commandEncoderWriteBuffer(command_encoder, buffer, buffer_offset, data, size); } // WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex); export fn wgpuCommandEncoderWriteTimestamp(command_encoder: gpu.CommandEncoder, query_set: gpu.QuerySet, query_index: u32) void { - Impl.commandEncoderWriteTimestamp(command_encoder, query_set, query_index); + T.commandEncoderWriteTimestamp(command_encoder, query_set, query_index); } // WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder); export fn wgpuCommandEncoderReference(command_encoder: gpu.CommandEncoder) void { - Impl.commandEncoderReference(command_encoder); + T.commandEncoderReference(command_encoder); } // WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder); export fn wgpuCommandEncoderRelease(command_encoder: gpu.CommandEncoder) void { - Impl.commandEncoderRelease(command_encoder); + T.commandEncoderRelease(command_encoder); } // WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); export fn wgpuComputePassEncoderDispatch(compute_pass_encoder: gpu.ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) void { - Impl.computePassEncoderDispatch(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); + T.computePassEncoderDispatch(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); } // WGPU_EXPORT void wgpuComputePassEncoderDispatchIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); export fn wgpuComputePassEncoderDispatchIndirect(compute_pass_encoder: gpu.ComputePassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) void { - Impl.computePassEncoderDispatchIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); + T.computePassEncoderDispatchIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); } // WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ); export fn wgpuComputePassEncoderDispatchWorkgroups(compute_pass_encoder: gpu.ComputePassEncoder, workgroup_count_x: u32, workgroup_count_y: u32, workgroup_count_z: u32) void { - Impl.computePassEncoderDispatchWorkgroups(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); + T.computePassEncoderDispatchWorkgroups(compute_pass_encoder, workgroup_count_x, workgroup_count_y, workgroup_count_z); } // WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); export fn wgpuComputePassEncoderDispatchWorkgroupsIndirect(compute_pass_encoder: gpu.ComputePassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) void { - Impl.computePassEncoderDispatchWorkgroupsIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); + T.computePassEncoderDispatchWorkgroupsIndirect(compute_pass_encoder, indirect_buffer, indirect_offset); } // WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder); export fn wgpuComputePassEncoderEnd(compute_pass_encoder: gpu.ComputePassEncoder) void { - Impl.computePassEncoderEnd(compute_pass_encoder); + T.computePassEncoderEnd(compute_pass_encoder); } // WGPU_EXPORT void wgpuComputePassEncoderEndPass(WGPUComputePassEncoder computePassEncoder); export fn wgpuComputePassEncoderEndPass(compute_pass_encoder: gpu.ComputePassEncoder) void { - Impl.computePassEncoderEndPass(compute_pass_encoder); + T.computePassEncoderEndPass(compute_pass_encoder); } // WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel); export fn wgpuComputePassEncoderInsertDebugMarker(compute_pass_encoder: gpu.ComputePassEncoder, marker_label: [*:0]const u8) void { - Impl.computePassEncoderInsertDebugMarker(compute_pass_encoder, marker_label); + T.computePassEncoderInsertDebugMarker(compute_pass_encoder, marker_label); } // WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder); export fn wgpuComputePassEncoderPopDebugGroup(compute_pass_encoder: gpu.ComputePassEncoder) void { - Impl.computePassEncoderPopDebugGroup(compute_pass_encoder); + T.computePassEncoderPopDebugGroup(compute_pass_encoder); } // WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel); export fn wgpuComputePassEncoderPushDebugGroup(compute_pass_encoder: gpu.ComputePassEncoder, group_label: [*:0]const u8) void { - Impl.computePassEncoderPushDebugGroup(compute_pass_encoder, group_label); + T.computePassEncoderPushDebugGroup(compute_pass_encoder, group_label); } // WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); export fn wgpuComputePassEncoderSetBindGroup(compute_pass_encoder: gpu.ComputePassEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) void { - Impl.computePassEncoderSetBindGroup(compute_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); + T.computePassEncoderSetBindGroup(compute_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); } // WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label); export fn wgpuComputePassEncoderSetLabel(compute_pass_encoder: gpu.ComputePassEncoder, label: [*:0]const u8) void { - Impl.computePassEncoderSetLabel(compute_pass_encoder, label); + T.computePassEncoderSetLabel(compute_pass_encoder, label); } // WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); export fn wgpuComputePassEncoderSetPipeline(compute_pass_encoder: gpu.ComputePassEncoder, pipeline: gpu.ComputePipeline) void { - Impl.computePassEncoderSetPipeline(compute_pass_encoder, pipeline); + T.computePassEncoderSetPipeline(compute_pass_encoder, pipeline); } // WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); export fn wgpuComputePassEncoderWriteTimestamp(compute_pass_encoder: gpu.ComputePassEncoder, pipeline: gpu.ComputePipeline) void { - Impl.computePassEncoderWriteTimestamp(compute_pass_encoder, pipeline); + T.computePassEncoderWriteTimestamp(compute_pass_encoder, pipeline); } // WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder); export fn wgpuComputePassEncoderReference(compute_pass_encoder: gpu.ComputePassEncoder) void { - Impl.computePassEncoderReference(compute_pass_encoder); + T.computePassEncoderReference(compute_pass_encoder); } // WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder); export fn wgpuComputePassEncoderRelease(compute_pass_encoder: gpu.ComputePassEncoder) void { - Impl.computePassEncoderRelease(compute_pass_encoder); + T.computePassEncoderRelease(compute_pass_encoder); } // WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex); export fn wgpuComputePipelineGetBindGroupLayout(compute_pipeline: gpu.ComputePipeline, group_index: u32) gpu.BindGroupLayout { - return Impl.computePipelineGetBindGroupLayout(compute_pipeline, group_index); + return T.computePipelineGetBindGroupLayout(compute_pipeline, group_index); } // WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label); export fn wgpuComputePipelineSetLabel(compute_pipeline: gpu.ComputePipeline, label: [*:0]const u8) void { - Impl.computePipelineSetLabel(compute_pipeline, label); + T.computePipelineSetLabel(compute_pipeline, label); } // WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline); export fn wgpuComputePipelineReference(compute_pipeline: gpu.ComputePipeline) void { - Impl.computePipelineReference(compute_pipeline); + T.computePipelineReference(compute_pipeline); } // WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline); export fn wgpuComputePipelineRelease(compute_pipeline: gpu.ComputePipeline) void { - Impl.computePipelineRelease(compute_pipeline); + T.computePipelineRelease(compute_pipeline); } // WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor); export fn wgpuDeviceCreateBindGroup(device: gpu.Device, descriptor: *const gpu.BindGroupDescriptor) gpu.BindGroup { - return Impl.deviceCreateBindGroup(device, descriptor); + return T.deviceCreateBindGroup(device, descriptor); } // WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor); export fn wgpuDeviceCreateBindGroupLayout(device: gpu.Device, descriptor: *const gpu.BindGroupLayoutDescriptor) gpu.BindGroupLayout { - return Impl.deviceCreateBindGroupLayout(device, descriptor); + return T.deviceCreateBindGroupLayout(device, descriptor); } // WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor); export fn wgpuDeviceCreateBuffer(device: gpu.Device, descriptor: *const gpu.BufferDescriptor) gpu.Buffer { - return Impl.deviceCreateBuffer(device, descriptor); + return T.deviceCreateBuffer(device, descriptor); } // WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPUCommandEncoderDescriptor const * descriptor /* nullable */); export fn wgpuDeviceCreateCommandEncoder(device: gpu.Device, descriptor: ?*const gpu.CommandEncoderDescriptor) gpu.CommandEncoder { - return Impl.deviceCreateCommandEncoder(device, descriptor); + return T.deviceCreateCommandEncoder(device, descriptor); } // WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor); export fn wgpuDeviceCreateComputePipeline(device: gpu.Device, descriptor: *const gpu.ComputePipelineDescriptor) gpu.ComputePipeline { - return Impl.deviceCreateComputePipeline(device, descriptor); + return T.deviceCreateComputePipeline(device, descriptor); } // WGPU_EXPORT void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata); export fn wgpuDeviceCreateComputePipelineAsync(device: gpu.Device, descriptor: *const gpu.ComputePipelineDescriptor, callback: gpu.CreateComputePipelineAsyncCallback, userdata: *anyopaque) void { - Impl.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata); + T.deviceCreateComputePipelineAsync(device, descriptor, callback, userdata); } // WGPU_EXPORT WGPUBuffer wgpuDeviceCreateErrorBuffer(WGPUDevice device); export fn wgpuDeviceCreateErrorBuffer(device: gpu.Device) gpu.Buffer { - return Impl.deviceCreateErrorBuffer(device); + return T.deviceCreateErrorBuffer(device); } // WGPU_EXPORT WGPUExternalTexture wgpuDeviceCreateErrorExternalTexture(WGPUDevice device); export fn wgpuDeviceCreateErrorExternalTexture(device: gpu.Device) gpu.ExternalTexture { - return Impl.deviceCreateErrorExternalTexture(device); + return T.deviceCreateErrorExternalTexture(device); } // WGPU_EXPORT WGPUExternalTexture wgpuDeviceCreateExternalTexture(WGPUDevice device, WGPUExternalTextureDescriptor const * externalTextureDescriptor); export fn wgpuDeviceCreateExternalTexture(device: gpu.Device, external_texture_descriptor: *const gpu.ExternalTextureDescriptor) gpu.ExternalTexture { - return Impl.deviceCreateExternalTexture(device, external_texture_descriptor); + return T.deviceCreateExternalTexture(device, external_texture_descriptor); } // WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor); export fn wgpuDeviceCreatePipelineLayout(device: gpu.Device, pipeline_layout_descriptor: *const gpu.PipelineLayoutDescriptor) gpu.PipelineLayout { - return Impl.deviceCreatePipelineLayout(device, pipeline_layout_descriptor); + return T.deviceCreatePipelineLayout(device, pipeline_layout_descriptor); } // WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor); export fn wgpuDeviceCreateQuerySet(device: gpu.Device, descriptor: *const gpu.QuerySetDescriptor) gpu.QuerySet { - return Impl.deviceCreateQuerySet(device, descriptor); + return T.deviceCreateQuerySet(device, descriptor); } // WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor); export fn wgpuDeviceCreateRenderBundleEncoder(device: gpu.Device, descriptor: *const gpu.RenderBundleEncoderDescriptor) gpu.RenderBundleEncoder { - return Impl.deviceCreateRenderBundleEncoder(device, descriptor); + return T.deviceCreateRenderBundleEncoder(device, descriptor); } // WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor); export fn wgpuDeviceCreateRenderPipeline(device: gpu.Device, descriptor: *const gpu.RenderPipelineDescriptor) gpu.RenderPipeline { - return Impl.deviceCreateRenderPipeline(device, descriptor); + return T.deviceCreateRenderPipeline(device, descriptor); } // WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata); export fn wgpuDeviceCreateRenderPipelineAsync(device: gpu.Device, descriptor: *const gpu.RenderPipelineDescriptor, callback: gpu.CreateRenderPipelineAsyncCallback, userdata: *anyopaque) void { - Impl.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata); + T.deviceCreateRenderPipelineAsync(device, descriptor, callback, userdata); } // WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor const * descriptor /* nullable */); export fn wgpuDeviceCreateSampler(device: gpu.Device, descriptor: ?*const gpu.SamplerDescriptor) gpu.Sampler { - return Impl.deviceCreateSampler(device, descriptor); + return T.deviceCreateSampler(device, descriptor); } // WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor); export fn wgpuDeviceCreateShaderModule(device: gpu.Device, descriptor: *const gpu.ShaderModuleDescriptor) gpu.ShaderModule { - return Impl.deviceCreateShaderModule(device, descriptor); + return T.deviceCreateShaderModule(device, descriptor); } // WGPU_EXPORT WGPUSwapChain wgpuDeviceCreateSwapChain(WGPUDevice device, WGPUSurface surface /* nullable */, WGPUSwapChainDescriptor const * descriptor); export fn wgpuDeviceCreateSwapChain(device: gpu.Device, surface: ?gpu.Surface, descriptor: *const gpu.SwapChainDescriptor) gpu.SwapChain { - return Impl.deviceCreateSwapChain(device, surface, descriptor); + return T.deviceCreateSwapChain(device, surface, descriptor); } // WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor); export fn wgpuDeviceCreateTexture(device: gpu.Device, descriptor: *const gpu.TextureDescriptor) gpu.Texture { - return Impl.deviceCreateTexture(device, descriptor); + return T.deviceCreateTexture(device, descriptor); } // WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device); export fn wgpuDeviceDestroy(device: gpu.Device) void { - Impl.deviceDestroy(device); + T.deviceDestroy(device); } // WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features); export fn wgpuDeviceEnumerateFeatures(device: gpu.Device, features: [*]gpu.FeatureName) usize { - return Impl.deviceEnumerateFeatures(device, features); + return T.deviceEnumerateFeatures(device, features); } // WGPU_EXPORT bool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits); export fn wgpuDeviceGetLimits(device: gpu.Device, limits: *gpu.SupportedLimits) bool { - return Impl.deviceGetLimits(device, limits); + return T.deviceGetLimits(device, limits); } // WGPU_EXPORT WGPUQueue wgpuDeviceGetQueue(WGPUDevice device); export fn wgpuDeviceGetQueue(device: gpu.Device) gpu.Queue { - return Impl.deviceGetQueue(device); + return T.deviceGetQueue(device); } // WGPU_EXPORT bool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature); export fn wgpuDeviceHasFeature(device: gpu.Device, feature: gpu.FeatureName) bool { - return Impl.deviceHasFeature(device, feature); + return T.deviceHasFeature(device, feature); } // WGPU_EXPORT void wgpuDeviceInjectError(WGPUDevice device, WGPUErrorType type, char const * message); export fn wgpuDeviceInjectError(device: gpu.Device, typ: gpu.ErrorType, message: [*:0]const u8) void { - Impl.deviceInjectError(device, typ, message); + T.deviceInjectError(device, typ, message); } // WGPU_EXPORT void wgpuDeviceLoseForTesting(WGPUDevice device); export fn wgpuDeviceLoseForTesting(device: gpu.Device) void { - Impl.deviceLoseForTesting(device); + T.deviceLoseForTesting(device); } // WGPU_EXPORT bool wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata); export fn wgpuDevicePopErrorScope(device: gpu.Device, callback: gpu.ErrorCallback, userdata: *anyopaque) bool { - return Impl.devicePopErrorScope(device, callback, userdata); + return T.devicePopErrorScope(device, callback, userdata); } // WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter); export fn wgpuDevicePushErrorScope(device: gpu.Device, filter: gpu.ErrorFilter) void { - Impl.devicePushErrorScope(device, filter); + T.devicePushErrorScope(device, filter); } // WGPU_EXPORT void wgpuDeviceSetDeviceLostCallback(WGPUDevice device, WGPUDeviceLostCallback callback, void * userdata); export fn wgpuDeviceSetDeviceLostCallback(device: gpu.Device, callback: gpu.DeviceLostCallback, userdata: *anyopaque) void { - Impl.deviceSetDeviceLostCallback(device, callback, userdata); + T.deviceSetDeviceLostCallback(device, callback, userdata); } // WGPU_EXPORT void wgpuDeviceSetLabel(WGPUDevice device, char const * label); export fn wgpuDeviceSetLabel(device: gpu.Device, label: [*:0]const u8) void { - Impl.deviceSetLabel(device, label); + T.deviceSetLabel(device, label); } // WGPU_EXPORT void wgpuDeviceSetLoggingCallback(WGPUDevice device, WGPULoggingCallback callback, void * userdata); export fn wgpuDeviceSetLoggingCallback(device: gpu.Device, callback: gpu.LoggingCallback, userdata: *anyopaque) void { - Impl.deviceSetLoggingCallback(device, callback, userdata); + T.deviceSetLoggingCallback(device, callback, userdata); } // WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata); export fn wgpuDeviceSetUncapturedErrorCallback(device: gpu.Device, callback: gpu.ErrorCallback, userdata: *anyopaque) void { - Impl.deviceSetUncapturedErrorCallback(device, callback, userdata); + T.deviceSetUncapturedErrorCallback(device, callback, userdata); } // WGPU_EXPORT void wgpuDeviceTick(WGPUDevice device); export fn wgpuDeviceTick(device: gpu.Device) void { - Impl.deviceTick(device); + T.deviceTick(device); } // WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device); export fn wgpuDeviceReference(device: gpu.Device) void { - Impl.deviceReference(device); + T.deviceReference(device); } // WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device); export fn wgpuDeviceRelease(device: gpu.Device) void { - Impl.deviceRelease(device); + T.deviceRelease(device); } // WGPU_EXPORT void wgpuExternalTextureDestroy(WGPUExternalTexture externalTexture); export fn wgpuExternalTextureDestroy(external_texture: gpu.ExternalTexture) void { - Impl.externalTextureDestroy(external_texture); + T.externalTextureDestroy(external_texture); } // WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture, char const * label); export fn wgpuExternalTextureSetLabel(external_texture: gpu.ExternalTexture, label: [*:0]const u8) void { - Impl.externalTextureSetLabel(external_texture, label); + T.externalTextureSetLabel(external_texture, label); } // WGPU_EXPORT void wgpuExternalTextureReference(WGPUExternalTexture externalTexture); export fn wgpuExternalTextureReference(external_texture: gpu.ExternalTexture) void { - Impl.externalTextureReference(external_texture); + T.externalTextureReference(external_texture); } // WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture); export fn wgpuExternalTextureRelease(external_texture: gpu.ExternalTexture) void { - Impl.externalTextureRelease(external_texture); + T.externalTextureRelease(external_texture); } // WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor); export fn wgpuInstanceCreateSurface(instance: gpu.Instance, descriptor: *const gpu.SurfaceDescriptor) gpu.Surface { - return Impl.instanceCreateSurface(instance, descriptor); + return T.instanceCreateSurface(instance, descriptor); } // WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata); export fn wgpuInstanceRequestAdapter(instance: gpu.Instance, options: *const gpu.RequestAdapterOptions, callback: gpu.RequestAdapterCallback, userdata: *anyopaque) void { - Impl.instanceRequestAdapter(instance, options, callback, userdata); + T.instanceRequestAdapter(instance, options, callback, userdata); } // WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance); export fn wgpuInstanceReference(instance: gpu.Instance) void { - Impl.instanceReference(instance); + T.instanceReference(instance); } // WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance); export fn wgpuInstanceRelease(instance: gpu.Instance) void { - Impl.instanceRelease(instance); + T.instanceRelease(instance); } // WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label); export fn wgpuPipelineLayoutSetLabel(pipeline_layout: gpu.PipelineLayout, label: [*:0]const u8) void { - Impl.pipelineLayoutSetLabel(pipeline_layout, label); + T.pipelineLayoutSetLabel(pipeline_layout, label); } // WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout); export fn wgpuPipelineLayoutReference(pipeline_layout: gpu.PipelineLayout) void { - Impl.pipelineLayoutReference(pipeline_layout); + T.pipelineLayoutReference(pipeline_layout); } // WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout); export fn wgpuPipelineLayoutRelease(pipeline_layout: gpu.PipelineLayout) void { - Impl.pipelineLayoutRelease(pipeline_layout); + T.pipelineLayoutRelease(pipeline_layout); } // WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet); export fn wgpuQuerySetDestroy(query_set: gpu.QuerySet) void { - Impl.querySetDestroy(query_set); + T.querySetDestroy(query_set); } // WGPU_EXPORT uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet); export fn wgpuQuerySetGetCount(query_set: gpu.QuerySet) u32 { - return Impl.querySetGetCount(query_set); + return T.querySetGetCount(query_set); } // WGPU_EXPORT WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet); export fn wgpuQuerySetGetType(query_set: gpu.QuerySet) gpu.QueryType { - return Impl.querySetGetType(query_set); + return T.querySetGetType(query_set); } // WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label); export fn wgpuQuerySetSetLabel(query_set: gpu.QuerySet, label: [*:0]const u8) void { - Impl.querySetSetLabel(query_set, label); + T.querySetSetLabel(query_set, label); } // WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet); export fn wgpuQuerySetReference(query_set: gpu.QuerySet) void { - Impl.querySetReference(query_set); + T.querySetReference(query_set); } // WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet); export fn wgpuQuerySetRelease(query_set: gpu.QuerySet) void { - Impl.querySetRelease(query_set); + T.querySetRelease(query_set); } // WGPU_EXPORT void wgpuQueueCopyTextureForBrowser(WGPUQueue queue, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize, WGPUCopyTextureForBrowserOptions const * options); export fn wgpuQueueCopyTextureForBrowser(queue: gpu.Queue, source: *const gpu.ImageCopyTexture, destination: *const gpu.ImageCopyTexture, copy_size: *const gpu.Extent3D, options: *const gpu.CopyTextureForBrowserOptions) void { - Impl.queueCopyTextureForBrowser(queue, source, destination, copy_size, options); + T.queueCopyTextureForBrowser(queue, source, destination, copy_size, options); } // WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, uint64_t signalValue, WGPUQueueWorkDoneCallback callback, void * userdata); export fn wgpuQueueOnSubmittedWorkDone(queue: gpu.Queue, signal_value: u64, callback: gpu.QueueWorkDoneCallback, userdata: *anyopaque) void { - Impl.queueOnSubmittedWorkDone(queue, signal_value, callback, userdata); + T.queueOnSubmittedWorkDone(queue, signal_value, callback, userdata); } // WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label); export fn wgpuQueueSetLabel(queue: gpu.Queue, label: [*:0]const u8) void { - Impl.queueSetLabel(queue, label); + T.queueSetLabel(queue, label); } // WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, uint32_t commandCount, WGPUCommandBuffer const * commands); export fn wgpuQueueSubmit(queue: gpu.Queue, command_count: u32, commands: [*]gpu.CommandBuffer) void { - Impl.queueSubmit(queue, command_count, commands); + T.queueSubmit(queue, command_count, commands); } // WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size); export fn wgpuQueueWriteBuffer(queue: gpu.Queue, buffer: gpu.Buffer, buffer_offset: u64, data: *anyopaque, size: usize) void { - Impl.queueWriteBuffer(queue, buffer, buffer_offset, data, size); + T.queueWriteBuffer(queue, buffer, buffer_offset, data, size); } // WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize); export fn wgpuQueueWriteTexture(queue: gpu.Queue, data: *anyopaque, data_size: usize, data_layout: *const gpu.TextureDataLayout, write_size: *const gpu.Extent3D) void { - Impl.queueWriteTexture(queue, data, data_size, data_layout, write_size); + T.queueWriteTexture(queue, data, data_size, data_layout, write_size); } // WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue); export fn wgpuQueueReference(queue: gpu.Queue) void { - Impl.queueReference(queue); + T.queueReference(queue); } // WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue); export fn wgpuQueueRelease(queue: gpu.Queue) void { - Impl.queueRelease(queue); + T.queueRelease(queue); } // WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle); export fn wgpuRenderBundleReference(render_bundle: gpu.RenderBundle) void { - Impl.renderBundleReference(render_bundle); + T.renderBundleReference(render_bundle); } // WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle); export fn wgpuRenderBundleRelease(render_bundle: gpu.RenderBundle) void { - Impl.renderBundleRelease(render_bundle); + T.renderBundleRelease(render_bundle); } // WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); export fn wgpuRenderBundleEncoderDraw(render_bundle_encoder: gpu.RenderBundleEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) void { - Impl.renderBundleEncoderDraw(render_bundle_encoder, vertex_count, instance_count, first_vertex, first_instance); + T.renderBundleEncoderDraw(render_bundle_encoder, vertex_count, instance_count, first_vertex, first_instance); } // WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); export fn wgpuRenderBundleEncoderDrawIndexed(render_bundle_encoder: gpu.RenderBundleEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) void { - Impl.renderBundleEncoderDrawIndexed(render_bundle_encoder, index_count, instance_count, first_index, base_vertex, first_instance); + T.renderBundleEncoderDrawIndexed(render_bundle_encoder, index_count, instance_count, first_index, base_vertex, first_instance); } // WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); export fn wgpuRenderBundleEncoderDrawIndexedIndirect(render_bundle_encoder: gpu.RenderBundleEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) void { - Impl.renderBundleEncoderDrawIndexedIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); + T.renderBundleEncoderDrawIndexedIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); } // WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); export fn wgpuRenderBundleEncoderDrawIndirect(render_bundle_encoder: gpu.RenderBundleEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) void { - Impl.renderBundleEncoderDrawIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); + T.renderBundleEncoderDrawIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); } // WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderBundleDescriptor const * descriptor /* nullable */); export fn wgpuRenderBundleEncoderFinish(render_bundle_encoder: gpu.RenderBundleEncoder, descriptor: ?*const gpu.RenderBundleDescriptor) void { - Impl.renderBundleEncoderFinish(render_bundle_encoder, descriptor); + T.renderBundleEncoderFinish(render_bundle_encoder, descriptor); } // WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel); export fn wgpuRenderBundleEncoderInsertDebugMarker(render_bundle_encoder: gpu.RenderBundleEncoder, marker_label: [*:0]const u8) void { - Impl.renderBundleEncoderInsertDebugMarker(render_bundle_encoder, marker_label); + T.renderBundleEncoderInsertDebugMarker(render_bundle_encoder, marker_label); } // WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder); export fn wgpuRenderBundleEncoderPopDebugGroup(render_bundle_encoder: gpu.RenderBundleEncoder) void { - Impl.renderBundleEncoderPopDebugGroup(render_bundle_encoder); + T.renderBundleEncoderPopDebugGroup(render_bundle_encoder); } // WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel); export fn wgpuRenderBundleEncoderPushDebugGroup(render_bundle_encoder: gpu.RenderBundleEncoder, group_label: [*:0]const u8) void { - Impl.renderBundleEncoderPushDebugGroup(render_bundle_encoder, group_label); + T.renderBundleEncoderPushDebugGroup(render_bundle_encoder, group_label); } // WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); export fn wgpuRenderBundleEncoderSetBindGroup(render_bundle_encoder: gpu.RenderBundleEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) void { - Impl.renderBundleEncoderSetBindGroup(render_bundle_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); + T.renderBundleEncoderSetBindGroup(render_bundle_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); } // WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); export fn wgpuRenderBundleEncoderSetIndexBuffer(render_bundle_encoder: gpu.RenderBundleEncoder, buffer: gpu.Buffer, format: gpu.IndexFormat, offset: u64, size: u64) void { - Impl.renderBundleEncoderSetIndexBuffer(render_bundle_encoder, buffer, format, offset, size); + T.renderBundleEncoderSetIndexBuffer(render_bundle_encoder, buffer, format, offset, size); } // WGPU_EXPORT void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, char const * label); export fn wgpuRenderBundleEncoderSetLabel(render_bundle_encoder: gpu.RenderBundleEncoder, label: [*:0]const u8) void { - Impl.renderBundleEncoderSetLabel(render_bundle_encoder, label); + T.renderBundleEncoderSetLabel(render_bundle_encoder, label); } // WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); export fn wgpuRenderBundleEncoderSetPipeline(render_bundle_encoder: gpu.RenderBundleEncoder, pipeline: gpu.RenderPipeline) void { - Impl.renderBundleEncoderSetPipeline(render_bundle_encoder, pipeline); + T.renderBundleEncoderSetPipeline(render_bundle_encoder, pipeline); } // WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); export fn wgpuRenderBundleEncoderSetVertexBuffer(render_bundle_encoder: gpu.RenderBundleEncoder, slot: u32, buffer: gpu.Buffer, offset: u64, size: u64) void { - Impl.renderBundleEncoderSetVertexBuffer(render_bundle_encoder, slot, buffer, offset, size); + T.renderBundleEncoderSetVertexBuffer(render_bundle_encoder, slot, buffer, offset, size); } // WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder); export fn wgpuRenderBundleEncoderReference(render_bundle_encoder: gpu.RenderBundleEncoder) void { - Impl.renderBundleEncoderReference(render_bundle_encoder); + T.renderBundleEncoderReference(render_bundle_encoder); } // WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder); export fn wgpuRenderBundleEncoderRelease(render_bundle_encoder: gpu.RenderBundleEncoder) void { - Impl.renderBundleEncoderRelease(render_bundle_encoder); + T.renderBundleEncoderRelease(render_bundle_encoder); } // WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex); export fn wgpuRenderPassEncoderBeginOcclusionQuery(render_pass_encoder: gpu.RenderPassEncoder, query_index: u32) void { - Impl.renderPassEncoderBeginOcclusionQuery(render_pass_encoder, query_index); + T.renderPassEncoderBeginOcclusionQuery(render_pass_encoder, query_index); } // WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); export fn wgpuRenderPassEncoderDraw(render_pass_encoder: gpu.RenderPassEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) void { - Impl.renderPassEncoderDraw(render_pass_encoder, vertex_count, instance_count, first_vertex, first_instance); + T.renderPassEncoderDraw(render_pass_encoder, vertex_count, instance_count, first_vertex, first_instance); } // WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance); export fn wgpuRenderPassEncoderDrawIndexed(render_pass_encoder: gpu.RenderPassEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) void { - Impl.renderPassEncoderDrawIndexed(render_pass_encoder, index_count, instance_count, first_index, base_vertex, first_instance); + T.renderPassEncoderDrawIndexed(render_pass_encoder, index_count, instance_count, first_index, base_vertex, first_instance); } // WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); export fn wgpuRenderPassEncoderDrawIndexedIndirect(render_pass_encoder: gpu.RenderPassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) void { - Impl.renderPassEncoderDrawIndexedIndirect(render_pass_encoder, indirect_buffer, indirect_offset); + T.renderPassEncoderDrawIndexedIndirect(render_pass_encoder, indirect_buffer, indirect_offset); } // WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset); export fn wgpuRenderPassEncoderDrawIndirect(render_pass_encoder: gpu.RenderPassEncoder, indirect_buffer: gpu.Buffer, indirect_offset: u64) void { - Impl.renderPassEncoderDrawIndirect(render_pass_encoder, indirect_buffer, indirect_offset); + T.renderPassEncoderDrawIndirect(render_pass_encoder, indirect_buffer, indirect_offset); } // WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder); export fn wgpuRenderPassEncoderEnd(render_pass_encoder: gpu.RenderPassEncoder) void { - Impl.renderPassEncoderEnd(render_pass_encoder); + T.renderPassEncoderEnd(render_pass_encoder); } // WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder); export fn wgpuRenderPassEncoderEndOcclusionQuery(render_pass_encoder: gpu.RenderPassEncoder) void { - Impl.renderPassEncoderEndOcclusionQuery(render_pass_encoder); + T.renderPassEncoderEndOcclusionQuery(render_pass_encoder); } // WGPU_EXPORT void wgpuRenderPassEncoderEndPass(WGPURenderPassEncoder renderPassEncoder); export fn wgpuRenderPassEncoderEndPass(render_pass_encoder: gpu.RenderPassEncoder) void { - Impl.renderPassEncoderEndPass(render_pass_encoder); + T.renderPassEncoderEndPass(render_pass_encoder); } // WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, uint32_t bundlesCount, WGPURenderBundle const * bundles); export fn wgpuRenderPassEncoderExecuteBundles(render_pass_encoder: gpu.RenderPassEncoder, bundles_count: u32, bundles: [*]const gpu.RenderBundle) void { - Impl.renderPassEncoderExecuteBundles(render_pass_encoder, bundles_count, bundles); + T.renderPassEncoderExecuteBundles(render_pass_encoder, bundles_count, bundles); } // WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel); export fn wgpuRenderPassEncoderInsertDebugMarker(render_pass_encoder: gpu.RenderPassEncoder, marker_label: [*:0]const u8) void { - Impl.renderPassEncoderInsertDebugMarker(render_pass_encoder, marker_label); + T.renderPassEncoderInsertDebugMarker(render_pass_encoder, marker_label); } // WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder); export fn wgpuRenderPassEncoderPopDebugGroup(render_pass_encoder: gpu.RenderPassEncoder) void { - Impl.renderPassEncoderPopDebugGroup(render_pass_encoder); + T.renderPassEncoderPopDebugGroup(render_pass_encoder); } // WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel); export fn wgpuRenderPassEncoderPushDebugGroup(render_pass_encoder: gpu.RenderPassEncoder, group_label: [*:0]const u8) void { - Impl.renderPassEncoderPushDebugGroup(render_pass_encoder, group_label); + T.renderPassEncoderPushDebugGroup(render_pass_encoder, group_label); } // WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets); export fn wgpuRenderPassEncoderSetBindGroup(render_pass_encoder: gpu.RenderPassEncoder, group_index: u32, group: gpu.BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) void { - Impl.renderPassEncoderSetBindGroup(render_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); + T.renderPassEncoderSetBindGroup(render_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); } // WGPU_EXPORT void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color); export fn wgpuRenderPassEncoderSetBlendConstant(render_pass_encoder: gpu.RenderPassEncoder, color: *const gpu.Color) void { - Impl.renderPassEncoderSetBlendConstant(render_pass_encoder, color); + T.renderPassEncoderSetBlendConstant(render_pass_encoder, color); } // WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size); export fn wgpuRenderPassEncoderSetIndexBuffer(render_pass_encoder: gpu.RenderPassEncoder, buffer: gpu.Buffer, format: gpu.IndexFormat, offset: u64, size: u64) void { - Impl.renderPassEncoderSetIndexBuffer(render_pass_encoder, buffer, format, offset, size); + T.renderPassEncoderSetIndexBuffer(render_pass_encoder, buffer, format, offset, size); } // WGPU_EXPORT void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, char const * label); export fn wgpuRenderPassEncoderSetLabel(render_pass_encoder: gpu.RenderPassEncoder, label: [*:0]const u8) void { - Impl.renderPassEncoderSetLabel(render_pass_encoder, label); + T.renderPassEncoderSetLabel(render_pass_encoder, label); } // WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); export fn wgpuRenderPassEncoderSetPipeline(render_pass_encoder: gpu.RenderPassEncoder, pipeline: gpu.RenderPipeline) void { - Impl.renderPassEncoderSetPipeline(render_pass_encoder, pipeline); + T.renderPassEncoderSetPipeline(render_pass_encoder, pipeline); } // WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height); export fn wgpuRenderPassEncoderSetScissorRect(render_pass_encoder: gpu.RenderPassEncoder, x: u32, y: u32, width: u32, height: u32) void { - Impl.renderPassEncoderSetScissorRect(render_pass_encoder, x, y, width, height); + T.renderPassEncoderSetScissorRect(render_pass_encoder, x, y, width, height); } // WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference); export fn wgpuRenderPassEncoderSetStencilReference(render_pass_encoder: gpu.RenderPassEncoder, reference: u32) void { - Impl.renderPassEncoderSetStencilReference(render_pass_encoder, reference); + T.renderPassEncoderSetStencilReference(render_pass_encoder, reference); } // WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPUBuffer buffer, uint64_t offset, uint64_t size); export fn wgpuRenderPassEncoderSetVertexBuffer(render_pass_encoder: gpu.RenderPassEncoder, slot: u32, buffer: gpu.Buffer, offset: u64, size: u64) void { - Impl.renderPassEncoderSetVertexBuffer(render_pass_encoder, slot, buffer, offset, size); + T.renderPassEncoderSetVertexBuffer(render_pass_encoder, slot, buffer, offset, size); } // WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth); export fn wgpuRenderPassEncoderSetViewport(render_pass_encoder: gpu.RenderPassEncoder, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) void { - Impl.renderPassEncoderSetViewport(render_pass_encoder, x, y, width, height, min_depth, max_depth); + T.renderPassEncoderSetViewport(render_pass_encoder, x, y, width, height, min_depth, max_depth); } // WGPU_EXPORT void wgpuRenderPassEncoderWriteTimestamp(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); export fn wgpuRenderPassEncoderWriteTimestamp(render_pass_encoder: gpu.RenderPassEncoder, query_set: gpu.QuerySet, query_index: u32) void { - Impl.renderPassEncoderWriteTimestamp(render_pass_encoder, query_set, query_index); + T.renderPassEncoderWriteTimestamp(render_pass_encoder, query_set, query_index); } // WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder); export fn wgpuRenderPassEncoderReference(render_pass_encoder: gpu.RenderPassEncoder) void { - Impl.renderPassEncoderReference(render_pass_encoder); + T.renderPassEncoderReference(render_pass_encoder); } // WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder); export fn wgpuRenderPassEncoderRelease(render_pass_encoder: gpu.RenderPassEncoder) void { - Impl.renderPassEncoderRelease(render_pass_encoder); + T.renderPassEncoderRelease(render_pass_encoder); } // WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex); export fn wgpuRenderPipelineGetBindGroupLayout(render_pipeline: gpu.RenderPipeline, group_index: u32) gpu.BindGroupLayout { - return Impl.renderPipelineGetBindGroupLayout(render_pipeline, group_index); + return T.renderPipelineGetBindGroupLayout(render_pipeline, group_index); } // WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label); export fn wgpuRenderPipelineSetLabel(render_pipeline: gpu.RenderPipeline, label: [*:0]const u8) void { - Impl.renderPipelineSetLabel(render_pipeline, label); + T.renderPipelineSetLabel(render_pipeline, label); } // WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline); export fn wgpuRenderPipelineReference(render_pipeline: gpu.RenderPipeline) void { - Impl.renderPipelineReference(render_pipeline); + T.renderPipelineReference(render_pipeline); } // WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline); export fn wgpuRenderPipelineRelease(render_pipeline: gpu.RenderPipeline) void { - Impl.renderPipelineRelease(render_pipeline); + T.renderPipelineRelease(render_pipeline); } // WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label); export fn wgpuSamplerSetLabel(sampler: gpu.Sampler, label: [*:0]const u8) void { - Impl.samplerSetLabel(sampler, label); + T.samplerSetLabel(sampler, label); } // WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler); export fn wgpuSamplerReference(sampler: gpu.Sampler) void { - Impl.samplerReference(sampler); + T.samplerReference(sampler); } // WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler); export fn wgpuSamplerRelease(sampler: gpu.Sampler) void { - Impl.samplerRelease(sampler); + T.samplerRelease(sampler); } // WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata); export fn wgpuShaderModuleGetCompilationInfo(shader_module: gpu.ShaderModule, callback: gpu.CompilationInfoCallback, userdata: *anyopaque) void { - Impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata); + T.shaderModuleGetCompilationInfo(shader_module, callback, userdata); } // WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label); export fn wgpuShaderModuleSetLabel(shader_module: gpu.ShaderModule, label: [*:0]const u8) void { - Impl.shaderModuleSetLabel(shader_module, label); + T.shaderModuleSetLabel(shader_module, label); } // WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule); export fn wgpuShaderModuleReference(shader_module: gpu.ShaderModule) void { - Impl.shaderModuleReference(shader_module); + T.shaderModuleReference(shader_module); } // WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule); export fn wgpuShaderModuleRelease(shader_module: gpu.ShaderModule) void { - Impl.shaderModuleRelease(shader_module); + T.shaderModuleRelease(shader_module); } // WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface); export fn wgpuSurfaceReference(surface: gpu.Surface) void { - Impl.surfaceReference(surface); + T.surfaceReference(surface); } // WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface); export fn wgpuSurfaceRelease(surface: gpu.Surface) void { - Impl.surfaceRelease(surface); + T.surfaceRelease(surface); } // TODO: Zig cannot currently export a packed struct gpu.TextureUsageFlags, so we use a u32 // for now. // WGPU_EXPORT void wgpuSwapChainConfigure(WGPUSwapChain swapChain, WGPUTextureFormat format, WGPUTextureUsageFlags allowedUsage, uint32_t width, uint32_t height); export fn wgpuSwapChainConfigure(swap_chain: gpu.SwapChain, format: gpu.TextureFormat, allowed_usage: u32, width: u32, height: u32) void { - Impl.swapChainConfigure(swap_chain, format, @bitCast(gpu.TextureUsageFlags, allowed_usage), width, height); + T.swapChainConfigure(swap_chain, format, @bitCast(gpu.TextureUsageFlags, allowed_usage), width, height); } // WGPU_EXPORT WGPUTextureView wgpuSwapChainGetCurrentTextureView(WGPUSwapChain swapChain); export fn wgpuSwapChainGetCurrentTextureView(swap_chain: gpu.SwapChain) gpu.TextureView { - return Impl.swapChainGetCurrentTextureView(swap_chain); + return T.swapChainGetCurrentTextureView(swap_chain); } // WGPU_EXPORT void wgpuSwapChainPresent(WGPUSwapChain swapChain); export fn wgpuSwapChainPresent(swap_chain: gpu.SwapChain) void { - Impl.swapChainPresent(swap_chain); + T.swapChainPresent(swap_chain); } // WGPU_EXPORT void wgpuSwapChainReference(WGPUSwapChain swapChain); export fn wgpuSwapChainReference(swap_chain: gpu.SwapChain) void { - Impl.swapChainReference(swap_chain); + T.swapChainReference(swap_chain); } // WGPU_EXPORT void wgpuSwapChainRelease(WGPUSwapChain swapChain); export fn wgpuSwapChainRelease(swap_chain: gpu.SwapChain) void { - Impl.swapChainRelease(swap_chain); + T.swapChainRelease(swap_chain); } // WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor const * descriptor /* nullable */); export fn wgpuTextureCreateView(texture: gpu.Texture, descriptor: ?*const gpu.TextureViewDescriptor) gpu.TextureView { - return Impl.textureCreateView(texture, descriptor); + return T.textureCreateView(texture, descriptor); } // WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture); export fn wgpuTextureDestroy(texture: gpu.Texture) void { - Impl.textureDestroy(texture); + T.textureDestroy(texture); } // WGPU_EXPORT uint32_t wgpuTextureGetDepthOrArrayLayers(WGPUTexture texture); export fn wgpuTextureGetDepthOrArrayLayers(texture: gpu.Texture) u32 { - return Impl.textureGetDepthOrArrayLayers(texture); + return T.textureGetDepthOrArrayLayers(texture); } // WGPU_EXPORT WGPUTextureDimension wgpuTextureGetDimension(WGPUTexture texture); export fn wgpuTextureGetDimension(texture: gpu.Texture) gpu.TextureDimension { - return Impl.textureGetDimension(texture); + return T.textureGetDimension(texture); } // WGPU_EXPORT WGPUTextureFormat wgpuTextureGetFormat(WGPUTexture texture); export fn wgpuTextureGetFormat(texture: gpu.Texture) gpu.TextureFormat { - return Impl.textureGetFormat(texture); + return T.textureGetFormat(texture); } // WGPU_EXPORT uint32_t wgpuTextureGetHeight(WGPUTexture texture); export fn wgpuTextureGetHeight(texture: gpu.Texture) u32 { - return Impl.textureGetHeight(texture); + return T.textureGetHeight(texture); } // WGPU_EXPORT uint32_t wgpuTextureGetMipLevelCount(WGPUTexture texture); export fn wgpuTextureGetMipLevelCount(texture: gpu.Texture) u32 { - return Impl.textureGetMipLevelCount(texture); + return T.textureGetMipLevelCount(texture); } // WGPU_EXPORT uint32_t wgpuTextureGetSampleCount(WGPUTexture texture); export fn wgpuTextureGetSampleCount(texture: gpu.Texture) u32 { - return Impl.textureGetSampleCount(texture); + return T.textureGetSampleCount(texture); } // WGPU_EXPORT WGPUTextureUsage wgpuTextureGetUsage(WGPUTexture texture); export fn wgpuTextureGetUsage(texture: gpu.Texture) gpu.TextureUsageFlags { - return Impl.textureGetUsage(texture); + return T.textureGetUsage(texture); } // WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture); export fn wgpuTextureGetWidth(texture: gpu.Texture) u32 { - return Impl.textureGetWidth(texture); + return T.textureGetWidth(texture); } // WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, char const * label); export fn wgpuTextureSetLabel(texture: gpu.Texture, label: [*:0]const u8) void { - Impl.textureSetLabel(texture, label); + T.textureSetLabel(texture, label); } // WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture); export fn wgpuTextureReference(texture: gpu.Texture) void { - Impl.textureReference(texture); + T.textureReference(texture); } // WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture); export fn wgpuTextureRelease(texture: gpu.Texture) void { - Impl.textureRelease(texture); + T.textureRelease(texture); } // WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label); export fn wgpuTextureViewSetLabel(texture_view: gpu.TextureView, label: [*:0]const u8) void { - Impl.textureViewSetLabel(texture_view, label); + T.textureViewSetLabel(texture_view, label); } // WGPU_EXPORT void wgpuTextureViewReference(WGPUTextureView textureView); export fn wgpuTextureViewReference(texture_view: gpu.TextureView) void { - Impl.textureViewReference(texture_view); + T.textureViewReference(texture_view); } // WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView); export fn wgpuTextureViewRelease(texture_view: gpu.TextureView) void { - Impl.textureViewRelease(texture_view); + T.textureViewRelease(texture_view); } }; } diff --git a/gpu/src/pipeline_layout.zig b/gpu/src/pipeline_layout.zig index 061bb161..f102ecd2 100644 --- a/gpu/src/pipeline_layout.zig +++ b/gpu/src/pipeline_layout.zig @@ -1,18 +1,18 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const PipelineLayout = *opaque { pub inline fn setLabel(pipeline_layout: PipelineLayout, label: [*:0]const u8) void { - impl.pipelineLayoutSetLabel(pipeline_layout, label); + Impl.pipelineLayoutSetLabel(pipeline_layout, label); } pub inline fn reference(pipeline_layout: PipelineLayout) void { - impl.pipelineLayoutReference(pipeline_layout); + Impl.pipelineLayoutReference(pipeline_layout); } pub inline fn release(pipeline_layout: PipelineLayout) void { - impl.pipelineLayoutRelease(pipeline_layout); + Impl.pipelineLayoutRelease(pipeline_layout); } }; diff --git a/gpu/src/query_set.zig b/gpu/src/query_set.zig index 9b2e539a..0a368db1 100644 --- a/gpu/src/query_set.zig +++ b/gpu/src/query_set.zig @@ -1,31 +1,31 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const PipelineStatisticName = @import("types.zig").PipelineStatisticName; const QueryType = @import("types.zig").QueryType; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const QuerySet = *opaque { pub inline fn destroy(query_set: QuerySet) void { - impl.querySetDestroy(query_set); + Impl.querySetDestroy(query_set); } pub inline fn getCount(query_set: QuerySet) u32 { - return impl.querySetGetCount(query_set); + return Impl.querySetGetCount(query_set); } pub inline fn getType(query_set: QuerySet) QueryType { - return impl.querySetGetType(query_set); + return Impl.querySetGetType(query_set); } pub inline fn setLabel(query_set: QuerySet, label: [*:0]const u8) void { - impl.querySetSetLabel(query_set, label); + Impl.querySetSetLabel(query_set, label); } pub inline fn reference(query_set: QuerySet) void { - impl.querySetReference(query_set); + Impl.querySetReference(query_set); } pub inline fn release(query_set: QuerySet) void { - impl.querySetRelease(query_set); + Impl.querySetRelease(query_set); } }; diff --git a/gpu/src/queue.zig b/gpu/src/queue.zig index eef79877..6508b684 100644 --- a/gpu/src/queue.zig +++ b/gpu/src/queue.zig @@ -5,39 +5,39 @@ const ImageCopyTexture = @import("types.zig").ImageCopyTexture; const ChainedStruct = @import("types.zig").ChainedStruct; const Extent3D = @import("types.zig").Extent3D; const CopyTextureForBrowserOptions = @import("types.zig").CopyTextureForBrowserOptions; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Queue = *opaque { pub inline fn copyTextureForBrowser(queue: Queue, source: *const ImageCopyTexture, destination: *const ImageCopyTexture, copy_size: *const Extent3D, options: *const CopyTextureForBrowserOptions) void { - impl.queueCopyTextureForBrowser(queue, source, destination, copy_size, options); + Impl.queueCopyTextureForBrowser(queue, source, destination, copy_size, options); } pub inline fn onSubmittedWorkDone(queue: Queue, signal_value: u64, callback: QueueWorkDoneCallback, userdata: *anyopaque) void { - impl.queueOnSubmittedWorkDone(queue, signal_value, callback, userdata); + Impl.queueOnSubmittedWorkDone(queue, signal_value, callback, userdata); } pub inline fn setLabel(queue: Queue, label: [*:0]const u8) void { - impl.queueSetLabel(queue, label); + Impl.queueSetLabel(queue, label); } pub inline fn submit(queue: Queue, command_count: u32, commands: [*]CommandBuffer) void { - impl.queueSubmit(queue, command_count, commands); + Impl.queueSubmit(queue, command_count, commands); } pub inline fn writeBuffer(queue: Queue, buffer: Buffer, buffer_offset: u64, data: *anyopaque, size: usize) void { - impl.queueWriteBuffer(queue, buffer, buffer_offset, data, size); + Impl.queueWriteBuffer(queue, buffer, buffer_offset, data, size); } pub inline fn writeTexture(queue: Queue, data: *anyopaque, data_size: usize, data_layout: *const TextureDataLayout, write_size: *const Extent3D) void { - impl.queueWriteTexture(queue, data, data_size, data_layout, write_size); + Impl.queueWriteTexture(queue, data, data_size, data_layout, write_size); } pub inline fn reference(queue: Queue) void { - impl.queueReference(queue); + Impl.queueReference(queue); } pub inline fn release(queue: Queue) void { - impl.queueRelease(queue); + Impl.queueRelease(queue); } }; diff --git a/gpu/src/render_bundle.zig b/gpu/src/render_bundle.zig index 374ca498..5821683d 100644 --- a/gpu/src/render_bundle.zig +++ b/gpu/src/render_bundle.zig @@ -1,13 +1,13 @@ const ChainedStruct = @import("types.zig").ChainedStruct; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const RenderBundle = *opaque { pub inline fn reference(render_bundle: RenderBundle) void { - impl.renderBundleReference(render_bundle); + Impl.renderBundleReference(render_bundle); } pub inline fn release(render_bundle: RenderBundle) void { - impl.renderBundleRelease(render_bundle); + Impl.renderBundleRelease(render_bundle); } }; diff --git a/gpu/src/render_bundle_encoder.zig b/gpu/src/render_bundle_encoder.zig index 669d7ce0..afd54e0d 100644 --- a/gpu/src/render_bundle_encoder.zig +++ b/gpu/src/render_bundle_encoder.zig @@ -6,67 +6,67 @@ const BindGroup = @import("bind_group.zig").BindGroup; const RenderPipeline = @import("render_pipeline.zig").RenderPipeline; const ChainedStruct = @import("types.zig").ChainedStruct; const IndexFormat = @import("types.zig").IndexFormat; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const RenderBundleEncoder = *opaque { pub inline fn draw(render_bundle_encoder: RenderBundleEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) void { - impl.renderBundleEncoderDraw(render_bundle_encoder, vertex_count, instance_count, first_vertex, first_instance); + Impl.renderBundleEncoderDraw(render_bundle_encoder, vertex_count, instance_count, first_vertex, first_instance); } pub inline fn drawIndexed(render_bundle_encoder: RenderBundleEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) void { - impl.renderBundleEncoderDrawIndexed(render_bundle_encoder, index_count, instance_count, first_index, base_vertex, first_instance); + Impl.renderBundleEncoderDrawIndexed(render_bundle_encoder, index_count, instance_count, first_index, base_vertex, first_instance); } pub inline fn drawIndexedIndirect(render_bundle_encoder: RenderBundleEncoder, indirect_buffer: Buffer, indirect_offset: u64) void { - impl.renderBundleEncoderDrawIndexedIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); + Impl.renderBundleEncoderDrawIndexedIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); } pub inline fn drawIndirect(render_bundle_encoder: RenderBundleEncoder, indirect_buffer: Buffer, indirect_offset: u64) void { - impl.renderBundleEncoderDrawIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); + Impl.renderBundleEncoderDrawIndirect(render_bundle_encoder, indirect_buffer, indirect_offset); } pub inline fn finish(render_bundle_encoder: RenderBundleEncoder, descriptor: ?*const RenderBundleDescriptor) void { - impl.renderBundleEncoderFinish(render_bundle_encoder, descriptor); + Impl.renderBundleEncoderFinish(render_bundle_encoder, descriptor); } pub inline fn insertDebugMarker(render_bundle_encoder: RenderBundleEncoder, marker_label: [*:0]const u8) void { - impl.renderBundleEncoderInsertDebugMarker(render_bundle_encoder, marker_label); + Impl.renderBundleEncoderInsertDebugMarker(render_bundle_encoder, marker_label); } pub inline fn popDebugGroup(render_bundle_encoder: RenderBundleEncoder) void { - impl.renderBundleEncoderPopDebugGroup(render_bundle_encoder); + Impl.renderBundleEncoderPopDebugGroup(render_bundle_encoder); } pub inline fn pushDebugGroup(render_bundle_encoder: RenderBundleEncoder, group_label: [*:0]const u8) void { - impl.renderBundleEncoderPushDebugGroup(render_bundle_encoder, group_label); + Impl.renderBundleEncoderPushDebugGroup(render_bundle_encoder, group_label); } pub inline fn setBindGroup(render_bundle_encoder: RenderBundleEncoder, group_index: u32, group: BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) void { - impl.renderBundleEncoderSetBindGroup(render_bundle_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); + Impl.renderBundleEncoderSetBindGroup(render_bundle_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); } pub inline fn setIndexBuffer(render_bundle_encoder: RenderBundleEncoder, buffer: Buffer, format: IndexFormat, offset: u64, size: u64) void { - impl.renderBundleEncoderSetIndexBuffer(render_bundle_encoder, buffer, format, offset, size); + Impl.renderBundleEncoderSetIndexBuffer(render_bundle_encoder, buffer, format, offset, size); } pub inline fn setLabel(render_bundle_encoder: RenderBundleEncoder, label: [*:0]const u8) void { - impl.renderBundleEncoderSetLabel(render_bundle_encoder, label); + Impl.renderBundleEncoderSetLabel(render_bundle_encoder, label); } pub inline fn setPipeline(render_bundle_encoder: RenderBundleEncoder, pipeline: RenderPipeline) void { - impl.renderBundleEncoderSetPipeline(render_bundle_encoder, pipeline); + Impl.renderBundleEncoderSetPipeline(render_bundle_encoder, pipeline); } pub inline fn setVertexBuffer(render_bundle_encoder: RenderBundleEncoder, slot: u32, buffer: Buffer, offset: u64, size: u64) void { - impl.renderBundleEncoderSetVertexBuffer(render_bundle_encoder, slot, buffer, offset, size); + Impl.renderBundleEncoderSetVertexBuffer(render_bundle_encoder, slot, buffer, offset, size); } pub inline fn reference(render_bundle_encoder: RenderBundleEncoder) void { - impl.renderBundleEncoderReference(render_bundle_encoder); + Impl.renderBundleEncoderReference(render_bundle_encoder); } pub inline fn release(render_bundle_encoder: RenderBundleEncoder) void { - impl.renderBundleEncoderRelease(render_bundle_encoder); + Impl.renderBundleEncoderRelease(render_bundle_encoder); } }; diff --git a/gpu/src/render_pass_encoder.zig b/gpu/src/render_pass_encoder.zig index fd9c1de0..ab34c088 100644 --- a/gpu/src/render_pass_encoder.zig +++ b/gpu/src/render_pass_encoder.zig @@ -5,102 +5,102 @@ const RenderPipeline = @import("render_pipeline.zig").RenderPipeline; const QuerySet = @import("query_set.zig").QuerySet; const Color = @import("types.zig").Color; const IndexFormat = @import("types.zig").IndexFormat; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const RenderPassEncoder = *opaque { pub inline fn beginOcclusionQuery(render_pass_encoder: RenderPassEncoder, query_index: u32) void { - impl.renderPassEncoderBeginOcclusionQuery(render_pass_encoder, query_index); + Impl.renderPassEncoderBeginOcclusionQuery(render_pass_encoder, query_index); } pub inline fn draw(render_pass_encoder: RenderPassEncoder, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32) void { - impl.renderPassEncoderDraw(render_pass_encoder, vertex_count, instance_count, first_vertex, first_instance); + Impl.renderPassEncoderDraw(render_pass_encoder, vertex_count, instance_count, first_vertex, first_instance); } pub inline fn drawIndexed(render_pass_encoder: RenderPassEncoder, index_count: u32, instance_count: u32, first_index: u32, base_vertex: u32, first_instance: u32) void { - impl.renderPassEncoderDrawIndexed(render_pass_encoder, index_count, instance_count, first_index, base_vertex, first_instance); + Impl.renderPassEncoderDrawIndexed(render_pass_encoder, index_count, instance_count, first_index, base_vertex, first_instance); } pub inline fn drawIndexedIndirect(render_pass_encoder: RenderPassEncoder, indirect_buffer: Buffer, indirect_offset: u64) void { - impl.renderPassEncoderDrawIndexedIndirect(render_pass_encoder, indirect_buffer, indirect_offset); + Impl.renderPassEncoderDrawIndexedIndirect(render_pass_encoder, indirect_buffer, indirect_offset); } pub inline fn drawIndirect(render_pass_encoder: RenderPassEncoder, indirect_buffer: Buffer, indirect_offset: u64) void { - impl.renderPassEncoderDrawIndirect(render_pass_encoder, indirect_buffer, indirect_offset); + Impl.renderPassEncoderDrawIndirect(render_pass_encoder, indirect_buffer, indirect_offset); } pub inline fn end(render_pass_encoder: RenderPassEncoder) void { - impl.renderPassEncoderEnd(render_pass_encoder); + Impl.renderPassEncoderEnd(render_pass_encoder); } pub inline fn endOcclusionQuery(render_pass_encoder: RenderPassEncoder) void { - impl.renderPassEncoderEndOcclusionQuery(render_pass_encoder); + Impl.renderPassEncoderEndOcclusionQuery(render_pass_encoder); } pub inline fn endPass(render_pass_encoder: RenderPassEncoder) void { - impl.renderPassEncoderEndPass(render_pass_encoder); + Impl.renderPassEncoderEndPass(render_pass_encoder); } pub inline fn executeBundles(render_pass_encoder: RenderPassEncoder, bundles_count: u32, bundles: [*]const RenderBundle) void { - impl.renderPassEncoderExecuteBundles(render_pass_encoder, bundles_count, bundles); + Impl.renderPassEncoderExecuteBundles(render_pass_encoder, bundles_count, bundles); } pub inline fn insertDebugMarker(render_pass_encoder: RenderPassEncoder, marker_label: [*:0]const u8) void { - impl.renderPassEncoderInsertDebugMarker(render_pass_encoder, marker_label); + Impl.renderPassEncoderInsertDebugMarker(render_pass_encoder, marker_label); } pub inline fn popDebugGroup(render_pass_encoder: RenderPassEncoder) void { - impl.renderPassEncoderPopDebugGroup(render_pass_encoder); + Impl.renderPassEncoderPopDebugGroup(render_pass_encoder); } pub inline fn pushDebugGroup(render_pass_encoder: RenderPassEncoder, group_label: [*:0]const u8) void { - impl.renderPassEncoderPushDebugGroup(render_pass_encoder, group_label); + Impl.renderPassEncoderPushDebugGroup(render_pass_encoder, group_label); } pub inline fn setBindGroup(render_pass_encoder: RenderPassEncoder, group_index: u32, group: BindGroup, dynamic_offset_count: u32, dynamic_offsets: [*]const u32) void { - impl.renderPassEncoderSetBindGroup(render_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); + Impl.renderPassEncoderSetBindGroup(render_pass_encoder, group_index, group, dynamic_offset_count, dynamic_offsets); } pub inline fn setBlendConstant(render_pass_encoder: RenderPassEncoder, color: *const Color) void { - impl.renderPassEncoderSetBlendConstant(render_pass_encoder, color); + Impl.renderPassEncoderSetBlendConstant(render_pass_encoder, color); } pub inline fn setIndexBuffer(render_pass_encoder: RenderPassEncoder, buffer: Buffer, format: IndexFormat, offset: u64, size: u64) void { - impl.renderPassEncoderSetIndexBuffer(render_pass_encoder, buffer, format, offset, size); + Impl.renderPassEncoderSetIndexBuffer(render_pass_encoder, buffer, format, offset, size); } pub inline fn setLabel(render_pass_encoder: RenderPassEncoder, label: [*:0]const u8) void { - impl.renderPassEncoderSetLabel(render_pass_encoder, label); + Impl.renderPassEncoderSetLabel(render_pass_encoder, label); } pub inline fn setPipeline(render_pass_encoder: RenderPassEncoder, pipeline: RenderPipeline) void { - impl.renderPassEncoderSetPipeline(render_pass_encoder, pipeline); + Impl.renderPassEncoderSetPipeline(render_pass_encoder, pipeline); } pub inline fn setScissorRect(render_pass_encoder: RenderPassEncoder, x: u32, y: u32, width: u32, height: u32) void { - impl.renderPassEncoderSetScissorRect(render_pass_encoder, x, y, width, height); + Impl.renderPassEncoderSetScissorRect(render_pass_encoder, x, y, width, height); } pub inline fn setStencilReference(render_pass_encoder: RenderPassEncoder, _reference: u32) void { - impl.renderPassEncoderSetStencilReference(render_pass_encoder, _reference); + Impl.renderPassEncoderSetStencilReference(render_pass_encoder, _reference); } pub inline fn setVertexBuffer(render_pass_encoder: RenderPassEncoder, slot: u32, buffer: Buffer, offset: u64, size: u64) void { - impl.renderPassEncoderSetVertexBuffer(render_pass_encoder, slot, buffer, offset, size); + Impl.renderPassEncoderSetVertexBuffer(render_pass_encoder, slot, buffer, offset, size); } pub inline fn setViewport(render_pass_encoder: RenderPassEncoder, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) void { - impl.renderPassEncoderSetViewport(render_pass_encoder, x, y, width, height, min_depth, max_depth); + Impl.renderPassEncoderSetViewport(render_pass_encoder, x, y, width, height, min_depth, max_depth); } pub inline fn writeTimestamp(render_pass_encoder: RenderPassEncoder, query_set: QuerySet, query_index: u32) void { - impl.renderPassEncoderWriteTimestamp(render_pass_encoder, query_set, query_index); + Impl.renderPassEncoderWriteTimestamp(render_pass_encoder, query_set, query_index); } pub inline fn reference(render_pass_encoder: RenderPassEncoder) void { - impl.renderPassEncoderReference(render_pass_encoder); + Impl.renderPassEncoderReference(render_pass_encoder); } pub inline fn release(render_pass_encoder: RenderPassEncoder) void { - impl.renderPassEncoderRelease(render_pass_encoder); + Impl.renderPassEncoderRelease(render_pass_encoder); } }; diff --git a/gpu/src/render_pipeline.zig b/gpu/src/render_pipeline.zig index 0c967d6f..7bd8e93b 100644 --- a/gpu/src/render_pipeline.zig +++ b/gpu/src/render_pipeline.zig @@ -6,23 +6,23 @@ const PrimitiveState = @import("types.zig").PrimitiveState; const FragmentState = @import("types.zig").FragmentState; const PipelineLayout = @import("pipeline_layout.zig").PipelineLayout; const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const RenderPipeline = *opaque { pub inline fn getBindGroupLayout(render_pipeline: RenderPipeline, group_index: u32) BindGroupLayout { - return impl.renderPipelineGetBindGroupLayout(render_pipeline, group_index); + return Impl.renderPipelineGetBindGroupLayout(render_pipeline, group_index); } pub inline fn setLabel(render_pipeline: RenderPipeline, label: [*:0]const u8) void { - impl.renderPipelineSetLabel(render_pipeline, label); + Impl.renderPipelineSetLabel(render_pipeline, label); } pub inline fn reference(render_pipeline: RenderPipeline) void { - impl.renderPipelineReference(render_pipeline); + Impl.renderPipelineReference(render_pipeline); } pub inline fn release(render_pipeline: RenderPipeline) void { - impl.renderPipelineRelease(render_pipeline); + Impl.renderPipelineRelease(render_pipeline); } }; diff --git a/gpu/src/sampler.zig b/gpu/src/sampler.zig index edcf13bc..5826eff2 100644 --- a/gpu/src/sampler.zig +++ b/gpu/src/sampler.zig @@ -1,19 +1,19 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const FilterMode = @import("types.zig").FilterMode; const CompareFunction = @import("types.zig").CompareFunction; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Sampler = *opaque { pub inline fn setLabel(sampler: Sampler, label: [*:0]const u8) void { - impl.samplerSetLabel(sampler, label); + Impl.samplerSetLabel(sampler, label); } pub inline fn reference(sampler: Sampler) void { - impl.samplerReference(sampler); + Impl.samplerReference(sampler); } pub inline fn release(sampler: Sampler) void { - impl.samplerRelease(sampler); + Impl.samplerRelease(sampler); } }; diff --git a/gpu/src/shader_module.zig b/gpu/src/shader_module.zig index 945859af..17794407 100644 --- a/gpu/src/shader_module.zig +++ b/gpu/src/shader_module.zig @@ -1,22 +1,22 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const CompilationInfoCallback = @import("types.zig").CompilationInfoCallback; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const ShaderModule = *opaque { pub inline fn getCompilationInfo(shader_module: ShaderModule, callback: CompilationInfoCallback, userdata: *anyopaque) void { - impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata); + Impl.shaderModuleGetCompilationInfo(shader_module, callback, userdata); } pub inline fn setLabel(shader_module: ShaderModule, label: [*:0]const u8) void { - impl.shaderModuleSetLabel(shader_module, label); + Impl.shaderModuleSetLabel(shader_module, label); } pub inline fn reference(shader_module: ShaderModule) void { - impl.shaderModuleReference(shader_module); + Impl.shaderModuleReference(shader_module); } pub inline fn release(shader_module: ShaderModule) void { - impl.shaderModuleRelease(shader_module); + Impl.shaderModuleRelease(shader_module); } }; diff --git a/gpu/src/surface.zig b/gpu/src/surface.zig index 70aa52fe..26ca64ab 100644 --- a/gpu/src/surface.zig +++ b/gpu/src/surface.zig @@ -1,13 +1,13 @@ const ChainedStruct = @import("types.zig").ChainedStruct; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Surface = *opaque { pub inline fn reference(surface: Surface) void { - impl.surfaceReference(surface); + Impl.surfaceReference(surface); } pub inline fn release(surface: Surface) void { - impl.surfaceRelease(surface); + Impl.surfaceRelease(surface); } }; diff --git a/gpu/src/swap_chain.zig b/gpu/src/swap_chain.zig index 782326ad..16563b5d 100644 --- a/gpu/src/swap_chain.zig +++ b/gpu/src/swap_chain.zig @@ -4,27 +4,27 @@ const Texture = @import("texture.zig").Texture; const TextureUsageFlags = @import("texture.zig").TextureUsageFlags; const TextureFormat = @import("texture.zig").TextureFormat; const TextureView = @import("texture_view.zig").TextureView; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const SwapChain = *opaque { pub inline fn configure(swap_chain: SwapChain, format: TextureFormat, allowed_usage: TextureUsageFlags, width: u32, height: u32) void { - impl.swapChainConfigure(swap_chain, format, allowed_usage, width, height); + Impl.swapChainConfigure(swap_chain, format, allowed_usage, width, height); } pub inline fn getCurrentTextureView(swap_chain: SwapChain) TextureView { - return impl.swapChainGetCurrentTextureView(swap_chain); + return Impl.swapChainGetCurrentTextureView(swap_chain); } pub inline fn present(swap_chain: SwapChain) void { - impl.swapChainPresent(swap_chain); + Impl.swapChainPresent(swap_chain); } pub inline fn reference(swap_chain: SwapChain) void { - impl.swapChainReference(swap_chain); + Impl.swapChainReference(swap_chain); } pub inline fn release(swap_chain: SwapChain) void { - impl.swapChainRelease(swap_chain); + Impl.swapChainRelease(swap_chain); } }; diff --git a/gpu/src/texture.zig b/gpu/src/texture.zig index 403bfc64..e804fbc6 100644 --- a/gpu/src/texture.zig +++ b/gpu/src/texture.zig @@ -4,59 +4,59 @@ const TextureView = @import("texture_view.zig").TextureView; const TextureViewDimension = @import("texture_view.zig").TextureViewDimension; const TextureViewDescriptor = @import("texture_view.zig").TextureViewDescriptor; const Extent3D = @import("types.zig").Extent3D; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const Texture = *opaque { pub inline fn createView(texture: Texture, descriptor: ?*const TextureViewDescriptor) TextureView { - return impl.textureCreateView(texture, descriptor); + return Impl.textureCreateView(texture, descriptor); } pub inline fn destroy(texture: Texture) void { - impl.textureDestroy(texture); + Impl.textureDestroy(texture); } pub inline fn getDepthOrArrayLayers(texture: Texture) u32 { - return impl.textureGetDepthOrArrayLayers(texture); + return Impl.textureGetDepthOrArrayLayers(texture); } pub inline fn getDimension(texture: Texture) TextureDimension { - return impl.textureGetDimension(texture); + return Impl.textureGetDimension(texture); } pub inline fn getFormat(texture: Texture) TextureFormat { - return impl.textureGetFormat(texture); + return Impl.textureGetFormat(texture); } pub inline fn getHeight(texture: Texture) u32 { - return impl.textureGetHeight(texture); + return Impl.textureGetHeight(texture); } pub inline fn getMipLevelCount(texture: Texture) u32 { - return impl.textureGetMipLevelCount(texture); + return Impl.textureGetMipLevelCount(texture); } pub inline fn getSampleCount(texture: Texture) u32 { - return impl.textureGetSampleCount(texture); + return Impl.textureGetSampleCount(texture); } pub inline fn getUsage(texture: Texture) TextureUsageFlags { - return impl.textureGetUsage(texture); + return Impl.textureGetUsage(texture); } pub inline fn getWidth(texture: Texture) u32 { - return impl.textureGetWidth(texture); + return Impl.textureGetWidth(texture); } pub inline fn setLabel(texture: Texture, label: [*:0]const u8) void { - impl.textureSetLabel(texture, label); + Impl.textureSetLabel(texture, label); } pub inline fn reference(texture: Texture) void { - impl.textureReference(texture); + Impl.textureReference(texture); } pub inline fn release(texture: Texture) void { - impl.textureRelease(texture); + Impl.textureRelease(texture); } }; diff --git a/gpu/src/texture_view.zig b/gpu/src/texture_view.zig index 7a3512d3..d855f8fa 100644 --- a/gpu/src/texture_view.zig +++ b/gpu/src/texture_view.zig @@ -2,19 +2,19 @@ const ChainedStruct = @import("types.zig").ChainedStruct; const Texture = @import("texture.zig").Texture; const TextureFormat = @import("texture.zig").TextureFormat; const TextureAspect = @import("texture.zig").TextureAspect; -const impl = @import("interface.zig").impl; +const Impl = @import("interface.zig").Impl; pub const TextureView = *opaque { pub inline fn setLabel(texture_view: TextureView, label: [*:0]const u8) void { - impl.textureViewSetLabel(texture_view, label); + Impl.textureViewSetLabel(texture_view, label); } pub inline fn reference(texture_view: TextureView) void { - impl.textureViewReference(texture_view); + Impl.textureViewReference(texture_view); } pub inline fn release(texture_view: TextureView) void { - impl.textureViewRelease(texture_view); + Impl.textureViewRelease(texture_view); } };