gpu: add BufferMapAsyncStatus enum

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-03-09 10:27:51 -07:00 committed by Stephen Gutekanst
parent 0ddbfaf2b3
commit a46847559a
3 changed files with 11 additions and 353 deletions

View file

@ -27,359 +27,6 @@ typedef struct WGPUSamplerImpl* WGPUSampler;
typedef struct WGPUTextureImpl* WGPUTexture;
typedef struct WGPUTextureViewImpl* WGPUTextureView;
typedef enum WGPUBufferMapAsyncStatus {
WGPUBufferMapAsyncStatus_Success = 0x00000000,
WGPUBufferMapAsyncStatus_Error = 0x00000001,
WGPUBufferMapAsyncStatus_Unknown = 0x00000002,
WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003,
WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004,
WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005,
WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF
} WGPUBufferMapAsyncStatus;
typedef enum WGPUCompareFunction {
WGPUCompareFunction_Undefined = 0x00000000,
WGPUCompareFunction_Never = 0x00000001,
WGPUCompareFunction_Less = 0x00000002,
WGPUCompareFunction_LessEqual = 0x00000003,
WGPUCompareFunction_Greater = 0x00000004,
WGPUCompareFunction_GreaterEqual = 0x00000005,
WGPUCompareFunction_Equal = 0x00000006,
WGPUCompareFunction_NotEqual = 0x00000007,
WGPUCompareFunction_Always = 0x00000008,
WGPUCompareFunction_Force32 = 0x7FFFFFFF
} WGPUCompareFunction;
typedef enum WGPUCompilationInfoRequestStatus {
WGPUCompilationInfoRequestStatus_Success = 0x00000000,
WGPUCompilationInfoRequestStatus_Error = 0x00000001,
WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002,
WGPUCompilationInfoRequestStatus_Unknown = 0x00000003,
WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF
} WGPUCompilationInfoRequestStatus;
typedef enum WGPUCompilationMessageType {
WGPUCompilationMessageType_Error = 0x00000000,
WGPUCompilationMessageType_Warning = 0x00000001,
WGPUCompilationMessageType_Info = 0x00000002,
WGPUCompilationMessageType_Force32 = 0x7FFFFFFF
} WGPUCompilationMessageType;
typedef enum WGPUComputePassTimestampLocation {
WGPUComputePassTimestampLocation_Beginning = 0x00000000,
WGPUComputePassTimestampLocation_End = 0x00000001,
WGPUComputePassTimestampLocation_Force32 = 0x7FFFFFFF
} WGPUComputePassTimestampLocation;
typedef enum WGPUCreatePipelineAsyncStatus {
WGPUCreatePipelineAsyncStatus_Success = 0x00000000,
WGPUCreatePipelineAsyncStatus_Error = 0x00000001,
WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000002,
WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000003,
WGPUCreatePipelineAsyncStatus_Unknown = 0x00000004,
WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF
} WGPUCreatePipelineAsyncStatus;
typedef enum WGPUCullMode {
WGPUCullMode_None = 0x00000000,
WGPUCullMode_Front = 0x00000001,
WGPUCullMode_Back = 0x00000002,
WGPUCullMode_Force32 = 0x7FFFFFFF
} WGPUCullMode;
typedef enum WGPUDeviceLostReason {
WGPUDeviceLostReason_Undefined = 0x00000000,
WGPUDeviceLostReason_Destroyed = 0x00000001,
WGPUDeviceLostReason_Force32 = 0x7FFFFFFF
} WGPUDeviceLostReason;
typedef enum WGPUErrorFilter {
WGPUErrorFilter_Validation = 0x00000000,
WGPUErrorFilter_OutOfMemory = 0x00000001,
WGPUErrorFilter_Force32 = 0x7FFFFFFF
} WGPUErrorFilter;
typedef enum WGPUErrorType {
WGPUErrorType_NoError = 0x00000000,
WGPUErrorType_Validation = 0x00000001,
WGPUErrorType_OutOfMemory = 0x00000002,
WGPUErrorType_Unknown = 0x00000003,
WGPUErrorType_DeviceLost = 0x00000004,
WGPUErrorType_Force32 = 0x7FFFFFFF
} WGPUErrorType;
typedef enum WGPUFeatureName {
WGPUFeatureName_Undefined = 0x00000000,
WGPUFeatureName_Depth24UnormStencil8 = 0x00000002,
WGPUFeatureName_Depth32FloatStencil8 = 0x00000003,
WGPUFeatureName_TimestampQuery = 0x00000004,
WGPUFeatureName_PipelineStatisticsQuery = 0x00000005,
WGPUFeatureName_TextureCompressionBC = 0x00000006,
WGPUFeatureName_TextureCompressionETC2 = 0x00000007,
WGPUFeatureName_TextureCompressionASTC = 0x00000008,
WGPUFeatureName_IndirectFirstInstance = 0x00000009,
WGPUFeatureName_DepthClamping = 0x000003E8,
WGPUFeatureName_DawnShaderFloat16 = 0x000003E9,
WGPUFeatureName_DawnInternalUsages = 0x000003EA,
WGPUFeatureName_DawnMultiPlanarFormats = 0x000003EB,
WGPUFeatureName_DawnNative = 0x000003EC,
WGPUFeatureName_Force32 = 0x7FFFFFFF
} WGPUFeatureName;
typedef enum WGPUFilterMode {
WGPUFilterMode_Nearest = 0x00000000,
WGPUFilterMode_Linear = 0x00000001,
WGPUFilterMode_Force32 = 0x7FFFFFFF
} WGPUFilterMode;
typedef enum WGPUFrontFace {
WGPUFrontFace_CCW = 0x00000000,
WGPUFrontFace_CW = 0x00000001,
WGPUFrontFace_Force32 = 0x7FFFFFFF
} WGPUFrontFace;
typedef enum WGPUIndexFormat {
WGPUIndexFormat_Undefined = 0x00000000,
WGPUIndexFormat_Uint16 = 0x00000001,
WGPUIndexFormat_Uint32 = 0x00000002,
WGPUIndexFormat_Force32 = 0x7FFFFFFF
} WGPUIndexFormat;
typedef enum WGPULoadOp {
WGPULoadOp_Undefined = 0x00000000,
WGPULoadOp_Clear = 0x00000001,
WGPULoadOp_Load = 0x00000002,
WGPULoadOp_Force32 = 0x7FFFFFFF
} WGPULoadOp;
typedef enum WGPULoggingType {
WGPULoggingType_Verbose = 0x00000000,
WGPULoggingType_Info = 0x00000001,
WGPULoggingType_Warning = 0x00000002,
WGPULoggingType_Error = 0x00000003,
WGPULoggingType_Force32 = 0x7FFFFFFF
} WGPULoggingType;
typedef enum WGPUPipelineStatisticName {
WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000,
WGPUPipelineStatisticName_ClipperInvocations = 0x00000001,
WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002,
WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003,
WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004,
WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF
} WGPUPipelineStatisticName;
typedef enum WGPUPowerPreference {
WGPUPowerPreference_Undefined = 0x00000000,
WGPUPowerPreference_LowPower = 0x00000001,
WGPUPowerPreference_HighPerformance = 0x00000002,
WGPUPowerPreference_Force32 = 0x7FFFFFFF
} WGPUPowerPreference;
typedef enum WGPUPredefinedColorSpace {
WGPUPredefinedColorSpace_Undefined = 0x00000000,
WGPUPredefinedColorSpace_Srgb = 0x00000001,
WGPUPredefinedColorSpace_Force32 = 0x7FFFFFFF
} WGPUPredefinedColorSpace;
typedef enum WGPUPrimitiveTopology {
WGPUPrimitiveTopology_PointList = 0x00000000,
WGPUPrimitiveTopology_LineList = 0x00000001,
WGPUPrimitiveTopology_LineStrip = 0x00000002,
WGPUPrimitiveTopology_TriangleList = 0x00000003,
WGPUPrimitiveTopology_TriangleStrip = 0x00000004,
WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF
} WGPUPrimitiveTopology;
typedef enum WGPUQueryType {
WGPUQueryType_Occlusion = 0x00000000,
WGPUQueryType_PipelineStatistics = 0x00000001,
WGPUQueryType_Timestamp = 0x00000002,
WGPUQueryType_Force32 = 0x7FFFFFFF
} WGPUQueryType;
typedef enum WGPURenderPassTimestampLocation {
WGPURenderPassTimestampLocation_Beginning = 0x00000000,
WGPURenderPassTimestampLocation_End = 0x00000001,
WGPURenderPassTimestampLocation_Force32 = 0x7FFFFFFF
} WGPURenderPassTimestampLocation;
typedef enum WGPUSType {
WGPUSType_Invalid = 0x00000000,
WGPUSType_ExternalTextureBindingEntry = 0x00000009,
WGPUSType_ExternalTextureBindingLayout = 0x0000000A,
WGPUSType_DawnTextureInternalUsageDescriptor = 0x000003E8,
WGPUSType_PrimitiveDepthClampingState = 0x000003E9,
WGPUSType_DawnTogglesDeviceDescriptor = 0x000003EA,
WGPUSType_DawnEncoderInternalUsageDescriptor = 0x000003EB,
WGPUSType_DawnInstanceDescriptor = 0x000003EC,
WGPUSType_DawnCacheDeviceDescriptor = 0x000003ED,
WGPUSType_Force32 = 0x7FFFFFFF
} WGPUSType;
typedef enum WGPUSamplerBindingType {
WGPUSamplerBindingType_Undefined = 0x00000000,
WGPUSamplerBindingType_Filtering = 0x00000001,
WGPUSamplerBindingType_NonFiltering = 0x00000002,
WGPUSamplerBindingType_Comparison = 0x00000003,
WGPUSamplerBindingType_Force32 = 0x7FFFFFFF
} WGPUSamplerBindingType;
typedef enum WGPUStencilOperation {
WGPUStencilOperation_Keep = 0x00000000,
WGPUStencilOperation_Zero = 0x00000001,
WGPUStencilOperation_Replace = 0x00000002,
WGPUStencilOperation_Invert = 0x00000003,
WGPUStencilOperation_IncrementClamp = 0x00000004,
WGPUStencilOperation_DecrementClamp = 0x00000005,
WGPUStencilOperation_IncrementWrap = 0x00000006,
WGPUStencilOperation_DecrementWrap = 0x00000007,
WGPUStencilOperation_Force32 = 0x7FFFFFFF
} WGPUStencilOperation;
typedef enum WGPUStorageTextureAccess {
WGPUStorageTextureAccess_Undefined = 0x00000000,
WGPUStorageTextureAccess_WriteOnly = 0x00000001,
WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF
} WGPUStorageTextureAccess;
typedef enum WGPUStoreOp {
WGPUStoreOp_Undefined = 0x00000000,
WGPUStoreOp_Store = 0x00000001,
WGPUStoreOp_Discard = 0x00000002,
WGPUStoreOp_Force32 = 0x7FFFFFFF
} WGPUStoreOp;
typedef enum WGPUTextureAspect {
WGPUTextureAspect_All = 0x00000000,
WGPUTextureAspect_StencilOnly = 0x00000001,
WGPUTextureAspect_DepthOnly = 0x00000002,
WGPUTextureAspect_Plane0Only = 0x00000003,
WGPUTextureAspect_Plane1Only = 0x00000004,
WGPUTextureAspect_Force32 = 0x7FFFFFFF
} WGPUTextureAspect;
typedef enum WGPUTextureComponentType {
WGPUTextureComponentType_Float = 0x00000000,
WGPUTextureComponentType_Sint = 0x00000001,
WGPUTextureComponentType_Uint = 0x00000002,
WGPUTextureComponentType_DepthComparison = 0x00000003,
WGPUTextureComponentType_Force32 = 0x7FFFFFFF
} WGPUTextureComponentType;
typedef enum WGPUTextureDimension {
WGPUTextureDimension_1D = 0x00000000,
WGPUTextureDimension_2D = 0x00000001,
WGPUTextureDimension_3D = 0x00000002,
WGPUTextureDimension_Force32 = 0x7FFFFFFF
} WGPUTextureDimension;
typedef enum WGPUTextureSampleType {
WGPUTextureSampleType_Undefined = 0x00000000,
WGPUTextureSampleType_Float = 0x00000001,
WGPUTextureSampleType_UnfilterableFloat = 0x00000002,
WGPUTextureSampleType_Depth = 0x00000003,
WGPUTextureSampleType_Sint = 0x00000004,
WGPUTextureSampleType_Uint = 0x00000005,
WGPUTextureSampleType_Force32 = 0x7FFFFFFF
} WGPUTextureSampleType;
typedef enum WGPUTextureViewDimension {
WGPUTextureViewDimension_Undefined = 0x00000000,
WGPUTextureViewDimension_1D = 0x00000001,
WGPUTextureViewDimension_2D = 0x00000002,
WGPUTextureViewDimension_2DArray = 0x00000003,
WGPUTextureViewDimension_Cube = 0x00000004,
WGPUTextureViewDimension_CubeArray = 0x00000005,
WGPUTextureViewDimension_3D = 0x00000006,
WGPUTextureViewDimension_Force32 = 0x7FFFFFFF
} WGPUTextureViewDimension;
typedef enum WGPUVertexFormat {
WGPUVertexFormat_Undefined = 0x00000000,
WGPUVertexFormat_Uint8x2 = 0x00000001,
WGPUVertexFormat_Uint8x4 = 0x00000002,
WGPUVertexFormat_Sint8x2 = 0x00000003,
WGPUVertexFormat_Sint8x4 = 0x00000004,
WGPUVertexFormat_Unorm8x2 = 0x00000005,
WGPUVertexFormat_Unorm8x4 = 0x00000006,
WGPUVertexFormat_Snorm8x2 = 0x00000007,
WGPUVertexFormat_Snorm8x4 = 0x00000008,
WGPUVertexFormat_Uint16x2 = 0x00000009,
WGPUVertexFormat_Uint16x4 = 0x0000000A,
WGPUVertexFormat_Sint16x2 = 0x0000000B,
WGPUVertexFormat_Sint16x4 = 0x0000000C,
WGPUVertexFormat_Unorm16x2 = 0x0000000D,
WGPUVertexFormat_Unorm16x4 = 0x0000000E,
WGPUVertexFormat_Snorm16x2 = 0x0000000F,
WGPUVertexFormat_Snorm16x4 = 0x00000010,
WGPUVertexFormat_Float16x2 = 0x00000011,
WGPUVertexFormat_Float16x4 = 0x00000012,
WGPUVertexFormat_Float32 = 0x00000013,
WGPUVertexFormat_Float32x2 = 0x00000014,
WGPUVertexFormat_Float32x3 = 0x00000015,
WGPUVertexFormat_Float32x4 = 0x00000016,
WGPUVertexFormat_Uint32 = 0x00000017,
WGPUVertexFormat_Uint32x2 = 0x00000018,
WGPUVertexFormat_Uint32x3 = 0x00000019,
WGPUVertexFormat_Uint32x4 = 0x0000001A,
WGPUVertexFormat_Sint32 = 0x0000001B,
WGPUVertexFormat_Sint32x2 = 0x0000001C,
WGPUVertexFormat_Sint32x3 = 0x0000001D,
WGPUVertexFormat_Sint32x4 = 0x0000001E,
WGPUVertexFormat_Force32 = 0x7FFFFFFF
} WGPUVertexFormat;
typedef enum WGPUVertexStepMode {
WGPUVertexStepMode_Vertex = 0x00000000,
WGPUVertexStepMode_Instance = 0x00000001,
WGPUVertexStepMode_Force32 = 0x7FFFFFFF
} WGPUVertexStepMode;
typedef enum WGPUBufferUsage {
WGPUBufferUsage_None = 0x00000000,
WGPUBufferUsage_MapRead = 0x00000001,
WGPUBufferUsage_MapWrite = 0x00000002,
WGPUBufferUsage_CopySrc = 0x00000004,
WGPUBufferUsage_CopyDst = 0x00000008,
WGPUBufferUsage_Index = 0x00000010,
WGPUBufferUsage_Vertex = 0x00000020,
WGPUBufferUsage_Uniform = 0x00000040,
WGPUBufferUsage_Storage = 0x00000080,
WGPUBufferUsage_Indirect = 0x00000100,
WGPUBufferUsage_QueryResolve = 0x00000200,
WGPUBufferUsage_Force32 = 0x7FFFFFFF
} WGPUBufferUsage;
typedef WGPUFlags WGPUBufferUsageFlags;
typedef enum WGPUColorWriteMask {
WGPUColorWriteMask_None = 0x00000000,
WGPUColorWriteMask_Red = 0x00000001,
WGPUColorWriteMask_Green = 0x00000002,
WGPUColorWriteMask_Blue = 0x00000004,
WGPUColorWriteMask_Alpha = 0x00000008,
WGPUColorWriteMask_All = 0x0000000F,
WGPUColorWriteMask_Force32 = 0x7FFFFFFF
} WGPUColorWriteMask;
typedef WGPUFlags WGPUColorWriteMaskFlags;
typedef enum WGPUMapMode {
WGPUMapMode_None = 0x00000000,
WGPUMapMode_Read = 0x00000001,
WGPUMapMode_Write = 0x00000002,
WGPUMapMode_Force32 = 0x7FFFFFFF
} WGPUMapMode;
typedef WGPUFlags WGPUMapModeFlags;
typedef enum WGPUShaderStage {
WGPUShaderStage_None = 0x00000000,
WGPUShaderStage_Vertex = 0x00000001,
WGPUShaderStage_Fragment = 0x00000002,
WGPUShaderStage_Compute = 0x00000004,
WGPUShaderStage_Force32 = 0x7FFFFFFF
} WGPUShaderStage;
typedef WGPUFlags WGPUShaderStageFlags;
typedef struct WGPUChainedStruct {
struct WGPUChainedStruct const * next;
WGPUSType sType;

View file

@ -174,6 +174,15 @@ pub const BufferBindingType = enum(u32) {
read_only_storage = 0x00000003,
};
pub const BufferMapAsyncStatus = enum(u32) {
success = 0x00000000,
err = 0x00000001,
unknown = 0x00000002,
device_lost = 0x00000003,
destroyed_before_callback = 0x00000004,
unmapped_before_callback = 0x00000005,
};
test "name" {
try std.testing.expect(std.mem.eql(u8, @tagName(Feature.timestamp_query), "timestamp_query"));
}
@ -186,4 +195,5 @@ test "syntax" {
_ = BlendFactor;
_ = BlendOperation;
_ = BufferBindingType;
_ = BufferMapAsyncStatus;
}

View file

@ -45,6 +45,7 @@ pub const AlphaMode = @import("enums.zig").AlphaMode;
pub const BlendFactor = @import("enums.zig").BlendFactor;
pub const BlendOperation = @import("enums.zig").BlendOperation;
pub const BufferBindingType = @import("enums.zig").BufferBindingType;
pub const BufferMapAsyncStatus = @import("enums.zig").BufferMapAsyncStatus;
test "syntax" {
_ = Interface;