629 lines
24 KiB
Text
629 lines
24 KiB
Text
#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL)
|
|
#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL)
|
|
#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL)
|
|
#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL)
|
|
#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL)
|
|
#define WGPU_STRIDE_UNDEFINED (0xffffffffUL)
|
|
#define WGPU_WHOLE_MAP_SIZE SIZE_MAX
|
|
#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL)
|
|
|
|
typedef uint32_t WGPUFlags;
|
|
|
|
typedef struct WGPUBindGroupImpl* WGPUBindGroup;
|
|
typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout;
|
|
typedef struct WGPUBufferImpl* WGPUBuffer;
|
|
typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer;
|
|
typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder;
|
|
typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder;
|
|
typedef struct WGPUComputePipelineImpl* WGPUComputePipeline;
|
|
typedef struct WGPUExternalTextureImpl* WGPUExternalTexture;
|
|
typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout;
|
|
typedef struct WGPUQuerySetImpl* WGPUQuerySet;
|
|
typedef struct WGPURenderBundleImpl* WGPURenderBundle;
|
|
typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder;
|
|
typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder;
|
|
typedef struct WGPURenderPipelineImpl* WGPURenderPipeline;
|
|
typedef struct WGPUSamplerImpl* WGPUSampler;
|
|
typedef struct WGPUTextureImpl* WGPUTexture;
|
|
typedef struct WGPUTextureViewImpl* WGPUTextureView;
|
|
|
|
typedef struct WGPUChainedStruct {
|
|
struct WGPUChainedStruct const * next;
|
|
WGPUSType sType;
|
|
} WGPUChainedStruct;
|
|
|
|
typedef struct WGPUChainedStructOut {
|
|
struct WGPUChainedStructOut * next;
|
|
WGPUSType sType;
|
|
} WGPUChainedStructOut;
|
|
|
|
|
|
|
|
|
|
typedef struct WGPUBufferDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUBufferUsageFlags usage;
|
|
uint64_t size;
|
|
bool mappedAtCreation;
|
|
} WGPUBufferDescriptor;
|
|
|
|
typedef struct WGPUCommandBufferDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
} WGPUCommandBufferDescriptor;
|
|
|
|
typedef struct WGPUCommandEncoderDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
} WGPUCommandEncoderDescriptor;
|
|
|
|
typedef struct WGPUDawnCacheDeviceDescriptor {
|
|
WGPUChainedStruct chain;
|
|
char const * isolationKey;
|
|
} WGPUDawnCacheDeviceDescriptor;
|
|
|
|
typedef struct WGPUDawnEncoderInternalUsageDescriptor {
|
|
WGPUChainedStruct chain;
|
|
bool useInternalUsages;
|
|
} WGPUDawnEncoderInternalUsageDescriptor;
|
|
|
|
typedef struct WGPUDawnInstanceDescriptor {
|
|
WGPUChainedStruct chain;
|
|
uint32_t additionalRuntimeSearchPathsCount;
|
|
const char* const * additionalRuntimeSearchPaths;
|
|
} WGPUDawnInstanceDescriptor;
|
|
|
|
typedef struct WGPUDawnTextureInternalUsageDescriptor {
|
|
WGPUChainedStruct chain;
|
|
WGPUTextureUsageFlags internalUsage;
|
|
} WGPUDawnTextureInternalUsageDescriptor;
|
|
|
|
typedef struct WGPUDawnTogglesDeviceDescriptor {
|
|
WGPUChainedStruct chain;
|
|
uint32_t forceEnabledTogglesCount;
|
|
const char* const * forceEnabledToggles;
|
|
uint32_t forceDisabledTogglesCount;
|
|
const char* const * forceDisabledToggles;
|
|
} WGPUDawnTogglesDeviceDescriptor;
|
|
|
|
typedef struct WGPUExternalTextureDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUTextureView plane0;
|
|
WGPUTextureView plane1;
|
|
WGPUPredefinedColorSpace colorSpace;
|
|
} WGPUExternalTextureDescriptor;
|
|
|
|
typedef struct WGPUPipelineLayoutDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
uint32_t bindGroupLayoutCount;
|
|
WGPUBindGroupLayout const * bindGroupLayouts;
|
|
} WGPUPipelineLayoutDescriptor;
|
|
|
|
typedef struct WGPUQuerySetDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUQueryType type;
|
|
uint32_t count;
|
|
WGPUPipelineStatisticName const * pipelineStatistics;
|
|
uint32_t pipelineStatisticsCount;
|
|
} WGPUQuerySetDescriptor;
|
|
|
|
typedef struct WGPURenderBundleDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
} WGPURenderBundleDescriptor;
|
|
|
|
typedef struct WGPURenderBundleEncoderDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
uint32_t colorFormatsCount;
|
|
WGPUTextureFormat const * colorFormats;
|
|
WGPUTextureFormat depthStencilFormat;
|
|
uint32_t sampleCount;
|
|
bool depthReadOnly;
|
|
bool stencilReadOnly;
|
|
} WGPURenderBundleEncoderDescriptor;
|
|
|
|
typedef struct WGPUSamplerDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUAddressMode addressModeU;
|
|
WGPUAddressMode addressModeV;
|
|
WGPUAddressMode addressModeW;
|
|
WGPUFilterMode magFilter;
|
|
WGPUFilterMode minFilter;
|
|
WGPUFilterMode mipmapFilter;
|
|
float lodMinClamp;
|
|
float lodMaxClamp;
|
|
WGPUCompareFunction compare;
|
|
uint16_t maxAnisotropy;
|
|
} WGPUSamplerDescriptor;
|
|
|
|
typedef struct WGPUTextureViewDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUTextureFormat format;
|
|
WGPUTextureViewDimension dimension;
|
|
uint32_t baseMipLevel;
|
|
uint32_t mipLevelCount;
|
|
uint32_t baseArrayLayer;
|
|
uint32_t arrayLayerCount;
|
|
WGPUTextureAspect aspect;
|
|
} WGPUTextureViewDescriptor;
|
|
|
|
typedef struct WGPUBindGroupDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUBindGroupLayout layout;
|
|
uint32_t entryCount;
|
|
WGPUBindGroupEntry const * entries;
|
|
} WGPUBindGroupDescriptor;
|
|
|
|
typedef struct WGPUComputePassDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
uint32_t timestampWriteCount;
|
|
WGPUComputePassTimestampWrite const * timestampWrites;
|
|
} WGPUComputePassDescriptor;
|
|
|
|
typedef struct WGPUProgrammableStageDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUShaderModule module;
|
|
char const * entryPoint;
|
|
uint32_t constantCount;
|
|
WGPUConstantEntry const * constants;
|
|
} WGPUProgrammableStageDescriptor;
|
|
|
|
typedef struct WGPUTextureDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUTextureUsageFlags usage;
|
|
WGPUTextureDimension dimension;
|
|
WGPUExtent3D size;
|
|
WGPUTextureFormat format;
|
|
uint32_t mipLevelCount;
|
|
uint32_t sampleCount;
|
|
} WGPUTextureDescriptor;
|
|
|
|
typedef struct WGPUBindGroupLayoutDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
uint32_t entryCount;
|
|
WGPUBindGroupLayoutEntry const * entries;
|
|
} WGPUBindGroupLayoutDescriptor;
|
|
|
|
typedef struct WGPUComputePipelineDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUPipelineLayout layout;
|
|
WGPUProgrammableStageDescriptor compute;
|
|
} WGPUComputePipelineDescriptor;
|
|
|
|
typedef struct WGPURenderPassDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
uint32_t colorAttachmentCount;
|
|
WGPURenderPassColorAttachment const * colorAttachments;
|
|
WGPURenderPassDepthStencilAttachment const * depthStencilAttachment;
|
|
WGPUQuerySet occlusionQuerySet;
|
|
uint32_t timestampWriteCount;
|
|
WGPURenderPassTimestampWrite const * timestampWrites;
|
|
} WGPURenderPassDescriptor;
|
|
|
|
typedef struct WGPURenderPipelineDescriptor {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * label;
|
|
WGPUPipelineLayout layout;
|
|
WGPUVertexState vertex;
|
|
WGPUPrimitiveState primitive;
|
|
WGPUDepthStencilState const * depthStencil;
|
|
WGPUMultisampleState multisample;
|
|
WGPUFragmentState const * fragment;
|
|
} WGPURenderPipelineDescriptor;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct WGPUBindGroupEntry {
|
|
WGPUChainedStruct const * nextInChain;
|
|
uint32_t binding;
|
|
WGPUBuffer buffer;
|
|
uint64_t offset;
|
|
uint64_t size;
|
|
WGPUSampler sampler;
|
|
WGPUTextureView textureView;
|
|
} WGPUBindGroupEntry;
|
|
|
|
typedef struct WGPUBufferBindingLayout {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUBufferBindingType type;
|
|
bool hasDynamicOffset;
|
|
uint64_t minBindingSize;
|
|
} WGPUBufferBindingLayout;
|
|
|
|
typedef struct WGPUCompilationMessage {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * message;
|
|
WGPUCompilationMessageType type;
|
|
uint64_t lineNum;
|
|
uint64_t linePos;
|
|
uint64_t offset;
|
|
uint64_t length;
|
|
} WGPUCompilationMessage;
|
|
|
|
typedef struct WGPUConstantEntry {
|
|
WGPUChainedStruct const * nextInChain;
|
|
char const * key;
|
|
double value;
|
|
} WGPUConstantEntry;
|
|
|
|
typedef struct WGPUCopyTextureForBrowserOptions {
|
|
WGPUChainedStruct const * nextInChain;
|
|
bool flipY;
|
|
bool needsColorSpaceConversion;
|
|
WGPUAlphaMode srcAlphaMode;
|
|
float const * srcTransferFunctionParameters;
|
|
float const * conversionMatrix;
|
|
float const * dstTransferFunctionParameters;
|
|
WGPUAlphaMode dstAlphaMode;
|
|
} WGPUCopyTextureForBrowserOptions;
|
|
|
|
typedef struct WGPUMultisampleState {
|
|
WGPUChainedStruct const * nextInChain;
|
|
uint32_t count;
|
|
uint32_t mask;
|
|
bool alphaToCoverageEnabled;
|
|
} WGPUMultisampleState;
|
|
|
|
typedef struct WGPUPrimitiveState {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUPrimitiveTopology topology;
|
|
WGPUIndexFormat stripIndexFormat;
|
|
WGPUFrontFace frontFace;
|
|
WGPUCullMode cullMode;
|
|
} WGPUPrimitiveState;
|
|
|
|
typedef struct WGPUSamplerBindingLayout {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUSamplerBindingType type;
|
|
} WGPUSamplerBindingLayout;
|
|
|
|
typedef struct WGPUStorageTextureBindingLayout {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUStorageTextureAccess access;
|
|
WGPUTextureFormat format;
|
|
WGPUTextureViewDimension viewDimension;
|
|
} WGPUStorageTextureBindingLayout;
|
|
|
|
typedef struct WGPUTextureBindingLayout {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUTextureSampleType sampleType;
|
|
WGPUTextureViewDimension viewDimension;
|
|
bool multisampled;
|
|
} WGPUTextureBindingLayout;
|
|
|
|
typedef struct WGPUTextureDataLayout {
|
|
WGPUChainedStruct const * nextInChain;
|
|
uint64_t offset;
|
|
uint32_t bytesPerRow;
|
|
uint32_t rowsPerImage;
|
|
} WGPUTextureDataLayout;
|
|
|
|
typedef struct WGPUBindGroupLayoutEntry {
|
|
WGPUChainedStruct const * nextInChain;
|
|
uint32_t binding;
|
|
WGPUShaderStageFlags visibility;
|
|
WGPUBufferBindingLayout buffer;
|
|
WGPUSamplerBindingLayout sampler;
|
|
WGPUTextureBindingLayout texture;
|
|
WGPUStorageTextureBindingLayout storageTexture;
|
|
} WGPUBindGroupLayoutEntry;
|
|
|
|
typedef struct WGPUCompilationInfo {
|
|
WGPUChainedStruct const * nextInChain;
|
|
uint32_t messageCount;
|
|
WGPUCompilationMessage const * messages;
|
|
} WGPUCompilationInfo;
|
|
|
|
typedef struct WGPUDepthStencilState {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUTextureFormat format;
|
|
bool depthWriteEnabled;
|
|
WGPUCompareFunction depthCompare;
|
|
WGPUStencilFaceState stencilFront;
|
|
WGPUStencilFaceState stencilBack;
|
|
uint32_t stencilReadMask;
|
|
uint32_t stencilWriteMask;
|
|
int32_t depthBias;
|
|
float depthBiasSlopeScale;
|
|
float depthBiasClamp;
|
|
} WGPUDepthStencilState;
|
|
|
|
typedef struct WGPUImageCopyBuffer {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUTextureDataLayout layout;
|
|
WGPUBuffer buffer;
|
|
} WGPUImageCopyBuffer;
|
|
|
|
typedef struct WGPUImageCopyTexture {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUTexture texture;
|
|
uint32_t mipLevel;
|
|
WGPUOrigin3D origin;
|
|
WGPUTextureAspect aspect;
|
|
} WGPUImageCopyTexture;
|
|
|
|
typedef struct WGPUColorTargetState {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUTextureFormat format;
|
|
WGPUBlendState const * blend;
|
|
WGPUColorWriteMaskFlags writeMask;
|
|
} WGPUColorTargetState;
|
|
|
|
typedef struct WGPUSupportedLimits {
|
|
WGPUChainedStructOut * nextInChain;
|
|
WGPULimits limits;
|
|
} WGPUSupportedLimits;
|
|
|
|
typedef struct WGPUVertexState {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUShaderModule module;
|
|
char const * entryPoint;
|
|
uint32_t constantCount;
|
|
WGPUConstantEntry const * constants;
|
|
uint32_t bufferCount;
|
|
WGPUVertexBufferLayout const * buffers;
|
|
} WGPUVertexState;
|
|
|
|
typedef struct WGPUFragmentState {
|
|
WGPUChainedStruct const * nextInChain;
|
|
WGPUShaderModule module;
|
|
char const * entryPoint;
|
|
uint32_t constantCount;
|
|
WGPUConstantEntry const * constants;
|
|
uint32_t targetCount;
|
|
WGPUColorTargetState const * targets;
|
|
} WGPUFragmentState;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct WGPUBlendComponent {
|
|
WGPUBlendOperation operation;
|
|
WGPUBlendFactor srcFactor;
|
|
WGPUBlendFactor dstFactor;
|
|
} WGPUBlendComponent;
|
|
|
|
typedef struct WGPUColor {
|
|
double r;
|
|
double g;
|
|
double b;
|
|
double a;
|
|
} WGPUColor;
|
|
|
|
typedef struct WGPUComputePassTimestampWrite {
|
|
WGPUQuerySet querySet;
|
|
uint32_t queryIndex;
|
|
WGPUComputePassTimestampLocation location;
|
|
} WGPUComputePassTimestampWrite;
|
|
|
|
typedef struct WGPUExtent3D {
|
|
uint32_t width;
|
|
uint32_t height;
|
|
uint32_t depthOrArrayLayers;
|
|
} WGPUExtent3D;
|
|
|
|
typedef struct WGPUExternalTextureBindingEntry {
|
|
WGPUChainedStruct chain;
|
|
WGPUExternalTexture externalTexture;
|
|
} WGPUExternalTextureBindingEntry;
|
|
|
|
typedef struct WGPUExternalTextureBindingLayout {
|
|
WGPUChainedStruct chain;
|
|
} WGPUExternalTextureBindingLayout;
|
|
|
|
typedef struct WGPUOrigin3D {
|
|
uint32_t x;
|
|
uint32_t y;
|
|
uint32_t z;
|
|
} WGPUOrigin3D;
|
|
|
|
typedef struct WGPUPrimitiveDepthClampingState {
|
|
WGPUChainedStruct chain;
|
|
bool clampDepth;
|
|
} WGPUPrimitiveDepthClampingState;
|
|
|
|
typedef struct WGPURenderPassDepthStencilAttachment {
|
|
WGPUTextureView view;
|
|
WGPULoadOp depthLoadOp;
|
|
WGPUStoreOp depthStoreOp;
|
|
float clearDepth;
|
|
float depthClearValue;
|
|
bool depthReadOnly;
|
|
WGPULoadOp stencilLoadOp;
|
|
WGPUStoreOp stencilStoreOp;
|
|
uint32_t clearStencil;
|
|
uint32_t stencilClearValue;
|
|
bool stencilReadOnly;
|
|
} WGPURenderPassDepthStencilAttachment;
|
|
|
|
typedef struct WGPURenderPassTimestampWrite {
|
|
WGPUQuerySet querySet;
|
|
uint32_t queryIndex;
|
|
WGPURenderPassTimestampLocation location;
|
|
} WGPURenderPassTimestampWrite;
|
|
|
|
typedef struct WGPUStencilFaceState {
|
|
WGPUCompareFunction compare;
|
|
WGPUStencilOperation failOp;
|
|
WGPUStencilOperation depthFailOp;
|
|
WGPUStencilOperation passOp;
|
|
} WGPUStencilFaceState;
|
|
|
|
typedef struct WGPUVertexAttribute {
|
|
WGPUVertexFormat format;
|
|
uint64_t offset;
|
|
uint32_t shaderLocation;
|
|
} WGPUVertexAttribute;
|
|
|
|
typedef struct WGPUBlendState {
|
|
WGPUBlendComponent color;
|
|
WGPUBlendComponent alpha;
|
|
} WGPUBlendState;
|
|
|
|
typedef struct WGPURenderPassColorAttachment {
|
|
WGPUTextureView view;
|
|
WGPUTextureView resolveTarget;
|
|
WGPULoadOp loadOp;
|
|
WGPUStoreOp storeOp;
|
|
WGPUColor clearColor;
|
|
WGPUColor clearValue;
|
|
} WGPURenderPassColorAttachment;
|
|
|
|
typedef struct WGPUVertexBufferLayout {
|
|
uint64_t arrayStride;
|
|
WGPUVertexStepMode stepMode;
|
|
uint32_t attributeCount;
|
|
WGPUVertexAttribute const * attributes;
|
|
} WGPUVertexBufferLayout;
|
|
|
|
typedef struct WGPUDeviceProperties {
|
|
uint32_t deviceID;
|
|
uint32_t vendorID;
|
|
WGPUAdapterType adapterType;
|
|
bool textureCompressionBC;
|
|
bool textureCompressionETC2;
|
|
bool textureCompressionASTC;
|
|
bool shaderFloat16;
|
|
bool pipelineStatisticsQuery;
|
|
bool timestampQuery;
|
|
bool multiPlanarFormats;
|
|
bool depthClamping;
|
|
bool depth24UnormStencil8;
|
|
bool depth32FloatStencil8;
|
|
bool invalidFeature;
|
|
bool dawnInternalUsages;
|
|
bool dawnNative;
|
|
WGPUSupportedLimits limits;
|
|
} WGPUDeviceProperties;
|
|
|
|
|
|
|
|
|
|
typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata);
|
|
typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, WGPUCompilationInfo const * compilationInfo, void * userdata);
|
|
typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata);
|
|
typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata);
|
|
typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata);
|
|
typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata);
|
|
typedef void (*WGPULoggingCallback)(WGPULoggingType type, char const * message, void * userdata);
|
|
typedef void (*WGPUProc)();
|
|
|
|
WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName);
|
|
|
|
// Methods of BindGroup
|
|
WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label);
|
|
WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup);
|
|
WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup);
|
|
|
|
// Methods of BindGroupLayout
|
|
WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label);
|
|
WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout);
|
|
WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout);
|
|
|
|
// Methods of Buffer
|
|
WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer);
|
|
WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size);
|
|
WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size);
|
|
WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata);
|
|
WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label);
|
|
WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer);
|
|
WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer);
|
|
WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer);
|
|
|
|
// Methods of CommandBuffer
|
|
WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label);
|
|
WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer);
|
|
WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer);
|
|
|
|
// Methods of CommandEncoder
|
|
WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPUComputePassDescriptor const * descriptor);
|
|
WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor);
|
|
WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size);
|
|
WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size);
|
|
WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize);
|
|
WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize);
|
|
WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize);
|
|
WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTextureInternal(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize);
|
|
WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor);
|
|
WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message);
|
|
WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel);
|
|
WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder);
|
|
WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel);
|
|
WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset);
|
|
WGPU_EXPORT void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, char const * label);
|
|
WGPU_EXPORT void wgpuCommandEncoderWriteBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t bufferOffset, uint8_t const * data, uint64_t size);
|
|
WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
|
|
WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder);
|
|
WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder);
|
|
|
|
// Methods of ComputePassEncoder
|
|
WGPU_EXPORT void wgpuComputePassEncoderDispatch(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ);
|
|
WGPU_EXPORT void wgpuComputePassEncoderDispatchIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset);
|
|
WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder);
|
|
WGPU_EXPORT void wgpuComputePassEncoderEndPass(WGPUComputePassEncoder computePassEncoder);
|
|
WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel);
|
|
WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder);
|
|
WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel);
|
|
WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPUBindGroup group, uint32_t dynamicOffsetCount, uint32_t const * dynamicOffsets);
|
|
WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label);
|
|
WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline);
|
|
WGPU_EXPORT void wgpuComputePassEncoderWriteTimestamp(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex);
|
|
WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder);
|
|
WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder);
|
|
|
|
// Methods of ComputePipeline
|
|
WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex);
|
|
WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label);
|
|
WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline);
|
|
WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline);
|
|
|
|
// Methods of ExternalTexture
|
|
WGPU_EXPORT void wgpuExternalTextureDestroy(WGPUExternalTexture externalTexture);
|
|
WGPU_EXPORT void wgpuExternalTextureSetLabel(WGPUExternalTexture externalTexture, char const * label);
|
|
WGPU_EXPORT void wgpuExternalTextureReference(WGPUExternalTexture externalTexture);
|
|
WGPU_EXPORT void wgpuExternalTextureRelease(WGPUExternalTexture externalTexture);
|
|
|
|
// Methods of PipelineLayout
|
|
WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label);
|
|
WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout);
|
|
WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout);
|
|
|
|
// Methods of QuerySet
|
|
WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet);
|
|
WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label);
|
|
WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet);
|
|
WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet);
|
|
|
|
typedef enum WGPUSType {
|
|
// webgpu.h upstream:
|
|
WGPUSType_Invalid = 0x00000000,
|
|
WGPUSType_PrimitiveDepthClipControl = 0x00000007,
|
|
WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008,
|
|
WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009,
|
|
|
|
// webgpu.h dawn:
|
|
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;
|