Skip to content

Commit

Permalink
Updated to latest wgpu latest version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcant0n committed Oct 7, 2024
1 parent bb92401 commit d19e3da
Show file tree
Hide file tree
Showing 21 changed files with 558 additions and 184 deletions.
37 changes: 20 additions & 17 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,27 @@ public static unsafe partial class WebGPUNative
[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterEnumerateFeatures")]
public static extern ulong wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName* features);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterGetInfo")]
public static extern void wgpuAdapterGetInfo(WGPUAdapter adapter, WGPUAdapterInfo* info);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterGetLimits")]
public static extern WGPUBool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits* limits);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterGetProperties")]
public static extern void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties* properties);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterHasFeature")]
public static extern WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterRequestDevice")]
public static extern void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPUDeviceDescriptor* descriptor, WGPURequestDeviceCallback callback, void* userdata);
public static extern void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPUDeviceDescriptor* descriptor, WGPUAdapterRequestDeviceCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterReference")]
public static extern void wgpuAdapterReference(WGPUAdapter adapter);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterRelease")]
public static extern void wgpuAdapterRelease(WGPUAdapter adapter);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuAdapterInfoFreeMembers")]
public static extern void wgpuAdapterInfoFreeMembers(WGPUAdapterInfo adapterInfo);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuBindGroupSetLabel")]
public static extern void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char* label);

Expand Down Expand Up @@ -71,7 +74,7 @@ public static unsafe partial class WebGPUNative
public static extern WGPUBufferUsage wgpuBufferGetUsage(WGPUBuffer buffer);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuBufferMapAsync")]
public static extern void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapMode mode, ulong offset, ulong size, WGPUBufferMapCallback callback, void* userdata);
public static extern void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapMode mode, ulong offset, ulong size, WGPUBufferMapAsyncCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuBufferSetLabel")]
public static extern void wgpuBufferSetLabel(WGPUBuffer buffer, char* label);
Expand Down Expand Up @@ -203,7 +206,7 @@ public static unsafe partial class WebGPUNative
public static extern WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor* descriptor);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceCreateComputePipelineAsync")]
public static extern void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor* descriptor, WGPUCreateComputePipelineAsyncCallback callback, void* userdata);
public static extern void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor* descriptor, WGPUDeviceCreateComputePipelineAsyncCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceCreatePipelineLayout")]
public static extern WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor* descriptor);
Expand All @@ -218,7 +221,7 @@ public static unsafe partial class WebGPUNative
public static extern WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor* descriptor);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceCreateRenderPipelineAsync")]
public static extern void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor* descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void* userdata);
public static extern void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor* descriptor, WGPUDeviceCreateRenderPipelineAsyncCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceCreateSampler")]
public static extern WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPUSamplerDescriptor* descriptor);
Expand Down Expand Up @@ -247,9 +250,6 @@ public static unsafe partial class WebGPUNative
[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceSetLabel")]
public static extern void wgpuDeviceSetLabel(WGPUDevice device, char* label);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceSetUncapturedErrorCallback")]
public static extern void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuDeviceReference")]
public static extern void wgpuDeviceReference(WGPUDevice device);

Expand All @@ -259,11 +259,14 @@ public static unsafe partial class WebGPUNative
[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuInstanceCreateSurface")]
public static extern WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor* descriptor);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuInstanceHasWGSLLanguageFeature")]
public static extern WGPUBool wgpuInstanceHasWGSLLanguageFeature(WGPUInstance instance, WGPUWGSLFeatureName feature);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuInstanceProcessEvents")]
public static extern void wgpuInstanceProcessEvents(WGPUInstance instance);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuInstanceRequestAdapter")]
public static extern void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions* options, WGPURequestAdapterCallback callback, void* userdata);
public static extern void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPURequestAdapterOptions* options, WGPUInstanceRequestAdapterCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuInstanceReference")]
public static extern void wgpuInstanceReference(WGPUInstance instance);
Expand Down Expand Up @@ -299,7 +302,7 @@ public static unsafe partial class WebGPUNative
public static extern void wgpuQuerySetRelease(WGPUQuerySet querySet);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuQueueOnSubmittedWorkDone")]
public static extern void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void* userdata);
public static extern void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueOnSubmittedWorkDoneCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuQueueSetLabel")]
public static extern void wgpuQueueSetLabel(WGPUQueue queue, char* label);
Expand Down Expand Up @@ -455,7 +458,7 @@ public static unsafe partial class WebGPUNative
public static extern void wgpuSamplerRelease(WGPUSampler sampler);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuShaderModuleGetCompilationInfo")]
public static extern void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void* userdata);
public static extern void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUShaderModuleGetCompilationInfoCallback callback, void* userdata);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuShaderModuleSetLabel")]
public static extern void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char* label);
Expand All @@ -475,12 +478,12 @@ public static unsafe partial class WebGPUNative
[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuSurfaceGetCurrentTexture")]
public static extern void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture* surfaceTexture);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuSurfaceGetPreferredFormat")]
public static extern WGPUTextureFormat wgpuSurfaceGetPreferredFormat(WGPUSurface surface, WGPUAdapter adapter);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuSurfacePresent")]
public static extern void wgpuSurfacePresent(WGPUSurface surface);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuSurfaceSetLabel")]
public static extern void wgpuSurfaceSetLabel(WGPUSurface surface, char* label);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuSurfaceUnconfigure")]
public static extern void wgpuSurfaceUnconfigure(WGPUSurface surface);

Expand All @@ -491,7 +494,7 @@ public static unsafe partial class WebGPUNative
public static extern void wgpuSurfaceRelease(WGPUSurface surface);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuSurfaceCapabilitiesFreeMembers")]
public static extern void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities capabilities);
public static extern void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities surfaceCapabilities);

[DllImport("wgpu_native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "wgpuTextureCreateView")]
public static extern WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPUTextureViewDescriptor* descriptor);
Expand Down
1 change: 1 addition & 0 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public static partial class WebGPUNative
{
public const float WGPU_ARRAY_LAYER_COUNT_UNDEFINED = 0xffffffffUL;
public const float WGPU_COPY_STRIDE_UNDEFINED = 0xffffffffUL;
public const float WGPU_DEPTH_SLICE_UNDEFINED = 0xffffffffUL;
public const float WGPU_LIMIT_U32_UNDEFINED = 0xffffffffUL;
public const float WGPU_LIMIT_U64_UNDEFINED = 0xffffffffffffffffUL;
public const float WGPU_MIP_LEVEL_COUNT_UNDEFINED = 0xffffffffUL;
Expand Down
52 changes: 26 additions & 26 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Delegates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,53 @@

namespace Evergine.Bindings.WebGPU
{
public unsafe delegate void WGPUBufferMapCallback(
WGPUBufferMapAsyncStatus status,
void* userdata);
public unsafe delegate void WGPUProc();

public unsafe delegate void WGPUCompilationInfoCallback(
WGPUCompilationInfoRequestStatus status,
WGPUCompilationInfo* compilationInfo,
public unsafe delegate void WGPUDeviceLostCallback(
WGPUDeviceLostReason reason,
char* message,
void* userdata);

public unsafe delegate void WGPUCreateComputePipelineAsyncCallback(
WGPUCreatePipelineAsyncStatus status,
WGPUComputePipeline pipeline,
public unsafe delegate void WGPUErrorCallback(
WGPUErrorType type,
char* message,
void* userdata);

public unsafe delegate void WGPUCreateRenderPipelineAsyncCallback(
WGPUCreatePipelineAsyncStatus status,
WGPURenderPipeline pipeline,
public unsafe delegate void WGPUAdapterRequestDeviceCallback(
WGPURequestDeviceStatus status,
WGPUDevice device,
char* message,
void* userdata);

public unsafe delegate void WGPUDeviceLostCallback(
WGPUDeviceLostReason reason,
char* message,
public unsafe delegate void WGPUBufferMapAsyncCallback(
WGPUBufferMapAsyncStatus status,
void* userdata);

public unsafe delegate void WGPUErrorCallback(
WGPUErrorType type,
public unsafe delegate void WGPUDeviceCreateComputePipelineAsyncCallback(
WGPUCreatePipelineAsyncStatus status,
WGPUComputePipeline pipeline,
char* message,
void* userdata);

public unsafe delegate void WGPUProc();

public unsafe delegate void WGPUQueueWorkDoneCallback(
WGPUQueueWorkDoneStatus status,
public unsafe delegate void WGPUDeviceCreateRenderPipelineAsyncCallback(
WGPUCreatePipelineAsyncStatus status,
WGPURenderPipeline pipeline,
char* message,
void* userdata);

public unsafe delegate void WGPURequestAdapterCallback(
public unsafe delegate void WGPUInstanceRequestAdapterCallback(
WGPURequestAdapterStatus status,
WGPUAdapter adapter,
char* message,
void* userdata);

public unsafe delegate void WGPURequestDeviceCallback(
WGPURequestDeviceStatus status,
WGPUDevice device,
char* message,
public unsafe delegate void WGPUQueueOnSubmittedWorkDoneCallback(
WGPUQueueWorkDoneStatus status,
void* userdata);

public unsafe delegate void WGPUShaderModuleGetCompilationInfoCallback(
WGPUCompilationInfoRequestStatus status,
WGPUCompilationInfo* compilationInfo,
void* userdata);

public unsafe delegate void WGPULogCallback(
Expand Down
38 changes: 36 additions & 2 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ public enum WGPUCullMode

public enum WGPUDeviceLostReason
{
Undefined = 0,
Destroyed = 1,
Unknown = 1,
Destroyed = 2,
Force32 = 2147483647,
}

Expand Down Expand Up @@ -543,6 +543,16 @@ public enum WGPUVertexStepMode
Force32 = 2147483647,
}

public enum WGPUWGSLFeatureName
{
Undefined = 0,
ReadonlyAndReadwriteStorageTextures = 1,
Packed4x8IntegerDotProduct = 2,
UnrestrictedPointerParameters = 3,
PointerCompositeAccess = 4,
Force32 = 2147483647,
}

[Flags]
public enum WGPUBufferUsage
{
Expand Down Expand Up @@ -630,6 +640,19 @@ public enum WGPUNativeFeature
PipelineStatisticsQuery = 196616,
StorageResourceBindingArray = 196617,
PartiallyBoundBindingArray = 196618,
TextureFormat16bitNorm = 196619,
TextureCompressionAstcHdr = 196620,
MappablePrimaryBuffers = 196622,
BufferBindingArray = 196623,
UniformBufferAndStorageTextureArrayNonUniformIndexing = 196624,
VertexAttribute64bit = 196633,
TextureFormatNv12 = 196634,
RayTracingAccelerationStructure = 196635,
RayQuery = 196636,
ShaderF64 = 196637,
ShaderI16 = 196638,
ShaderPrimitiveIndex = 196639,
ShaderEarlyDepthTest = 196640,
Force32 = 2147483647,
}

Expand Down Expand Up @@ -701,4 +724,15 @@ public enum WGPUNativeQueryType
Force32 = 2147483647,
}

public enum WGPUNativeTextureFormat
{
R16Unorm = 196609,
R16Snorm = 196610,
Rg16Unorm = 196611,
Rg16Snorm = 196612,
Rgba16Unorm = 196613,
Rgba16Snorm = 196614,
NV12 = 196615,
}

}
29 changes: 20 additions & 9 deletions WebGPUGen/Evergine.Bindings.WebGPU/Generated/Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
namespace Evergine.Bindings.WebGPU
{
[StructLayout(LayoutKind.Sequential)]
public unsafe struct WGPUAdapterProperties
public unsafe struct WGPUAdapterInfo
{
public WGPUChainedStructOut* nextInChain;
public uint vendorID;
public char* vendorName;
public char* vendor;
public char* architecture;
public uint deviceID;
public char* name;
public char* driverDescription;
public WGPUAdapterType adapterType;
public char* device;
public char* description;
public WGPUBackendType backendType;
public WGPUAdapterType adapterType;
public uint vendorID;
public uint deviceID;
}

[StructLayout(LayoutKind.Sequential)]
Expand Down Expand Up @@ -348,6 +348,7 @@ public unsafe struct WGPUStorageTextureBindingLayout
public unsafe struct WGPUSurfaceCapabilities
{
public WGPUChainedStructOut* nextInChain;
public WGPUTextureUsage usages;
public ulong formatCount;
public WGPUTextureFormat* formats;
public ulong presentModeCount;
Expand Down Expand Up @@ -471,6 +472,14 @@ public unsafe struct WGPUTextureViewDescriptor
public WGPUTextureAspect aspect;
}

[StructLayout(LayoutKind.Sequential)]
public unsafe struct WGPUUncapturedErrorCallbackInfo
{
public WGPUChainedStruct* nextInChain;
public delegate* unmanaged<WGPUErrorType, char*, void*, void> callback;
public void* userdata;
}

[StructLayout(LayoutKind.Sequential)]
public unsafe struct WGPUVertexAttribute
{
Expand Down Expand Up @@ -573,6 +582,7 @@ public unsafe struct WGPURenderPassColorAttachment
{
public WGPUChainedStruct* nextInChain;
public WGPUTextureView view;
public uint depthSlice;
public WGPUTextureView resolveTarget;
public WGPULoadOp loadOp;
public WGPUStoreOp storeOp;
Expand Down Expand Up @@ -662,8 +672,9 @@ public unsafe struct WGPUDeviceDescriptor
public WGPUFeatureName* requiredFeatures;
public WGPURequiredLimits* requiredLimits;
public WGPUQueueDescriptor defaultQueue;
public void* deviceLostCallback;
public WGPUDeviceLostCallback deviceLostCallback;
public void* deviceLostUserdata;
public WGPUUncapturedErrorCallbackInfo uncapturedErrorCallbackInfo;
}

[StructLayout(LayoutKind.Sequential)]
Expand Down Expand Up @@ -889,7 +900,7 @@ public unsafe struct WGPUQuerySetDescriptorExtras
public unsafe struct WGPUSurfaceConfigurationExtras
{
public WGPUChainedStruct chain;
public WGPUBool desiredMaximumFrameLatency;
public uint desiredMaximumFrameLatency;
}

}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit d19e3da

Please sign in to comment.