Documentation
¶
Overview ¶
API stability ¶
WebGPU, webgpu.h, and wgpu are still in development and change regularly. Our bindings works with specific versions of webgpu.h and wgpu only, and will regularly be updated to track changes, which means our API might change as well.
Error handling ¶
Error handling in WebGPU, webgpu.h and wgpu is still in flux and incomplete, making it impossible to handle some errors cleanly, as they will panic in Rust and cause SIGABRT. The errors that _can_ be handled fall into one of the following categories:
Failure to acquire an adapter or device will return a Go error.
By default, all validation errors, out-of-memory errors, and internal errors will panic in Go.
Using Device.PushErrorScope and Device.PopErrorScope, validation errors, out-of-memory errors, and internal errors can be caught and turned into Go errors. This allows, for example, to handle fallible memory allocations.
The alternative to explicit use of error scopes would've been to return Go errors from most functions in this package. However, the vast majority of validation errors are programmer mistakes, which should panic, not return errors. Similarly, a lot of out of memory situations are fatal. Furthermore, instead of checking the error for every function call, it often suffices to check them for a sequence of function calls, for example to check that rendering a full frame succeeded. This can be accomplished much easier with error scopes. Finally, fine-grained use of error scopes may lead to unnecessary synchronisation between the CPU and GPU.
Some functions are internally implemented using callbacks, such as Surface.CurrentTexture. Errors that occur in such functions do not use error scopes and are instead passed to the callbacks, and we turn them into Go errors.
Device loss will invoke a callback. WebGPU intends that most API continues to work, by becoming no-ops, after a device has been lost, so that device loss can be handled reliably via the callback. This hasn't been fully implemented yet, and handling device loss reliably is error-prone, no pun intended.
Due to a combination of the designs of webgpu.h and wgpu, some errors related to resources that do not belong to a device cannot be handled, as they cause panics inside Rust. This applies to surface creation and configuration, for example.
Index ¶
- Variables
- func SetLogLevel(level LogLevel)
- func Version() string
- type Adapter
- type AdapterProperties
- type AdapterType
- type AddressMode
- type AllLimits
- type AndroidNativeWindow
- type BackendType
- type BindGroup
- type BindGroupDescriptor
- type BindGroupEntry
- type BindGroupLayout
- type BindGroupLayoutDescriptor
- type BindGroupLayoutEntry
- type BlendComponent
- type BlendFactor
- type BlendOperation
- type BlendState
- type Buffer
- func (buf *Buffer) Destroy()
- func (buf *Buffer) Map(dev *Device, mode MapMode, offset int, size int) <-chan error
- func (buf *Buffer) MappedRange(offset, size int) []byte
- func (buf *Buffer) ReadOnlyMappedRange(offset, size int) []byte
- func (ptr *Buffer) Release()
- func (buf *Buffer) Size() uint64
- func (buf *Buffer) Unmap()
- func (buf *Buffer) Usage() BufferUsage
- type BufferBindingLayout
- type BufferBindingType
- type BufferDescriptor
- type BufferMapState
- type BufferUsage
- type Color
- type ColorTargetState
- type ColorWriteMask
- type CommandBuffer
- type CommandBufferDescriptor
- type CommandEncoder
- func (enc *CommandEncoder) BeginComputePass(desc *ComputePassDescriptor) *ComputePassEncoder
- func (enc *CommandEncoder) BeginRenderPass(desc *RenderPassDescriptor) *RenderPassEncoder
- func (enc *CommandEncoder) ClearBuffer(buf *Buffer, offset, size uint64)
- func (enc *CommandEncoder) CopyBufferToBuffer(source *Buffer, sourceOffset uint64, destination *Buffer, ...)
- func (enc *CommandEncoder) CopyBufferToTexture(source *ImageCopyBuffer, destination *ImageCopyTexture, copySize *Extent3D)
- func (enc *CommandEncoder) CopyTextureToBuffer(source *ImageCopyTexture, destination *ImageCopyBuffer, copySize *Extent3D)
- func (enc *CommandEncoder) CopyTextureToTexture(source *ImageCopyTexture, destination *ImageCopyTexture, copySize *Extent3D)
- func (enc *CommandEncoder) Finish(desc *CommandBufferDescriptor) *CommandBuffer
- func (enc *CommandEncoder) InsertDebugMarker(label string)
- func (enc *CommandEncoder) PopDebugGroup()
- func (enc *CommandEncoder) PushDebugGroup(label string)
- func (ptr *CommandEncoder) Release()
- func (enc *CommandEncoder) ResolveQuerySet(querySet *QuerySet, firstQuery uint32, queryCount uint32, destination *Buffer, ...)
- func (enc *CommandEncoder) WriteTimestamp(q *QuerySet, queryIndex uint32)
- type CommandEncoderDescriptor
- type CompareFunction
- type CompositeAlphaMode
- type ComputePassDescriptor
- type ComputePassEncoder
- func (enc *ComputePassEncoder) DispatchWorkgroups(countX, countY, countZ uint32)
- func (enc *ComputePassEncoder) DispatchWorkgroupsIndirect(indirectBuffer *Buffer, indirectOffset uint64)
- func (enc *ComputePassEncoder) End()
- func (enc *ComputePassEncoder) InsertDebugMarker(label string)
- func (enc *ComputePassEncoder) PopDebugGroup()
- func (enc *ComputePassEncoder) PushDebugGroup(label string)
- func (ptr *ComputePassEncoder) Release()
- func (enc *ComputePassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)
- func (enc *ComputePassEncoder) SetPipeline(p *ComputePipeline)
- type ComputePassTimestampWrites
- type ComputePipeline
- type ComputePipelineDescriptor
- type ConstantEntry
- type CullMode
- type DX12Compiler
- type DepthStencilState
- type Device
- func (dev *Device) CreateBindGroup(desc *BindGroupDescriptor) *BindGroup
- func (dev *Device) CreateBindGroupLayout(desc *BindGroupLayoutDescriptor) *BindGroupLayout
- func (dev *Device) CreateBuffer(desc *BufferDescriptor) *Buffer
- func (dev *Device) CreateCommandEncoder(desc *CommandEncoderDescriptor) *CommandEncoder
- func (dev *Device) CreateComputePipeline(desc *ComputePipelineDescriptor) *ComputePipeline
- func (dev *Device) CreatePipelineLayout(desc *PipelineLayoutDescriptor) *PipelineLayout
- func (dev *Device) CreateQuerySet(desc *QuerySetDescriptor) *QuerySet
- func (dev *Device) CreateRenderPipeline(desc *RenderPipelineDescriptor) *RenderPipeline
- func (dev *Device) CreateSampler(desc *SamplerDescriptor) *Sampler
- func (dev *Device) CreateShaderModule(desc ShaderModuleDescriptor) *ShaderModule
- func (dev *Device) CreateTexture(desc *TextureDescriptor) *Texture
- func (dev *Device) Destroy()
- func (dev *Device) Features() []FeatureName
- func (dev *Device) HasFeature(name FeatureName) bool
- func (dev *Device) Limits() AllLimits
- func (dev *Device) Lost() <-chan DeviceLost
- func (dev *Device) Poll(wait bool) bool
- func (dev *Device) PopErrorScope() error
- func (dev *Device) PushErrorScope(filter ErrorFilter)
- func (dev *Device) Queue() *Queue
- func (ptr *Device) Release()
- type DeviceDescriptor
- type DeviceLost
- type DeviceLostError
- type DeviceLostReason
- type ErrorFilter
- type Extent3D
- type FeatureName
- type FilterMode
- type FragmentState
- type FrontFace
- type GLES3MinorVersion
- type GlobalReport
- type HubReport
- type ImageCopyBuffer
- type ImageCopyTexture
- type IndexFormat
- type Instance
- func (ins *Instance) Adapters(opts InstanceEnumerateAdapterOptions) []*Adapter
- func (ins *Instance) CreateSurface(desc SurfaceDescriptor) *Surface
- func (ptr *Instance) Release()
- func (ins *Instance) Report(out *GlobalReport)
- func (ins *Instance) RequestAdapter(desc RequestAdapterOptions) (*Adapter, error)
- type InstanceBackend
- type InstanceBackendFlags
- type InstanceDescriptor
- type InstanceEnumerateAdapterOptions
- type InstanceExtras
- type InstanceFlag
- type InstanceFlags
- type InternalError
- type Limits
- type LoadOp
- type LogLevel
- type MapMode
- type MetalLayer
- type MipmapFilterMode
- type MultisampleState
- type NativeLimits
- type NativeSurface
- type Origin3D
- type OutOfMemoryError
- type PipelineLayout
- type PipelineLayoutDescriptor
- type PowerPreference
- type PresentMode
- type PrimitiveDepthClipControl
- type PrimitiveState
- type PrimitiveTopology
- type ProgrammableStageDescriptor
- type QuerySet
- type QuerySetDescriptor
- type QueryType
- type Queue
- func (q *Queue) OnSubmittedWorkDone(dev *Device) <-chan error
- func (ptr *Queue) Release()
- func (queue *Queue) Submit(commands ...*CommandBuffer)
- func (q *Queue) WriteBuffer(buffer *Buffer, offset uint64, data []byte)
- func (q *Queue) WriteTexture(destination *ImageCopyTexture, data []byte, dataLayout *TextureDataLayout, ...)
- type QueueDescriptor
- type RegistryReport
- type RenderBundle
- type RenderBundleEncoder
- type RenderPassColorAttachment
- type RenderPassDepthStencilAttachment
- type RenderPassDescriptor
- type RenderPassEncoder
- func (enc *RenderPassEncoder) BeginOcclusionQuery(queryIndex uint32)
- func (enc *RenderPassEncoder) Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)
- func (enc *RenderPassEncoder) DrawIndexed(indexCount, instanceCount, firstIndex uint32, baseVertex int32, ...)
- func (enc *RenderPassEncoder) DrawIndexedIndirect(indirectBuffer *Buffer, indirectOffset uint64)
- func (enc *RenderPassEncoder) DrawIndirect(indirectBuffer *Buffer, indirectOffset uint64)
- func (enc *RenderPassEncoder) End()
- func (enc *RenderPassEncoder) EndOcclusionQuery()
- func (enc *RenderPassEncoder) ExecuteBundles(bundles ...*RenderBundle)
- func (enc *RenderPassEncoder) InsertDebugMarker(markerLabel string)
- func (enc *RenderPassEncoder) PopDebugGroup()
- func (enc *RenderPassEncoder) PushDebugGroup(groupLabel string)
- func (ptr *RenderPassEncoder) Release()
- func (enc *RenderPassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)
- func (enc *RenderPassEncoder) SetBlendConstant(color *Color)
- func (enc *RenderPassEncoder) SetIndexBuffer(buffer *Buffer, format IndexFormat, offset, size uint64)
- func (enc *RenderPassEncoder) SetPipeline(p *RenderPipeline)
- func (enc *RenderPassEncoder) SetScissorRect(x, y, width, height uint32)
- func (enc *RenderPassEncoder) SetStencilReference(reference uint32)
- func (enc *RenderPassEncoder) SetVertexBuffer(slot uint32, buffer *Buffer, offset, size uint64)
- func (enc *RenderPassEncoder) SetViewport(x, y, width, height, minDepth, maxDepth float32)
- type RenderPassTimestampWrites
- type RenderPipeline
- type RenderPipelineDescriptor
- type RequestAdapterError
- type RequestAdapterOptions
- type RequestDeviceError
- type RequiredLimits
- type Sampler
- type SamplerBindingLayout
- type SamplerBindingType
- type SamplerDescriptor
- type ShaderModule
- type ShaderModuleCompilationHint
- type ShaderModuleDescriptor
- type ShaderSource
- type ShaderSourceWGSL
- type ShaderStage
- type StencilFaceState
- type StencilOperation
- type StorageTextureAccess
- type StorageTextureBindingLayout
- type StoreOp
- type Surface
- func (s *Surface) Capabilities(adapter *Adapter) SurfaceCapabilities
- func (s *Surface) Configure(dev *Device, config *SurfaceConfiguration)
- func (s *Surface) CurrentTexture() (SurfaceTexture, error)
- func (s *Surface) PreferredFormat(adapter *Adapter) TextureFormat
- func (s *Surface) Present()
- func (ptr *Surface) Release()
- func (s *Surface) Unconfigure()
- type SurfaceCapabilities
- type SurfaceConfiguration
- type SurfaceDescriptor
- type SurfaceTexture
- type Texture
- func (tex *Texture) CreateView(desc *TextureViewDescriptor) *TextureView
- func (tex *Texture) DepthOrArrayLayers() uint32
- func (tex *Texture) Destroy()
- func (tex *Texture) Dimension() TextureDimension
- func (tex *Texture) Format() TextureFormat
- func (tex *Texture) Height() uint32
- func (tex *Texture) MipLevelCount() uint32
- func (ptr *Texture) Release()
- func (tex *Texture) SampleCount() uint32
- func (tex *Texture) Usage() TextureUsage
- func (tex *Texture) Width() uint32
- type TextureAspect
- type TextureBindingLayout
- type TextureDataLayout
- type TextureDescriptor
- type TextureDimension
- type TextureFormat
- type TextureSampleType
- type TextureUsage
- type TextureView
- type TextureViewDescriptor
- type TextureViewDimension
- type UnknownError
- type ValidationError
- type VertexAttribute
- type VertexBufferLayout
- type VertexFormat
- type VertexState
- type VertexStepMode
- type WaylandSurface
- type WindowsHWND
- type XCBWindow
- type XlibWindow
Constants ¶
This section is empty.
Variables ¶
var ( ErrDeviceLost = errors.New("device lost") ErrUnknown = errors.New("unknown error") )
var ( ErrCurrentTextureTimeout = errors.New("timeout") ErrCurrentTextureOutdated = errors.New("outdated") ErrCurrentTextureLost = errors.New("lost") ErrCurrentTextureOutOfMemory = errors.New("out of memory") )
var ( ErrMapValidationError = errors.New("validation error") ErrMapDestroyedBeforeCallback = errors.New("destroyed before callback") ErrMapUnmappedBeforeCallback = errors.New("unmapped before callback") ErrMapMappingAlreadyPending = errors.New("mapping already pending") ErrMapOffsetOutOfRange = errors.New("offset out of range") ErrMapSizeOutOfRange = errors.New("size out of range") )
var DefaultLimits = Limits{
MaxTextureDimension1D: 8192,
MaxTextureDimension2D: 8192,
MaxTextureDimension3D: 2048,
MaxTextureArrayLayers: 256,
MaxBindGroups: 4,
MaxBindGroupsPlusVertexBuffers: 24,
MaxBindingsPerBindGroup: 1000,
MaxDynamicUniformBuffersPerPipelineLayout: 8,
MaxDynamicStorageBuffersPerPipelineLayout: 4,
MaxSampledTexturesPerShaderStage: 16,
MaxSamplersPerShaderStage: 16,
MaxStorageBuffersPerShaderStage: 8,
MaxStorageTexturesPerShaderStage: 4,
MaxUniformBuffersPerShaderStage: 12,
MaxUniformBufferBindingSize: 65536,
MaxStorageBufferBindingSize: 134217728,
MinUniformBufferOffsetAlignment: 256,
MinStorageBufferOffsetAlignment: 256,
MaxVertexBuffers: 8,
MaxBufferSize: 268435456,
MaxVertexAttributes: 16,
MaxVertexBufferArrayStride: 2048,
MaxInterStageShaderComponents: 64,
MaxInterStageShaderVariables: 16,
MaxColorAttachments: 8,
MaxColorAttachmentBytesPerSample: 32,
MaxComputeWorkgroupStorageSize: 16384,
MaxComputeInvocationsPerWorkgroup: 256,
MaxComputeWorkgroupSizeX: 256,
MaxComputeWorkgroupSizeY: 256,
MaxComputeWorkgroupSizeZ: 64,
MaxComputeWorkgroupsPerDimension: 65535,
}
var DefaultMultisampleState = &MultisampleState{ Count: 1, Mask: 0xFFFFFFFF, AlphaToCoverageEnabled: false, }
var DefaultNativeLimits = NativeLimits{ MaxPushConstantSize: ^uint32(0), MaxNonSamplerBindings: ^uint32(0), }
var DefaultPrimitiveState = &PrimitiveState{ Topology: PrimitiveTopologyTriangleList, StripIndexFormat: IndexFormatUndefined, FrontFace: FrontFaceCCW, CullMode: CullModeNone, }
var DefaultTextureViewDescriptor = &TextureViewDescriptor{ ArrayLayerCount: ^uint32(0), MipLevelCount: ^uint32(0), }
Functions ¶
func SetLogLevel ¶
func SetLogLevel(level LogLevel)
Types ¶
type Adapter ¶
type Adapter C.struct_WGPUAdapterImpl
func (*Adapter) Features ¶
func (adp *Adapter) Features() []FeatureName
func (*Adapter) HasFeature ¶
func (adp *Adapter) HasFeature(name FeatureName) bool
func (*Adapter) Properties ¶
func (adp *Adapter) Properties() AdapterProperties
func (*Adapter) RequestDevice ¶
func (adp *Adapter) RequestDevice(desc *DeviceDescriptor) (*Device, error)
type AdapterProperties ¶
type AdapterProperties struct {
VendorID uint32
VendorName string
Architecture string
DeviceID uint32
Name string
DriverDescription string
AdapterType AdapterType
BackendType BackendType
}
type AdapterType ¶
type AdapterType uint32
const ( AdapterTypeDiscreteGPU AdapterType = C.WGPUAdapterType_DiscreteGPU // DiscreteGPU AdapterTypeIntegratedGPU AdapterType = C.WGPUAdapterType_IntegratedGPU // IntegratedGPU AdapterTypeCPU AdapterType = C.WGPUAdapterType_CPU // CPU AdapterTypeUnknown AdapterType = C.WGPUAdapterType_Unknown // Unknown )
func (AdapterType) String ¶
func (i AdapterType) String() string
type AddressMode ¶
type AddressMode uint32
const ( AddressModeRepeat AddressMode = C.WGPUAddressMode_Repeat // Repeat AddressModeMirrorRepeat AddressMode = C.WGPUAddressMode_MirrorRepeat // MirrorRepeat AddressModeClampToEdge AddressMode = C.WGPUAddressMode_ClampToEdge // ClampToEdge )
func (AddressMode) String ¶
func (i AddressMode) String() string
type AllLimits ¶
type AllLimits struct {
Limits
NativeLimits
}
type AndroidNativeWindow ¶
type BackendType ¶
type BackendType uint32
const ( BackendTypeUndefined BackendType = C.WGPUBackendType_Undefined // Undefined BackendTypeNull BackendType = C.WGPUBackendType_Null // Null BackendTypeWebGPU BackendType = C.WGPUBackendType_WebGPU // WebGPU BackendTypeD3D11 BackendType = C.WGPUBackendType_D3D11 // D3D11 BackendTypeD3D12 BackendType = C.WGPUBackendType_D3D12 // D3D12 BackendTypeMetal BackendType = C.WGPUBackendType_Metal // Metal BackendTypeVulkan BackendType = C.WGPUBackendType_Vulkan // Vulkan BackendTypeOpenGL BackendType = C.WGPUBackendType_OpenGL // OpenGL BackendTypeOpenGLES BackendType = C.WGPUBackendType_OpenGLES // OpenGLES )
func (BackendType) String ¶
func (i BackendType) String() string
type BindGroup ¶
type BindGroup C.struct_WGPUBindGroupImpl
type BindGroupDescriptor ¶
type BindGroupDescriptor struct {
Label string
Layout *BindGroupLayout
Entries []BindGroupEntry
}
type BindGroupEntry ¶
type BindGroupEntry struct {
Binding uint32
Buffer *Buffer // nullable
Offset uint64
Size uint64
Sampler *Sampler // nullable
TextureView *TextureView // nullable
Buffers []*Buffer
Samplers []*Sampler
TextureViews []*TextureView
}
type BindGroupLayout ¶
type BindGroupLayout C.struct_WGPUBindGroupLayoutImpl
func (*BindGroupLayout) Release ¶
func (ptr *BindGroupLayout) Release()
type BindGroupLayoutDescriptor ¶
type BindGroupLayoutDescriptor struct {
Label string
Entries []BindGroupLayoutEntry
}
type BindGroupLayoutEntry ¶
type BindGroupLayoutEntry struct {
Binding uint32
Visibility ShaderStage
Buffer *BufferBindingLayout
Sampler *SamplerBindingLayout
Texture *TextureBindingLayout
StorageTexture *StorageTextureBindingLayout
Count uint32
}
type BlendComponent ¶
type BlendComponent struct {
Operation BlendOperation
SrcFactor BlendFactor
DstFactor BlendFactor
}
type BlendFactor ¶
type BlendFactor uint32
const ( BlendFactorZero BlendFactor = C.WGPUBlendFactor_Zero // Zero BlendFactorOne BlendFactor = C.WGPUBlendFactor_One // One BlendFactorSrc BlendFactor = C.WGPUBlendFactor_Src // Src BlendFactorOneMinusSrc BlendFactor = C.WGPUBlendFactor_OneMinusSrc // OneMinusSrc BlendFactorSrcAlpha BlendFactor = C.WGPUBlendFactor_SrcAlpha // SrcAlpha BlendFactorOneMinusSrcAlpha BlendFactor = C.WGPUBlendFactor_OneMinusSrcAlpha // OneMinusSrcAlpha BlendFactorDst BlendFactor = C.WGPUBlendFactor_Dst // Dst BlendFactorOneMinusDst BlendFactor = C.WGPUBlendFactor_OneMinusDst // OneMinusDst BlendFactorDstAlpha BlendFactor = C.WGPUBlendFactor_DstAlpha // DstAlpha BlendFactorOneMinusDstAlpha BlendFactor = C.WGPUBlendFactor_OneMinusDstAlpha // OneMinusDstAlpha BlendFactorSrcAlphaSaturated BlendFactor = C.WGPUBlendFactor_SrcAlphaSaturated // SrcAlphaSaturated BlendFactorConstant BlendFactor = C.WGPUBlendFactor_Constant // Constant BlendFactorOneMinusConstant BlendFactor = C.WGPUBlendFactor_OneMinusConstant // OneMinusConstant )
func (BlendFactor) String ¶
func (i BlendFactor) String() string
type BlendOperation ¶
type BlendOperation uint32
const ( BlendOperationAdd BlendOperation = C.WGPUBlendOperation_Add // Add BlendOperationSubtract BlendOperation = C.WGPUBlendOperation_Subtract // Subtract BlendOperationReverseSubtract BlendOperation = C.WGPUBlendOperation_ReverseSubtract // ReverseSubtract BlendOperationMin BlendOperation = C.WGPUBlendOperation_Min // Min BlendOperationMax BlendOperation = C.WGPUBlendOperation_Max // Max )
func (BlendOperation) String ¶
func (i BlendOperation) String() string
type BlendState ¶
type BlendState struct {
Color BlendComponent
Alpha BlendComponent
// contains filtered or unexported fields
}
type Buffer ¶
type Buffer C.struct_WGPUBufferImpl
func (*Buffer) MappedRange ¶
func (*Buffer) ReadOnlyMappedRange ¶
func (*Buffer) Usage ¶
func (buf *Buffer) Usage() BufferUsage
type BufferBindingLayout ¶
type BufferBindingLayout struct {
Type BufferBindingType
HasDynamicOffset bool
MinBindingSize uint64
}
type BufferBindingType ¶
type BufferBindingType uint32
const ( BufferBindingTypeUndefined BufferBindingType = C.WGPUBufferBindingType_Undefined // Undefined BufferBindingTypeUniform BufferBindingType = C.WGPUBufferBindingType_Uniform // Uniform BufferBindingTypeStorage BufferBindingType = C.WGPUBufferBindingType_Storage // Storage BufferBindingTypeReadOnlyStorage BufferBindingType = C.WGPUBufferBindingType_ReadOnlyStorage // ReadOnlyStorage )
func (BufferBindingType) String ¶
func (i BufferBindingType) String() string
type BufferDescriptor ¶
type BufferDescriptor struct {
Label string
Usage BufferUsage
Size uint64
MappedAtCreation bool
}
type BufferMapState ¶
type BufferMapState uint32
const ( BufferMapStateUnmapped BufferMapState = C.WGPUBufferMapState_Unmapped // Unmapped BufferMapStatePending BufferMapState = C.WGPUBufferMapState_Pending // Pending BufferMapStateMapped BufferMapState = C.WGPUBufferMapState_Mapped // Mapped )
func (BufferMapState) String ¶
func (i BufferMapState) String() string
type BufferUsage ¶
type BufferUsage uint32
const ( BufferUsageNone BufferUsage = C.WGPUBufferUsage_None // None BufferUsageMapRead BufferUsage = C.WGPUBufferUsage_MapRead // MapRead BufferUsageMapWrite BufferUsage = C.WGPUBufferUsage_MapWrite // MapWrite BufferUsageCopySrc BufferUsage = C.WGPUBufferUsage_CopySrc // CopySrc BufferUsageCopyDst BufferUsage = C.WGPUBufferUsage_CopyDst // CopyDst BufferUsageIndex BufferUsage = C.WGPUBufferUsage_Index // Index BufferUsageVertex BufferUsage = C.WGPUBufferUsage_Vertex // Vertex BufferUsageUniform BufferUsage = C.WGPUBufferUsage_Uniform // Uniform BufferUsageStorage BufferUsage = C.WGPUBufferUsage_Storage // Storage BufferUsageIndirect BufferUsage = C.WGPUBufferUsage_Indirect // Indirect BufferUsageQueryResolve BufferUsage = C.WGPUBufferUsage_QueryResolve // QueryResolve )
func (BufferUsage) String ¶
func (i BufferUsage) String() string
type ColorTargetState ¶
type ColorTargetState struct {
Format TextureFormat
Blend *BlendState
WriteMask ColorWriteMask
}
type ColorWriteMask ¶
type ColorWriteMask uint32
const ( ColorWriteMaskNone ColorWriteMask = C.WGPUColorWriteMask_None // None ColorWriteMaskRed ColorWriteMask = C.WGPUColorWriteMask_Red // Red ColorWriteMaskGreen ColorWriteMask = C.WGPUColorWriteMask_Green // Green ColorWriteMaskBlue ColorWriteMask = C.WGPUColorWriteMask_Blue // Blue ColorWriteMaskAlpha ColorWriteMask = C.WGPUColorWriteMask_Alpha // Alpha ColorWriteMaskAll ColorWriteMask = C.WGPUColorWriteMask_All // All )
func (ColorWriteMask) String ¶
func (i ColorWriteMask) String() string
type CommandBuffer ¶
type CommandBuffer C.struct_WGPUCommandBufferImpl
func (*CommandBuffer) Release ¶
func (ptr *CommandBuffer) Release()
type CommandBufferDescriptor ¶
type CommandBufferDescriptor struct {
Label string
}
type CommandEncoder ¶
type CommandEncoder C.struct_WGPUCommandEncoderImpl
func (*CommandEncoder) BeginComputePass ¶
func (enc *CommandEncoder) BeginComputePass(desc *ComputePassDescriptor) *ComputePassEncoder
func (*CommandEncoder) BeginRenderPass ¶
func (enc *CommandEncoder) BeginRenderPass(desc *RenderPassDescriptor) *RenderPassEncoder
func (*CommandEncoder) ClearBuffer ¶
func (enc *CommandEncoder) ClearBuffer(buf *Buffer, offset, size uint64)
func (*CommandEncoder) CopyBufferToBuffer ¶
func (*CommandEncoder) CopyBufferToTexture ¶
func (enc *CommandEncoder) CopyBufferToTexture(source *ImageCopyBuffer, destination *ImageCopyTexture, copySize *Extent3D)
func (*CommandEncoder) CopyTextureToBuffer ¶
func (enc *CommandEncoder) CopyTextureToBuffer(source *ImageCopyTexture, destination *ImageCopyBuffer, copySize *Extent3D)
func (*CommandEncoder) CopyTextureToTexture ¶
func (enc *CommandEncoder) CopyTextureToTexture(source *ImageCopyTexture, destination *ImageCopyTexture, copySize *Extent3D)
func (*CommandEncoder) Finish ¶
func (enc *CommandEncoder) Finish(desc *CommandBufferDescriptor) *CommandBuffer
func (*CommandEncoder) InsertDebugMarker ¶
func (enc *CommandEncoder) InsertDebugMarker(label string)
func (*CommandEncoder) PopDebugGroup ¶
func (enc *CommandEncoder) PopDebugGroup()
func (*CommandEncoder) PushDebugGroup ¶
func (enc *CommandEncoder) PushDebugGroup(label string)
func (*CommandEncoder) Release ¶
func (ptr *CommandEncoder) Release()
func (*CommandEncoder) ResolveQuerySet ¶
func (*CommandEncoder) WriteTimestamp ¶
func (enc *CommandEncoder) WriteTimestamp(q *QuerySet, queryIndex uint32)
type CommandEncoderDescriptor ¶
type CommandEncoderDescriptor struct {
Label string
}
type CompareFunction ¶
type CompareFunction uint32
const ( CompareFunctionUndefined CompareFunction = C.WGPUCompareFunction_Undefined // Undefined CompareFunctionNever CompareFunction = C.WGPUCompareFunction_Never // Never CompareFunctionLess CompareFunction = C.WGPUCompareFunction_Less // Less CompareFunctionLessEqual CompareFunction = C.WGPUCompareFunction_LessEqual // LessEqual CompareFunctionGreater CompareFunction = C.WGPUCompareFunction_Greater // Greater CompareFunctionGreaterEqual CompareFunction = C.WGPUCompareFunction_GreaterEqual // GreaterEqual CompareFunctionEqual CompareFunction = C.WGPUCompareFunction_Equal // Equal CompareFunctionNotEqual CompareFunction = C.WGPUCompareFunction_NotEqual // NotEqual CompareFunctionAlways CompareFunction = C.WGPUCompareFunction_Always // Always )
func (CompareFunction) String ¶
func (i CompareFunction) String() string
type CompositeAlphaMode ¶
type CompositeAlphaMode uint32
const ( CompositeAlphaModeAuto CompositeAlphaMode = C.WGPUCompositeAlphaMode_Auto // Auto CompositeAlphaModeOpaque CompositeAlphaMode = C.WGPUCompositeAlphaMode_Opaque // Opaque CompositeAlphaModePremultiplied CompositeAlphaMode = C.WGPUCompositeAlphaMode_Premultiplied // Premultiplied CompositeAlphaModeUnpremultiplied CompositeAlphaMode = C.WGPUCompositeAlphaMode_Unpremultiplied // Unpremultiplied CompositeAlphaModeInherit CompositeAlphaMode = C.WGPUCompositeAlphaMode_Inherit // Inherit )
func (CompositeAlphaMode) String ¶
func (i CompositeAlphaMode) String() string
type ComputePassDescriptor ¶
type ComputePassDescriptor struct {
Label string
TimestampWrites *ComputePassTimestampWrites // nullable
}
type ComputePassEncoder ¶
type ComputePassEncoder C.struct_WGPUComputePassEncoderImpl
func (*ComputePassEncoder) DispatchWorkgroups ¶
func (enc *ComputePassEncoder) DispatchWorkgroups(countX, countY, countZ uint32)
func (*ComputePassEncoder) DispatchWorkgroupsIndirect ¶
func (enc *ComputePassEncoder) DispatchWorkgroupsIndirect(indirectBuffer *Buffer, indirectOffset uint64)
func (*ComputePassEncoder) End ¶
func (enc *ComputePassEncoder) End()
func (*ComputePassEncoder) InsertDebugMarker ¶
func (enc *ComputePassEncoder) InsertDebugMarker(label string)
func (*ComputePassEncoder) PopDebugGroup ¶
func (enc *ComputePassEncoder) PopDebugGroup()
func (*ComputePassEncoder) PushDebugGroup ¶
func (enc *ComputePassEncoder) PushDebugGroup(label string)
func (*ComputePassEncoder) Release ¶
func (ptr *ComputePassEncoder) Release()
func (*ComputePassEncoder) SetBindGroup ¶
func (enc *ComputePassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)
func (*ComputePassEncoder) SetPipeline ¶
func (enc *ComputePassEncoder) SetPipeline(p *ComputePipeline)
type ComputePipeline ¶
type ComputePipeline C.struct_WGPUComputePipelineImpl
func (*ComputePipeline) BindGroupLayout ¶
func (p *ComputePipeline) BindGroupLayout(groupIndex uint32) *BindGroupLayout
func (*ComputePipeline) Release ¶
func (ptr *ComputePipeline) Release()
type ComputePipelineDescriptor ¶
type ComputePipelineDescriptor struct {
Label string
Layout *PipelineLayout // nullable
Compute ProgrammableStageDescriptor
}
type ConstantEntry ¶
type CullMode ¶
type CullMode uint32
const ( CullModeNone CullMode = C.WGPUCullMode_None // None CullModeFront CullMode = C.WGPUCullMode_Front // Front CullModeBack CullMode = C.WGPUCullMode_Back // Back )
type DX12Compiler ¶
type DX12Compiler uint32
const ( DX12CompilerUndefined DX12Compiler = C.WGPUDx12Compiler_Undefined // Undefined DX12CompilerFxc DX12Compiler = C.WGPUDx12Compiler_Fxc // Fxc DX12CompilerDxc DX12Compiler = C.WGPUDx12Compiler_Dxc // Dxc )
func (DX12Compiler) String ¶
func (i DX12Compiler) String() string
type DepthStencilState ¶
type DepthStencilState struct {
Format TextureFormat
DepthWriteEnabled bool
DepthCompare CompareFunction
StencilFront StencilFaceState
StencilBack StencilFaceState
StencilReadMask uint32
StencilWriteMask uint32
DepthBias int32
DepthBiasSlopeScale float32
DepthBiasClamp float32
}
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) CreateBindGroup ¶
func (dev *Device) CreateBindGroup(desc *BindGroupDescriptor) *BindGroup
func (*Device) CreateBindGroupLayout ¶
func (dev *Device) CreateBindGroupLayout(desc *BindGroupLayoutDescriptor) *BindGroupLayout
func (*Device) CreateBuffer ¶
func (dev *Device) CreateBuffer(desc *BufferDescriptor) *Buffer
func (*Device) CreateCommandEncoder ¶
func (dev *Device) CreateCommandEncoder(desc *CommandEncoderDescriptor) *CommandEncoder
func (*Device) CreateComputePipeline ¶
func (dev *Device) CreateComputePipeline(desc *ComputePipelineDescriptor) *ComputePipeline
func (*Device) CreatePipelineLayout ¶
func (dev *Device) CreatePipelineLayout(desc *PipelineLayoutDescriptor) *PipelineLayout
func (*Device) CreateQuerySet ¶
func (dev *Device) CreateQuerySet(desc *QuerySetDescriptor) *QuerySet
func (*Device) CreateRenderPipeline ¶
func (dev *Device) CreateRenderPipeline(desc *RenderPipelineDescriptor) *RenderPipeline
func (*Device) CreateSampler ¶
func (dev *Device) CreateSampler(desc *SamplerDescriptor) *Sampler
func (*Device) CreateShaderModule ¶
func (dev *Device) CreateShaderModule(desc ShaderModuleDescriptor) *ShaderModule
func (*Device) CreateTexture ¶
func (dev *Device) CreateTexture(desc *TextureDescriptor) *Texture
func (*Device) Destroy ¶
func (dev *Device) Destroy()
Destroy forcibly destroys the device handle, invalidating any resources that reference it, such as bind groups.
Note: it doesn't currently do anything because wgpu doesn't implement it yet
func (*Device) Features ¶
func (dev *Device) Features() []FeatureName
func (*Device) HasFeature ¶
func (dev *Device) HasFeature(name FeatureName) bool
func (*Device) Lost ¶
func (dev *Device) Lost() <-chan DeviceLost
Lost returns a channel that will be signaled when the device is lost. Repeated calls to Lost return the same channel.
func (*Device) PopErrorScope ¶
func (*Device) PushErrorScope ¶
func (dev *Device) PushErrorScope(filter ErrorFilter)
type DeviceDescriptor ¶
type DeviceDescriptor struct {
Label string
RequiredFeatures []FeatureName
RequiredLimits *RequiredLimits
DefaultQueue QueueDescriptor
}
type DeviceLost ¶
type DeviceLost struct {
Device *Device
Reason DeviceLostReason
Message string
}
type DeviceLostError ¶
type DeviceLostError struct {
// contains filtered or unexported fields
}
func (DeviceLostError) Error ¶
func (err DeviceLostError) Error() string
type DeviceLostReason ¶
type DeviceLostReason uint32
const ( DeviceLostReasonUndefined DeviceLostReason = C.WGPUDeviceLostReason_Undefined // Undefined DeviceLostReasonDestroyed DeviceLostReason = C.WGPUDeviceLostReason_Destroyed // Destroyed )
func (DeviceLostReason) String ¶
func (i DeviceLostReason) String() string
type ErrorFilter ¶
type ErrorFilter uint32
const ( ErrorFilterValidation ErrorFilter = C.WGPUErrorFilter_Validation // Validation ErrorFilterOutOfMemory ErrorFilter = C.WGPUErrorFilter_OutOfMemory // OutOfMemory ErrorFilterInternal ErrorFilter = C.WGPUErrorFilter_Internal // Internal )
func (ErrorFilter) String ¶
func (i ErrorFilter) String() string
type FeatureName ¶
type FeatureName uint32
const ( FeatureNameUndefined FeatureName = C.WGPUFeatureName_Undefined // Undefined FeatureNameDepthClipControl FeatureName = C.WGPUFeatureName_DepthClipControl // DepthClipControl FeatureNameDepth32FloatStencil8 FeatureName = C.WGPUFeatureName_Depth32FloatStencil8 // Depth32FloatStencil8 FeatureNameTimestampQuery FeatureName = C.WGPUFeatureName_TimestampQuery // TimestampQuery FeatureNameTextureCompressionBC FeatureName = C.WGPUFeatureName_TextureCompressionBC // TextureCompressionBC FeatureNameTextureCompressionETC2 FeatureName = C.WGPUFeatureName_TextureCompressionETC2 // TextureCompressionETC2 FeatureNameTextureCompressionASTC FeatureName = C.WGPUFeatureName_TextureCompressionASTC // TextureCompressionASTC FeatureNameIndirectFirstInstance FeatureName = C.WGPUFeatureName_IndirectFirstInstance // IndirectFirstInstance FeatureNameShaderF16 FeatureName = C.WGPUFeatureName_ShaderF16 // ShaderF16 FeatureNameRG11B10UfloatRenderable FeatureName = C.WGPUFeatureName_RG11B10UfloatRenderable // RG11B10UfloatRenderable FeatureNameBGRA8UnormStorage FeatureName = C.WGPUFeatureName_BGRA8UnormStorage // BGRA8UnormStorage FeatureNameFloat32Filterable FeatureName = C.WGPUFeatureName_Float32Filterable // Float32Filterable )
const ( NativeFeatureNamePushConstants FeatureName = C.WGPUNativeFeature_PushConstants // PushConstants NativeFeatureNameTextureAdapterSpecificFormatFeatures FeatureName = C.WGPUNativeFeature_TextureAdapterSpecificFormatFeatures // TextureAdapterSpecificFormatFeatures NativeFeatureNameMultiDrawIndirect FeatureName = C.WGPUNativeFeature_MultiDrawIndirect // MultiDrawIndirect NativeFeatureNameMultiDrawIndirectCount FeatureName = C.WGPUNativeFeature_MultiDrawIndirectCount // MultiDrawIndirectCount NativeFeatureNameVertexWritableStorage FeatureName = C.WGPUNativeFeature_VertexWritableStorage // VertexWritableStorage NativeFeatureNameTextureBindingArray FeatureName = C.WGPUNativeFeature_TextureBindingArray // TextureBindingArray NativeFeatureNameSampledTextureAndStorageBufferArrayNonUniformIndexing FeatureName = C.WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing // SampledTextureAndStorageBufferArrayNonUniformIndexing NativeFeatureNamePipelineStatisticsQuery FeatureName = C.WGPUNativeFeature_PipelineStatisticsQuery // PipelineStatisticsQuery NativeFeatureNameStorageResourceBindingArray FeatureName = C.WGPUNativeFeature_StorageResourceBindingArray // StorageResourceBindingArray NativeFeatureNamePartiallyBoundBindingArray FeatureName = C.WGPUNativeFeature_PartiallyBoundBindingArray // PartiallyBoundBindingArray )
func (FeatureName) String ¶
func (i FeatureName) String() string
type FilterMode ¶
type FilterMode uint32
const ( FilterModeNearest FilterMode = C.WGPUFilterMode_Nearest // Nearest FilterModeLinear FilterMode = C.WGPUFilterMode_Linear // Linear )
func (FilterMode) String ¶
func (i FilterMode) String() string
type FragmentState ¶
type FragmentState struct {
Module *ShaderModule
EntryPoint string
Constants []ConstantEntry
Targets []ColorTargetState
}
type FrontFace ¶
type FrontFace uint32
const ( FrontFaceCCW FrontFace = C.WGPUFrontFace_CCW // CCW FrontFaceCW FrontFace = C.WGPUFrontFace_CW // CW )
type GLES3MinorVersion ¶
type GLES3MinorVersion uint32
const ( GLES3MinorVersionAutomatic GLES3MinorVersion = C.WGPUGles3MinorVersion_Automatic // Automatic GLES3MinorVersionVersion0 GLES3MinorVersion = C.WGPUGles3MinorVersion_Version0 // Version0 GLES3MinorVersionVersion1 GLES3MinorVersion = C.WGPUGles3MinorVersion_Version1 // Version1 GLES3MinorVersionVersion2 GLES3MinorVersion = C.WGPUGles3MinorVersion_Version2 // Version2 )
func (GLES3MinorVersion) String ¶
func (i GLES3MinorVersion) String() string
type GlobalReport ¶
type GlobalReport struct {
Surfaces RegistryReport
BackendType BackendType
Vulkan HubReport
Metal HubReport
DX12 HubReport
GL HubReport
// contains filtered or unexported fields
}
type HubReport ¶
type HubReport struct {
Adapters RegistryReport
Devices RegistryReport
Queues RegistryReport
PipelineLayouts RegistryReport
ShaderModules RegistryReport
BindGroupLayouts RegistryReport
BindGroups RegistryReport
CommandBuffers RegistryReport
RenderBundles RegistryReport
RenderPipelines RegistryReport
ComputePipelines RegistryReport
QuerySets RegistryReport
Buffers RegistryReport
Textures RegistryReport
TextureViews RegistryReport
Samplers RegistryReport
// contains filtered or unexported fields
}
type ImageCopyBuffer ¶
type ImageCopyBuffer struct {
Layout TextureDataLayout
Buffer *Buffer
// contains filtered or unexported fields
}
type ImageCopyTexture ¶
type ImageCopyTexture struct {
Texture *Texture
MipLevel uint32
Origin Origin3D
Aspect TextureAspect
// contains filtered or unexported fields
}
type IndexFormat ¶
type IndexFormat uint32
const ( IndexFormatUndefined IndexFormat = C.WGPUIndexFormat_Undefined // Undefined IndexFormatUint16 IndexFormat = C.WGPUIndexFormat_Uint16 // Uint16 IndexFormatUint32 IndexFormat = C.WGPUIndexFormat_Uint32 // Uint32 )
func (IndexFormat) String ¶
func (i IndexFormat) String() string
type Instance ¶
type Instance C.struct_WGPUInstanceImpl
func CreateInstance ¶
func CreateInstance(desc InstanceDescriptor) *Instance
func (*Instance) Adapters ¶
func (ins *Instance) Adapters(opts InstanceEnumerateAdapterOptions) []*Adapter
Adapters returns all adapters available on this instance. The returned adapters are ready to use. You should call Adapter.Release on unneeded adapters.
func (*Instance) CreateSurface ¶
func (ins *Instance) CreateSurface(desc SurfaceDescriptor) *Surface
func (*Instance) Report ¶
func (ins *Instance) Report(out *GlobalReport)
func (*Instance) RequestAdapter ¶
func (ins *Instance) RequestAdapter(desc RequestAdapterOptions) (*Adapter, error)
type InstanceBackend ¶
type InstanceBackend uint32
const ( InstanceBackendAll InstanceBackend = C.WGPUInstanceBackend_All // All InstanceBackendVulkan InstanceBackend = C.WGPUInstanceBackend_Vulkan // Vulkan InstanceBackendGL InstanceBackend = C.WGPUInstanceBackend_GL // GL InstanceBackendMetal InstanceBackend = C.WGPUInstanceBackend_Metal // Metal InstanceBackendDX12 InstanceBackend = C.WGPUInstanceBackend_DX12 // DX12 InstanceBackendDX11 InstanceBackend = C.WGPUInstanceBackend_DX11 // DX11 InstanceBackendBrowserWebGPU InstanceBackend = C.WGPUInstanceBackend_BrowserWebGPU // BrowserWebGPU InstanceBackendPrimary InstanceBackend = C.WGPUInstanceBackend_Primary // Primary InstanceBackendSecondary InstanceBackend = C.WGPUInstanceBackend_Secondary // Secondary )
func (InstanceBackend) String ¶
func (i InstanceBackend) String() string
type InstanceBackendFlags ¶
type InstanceBackendFlags = InstanceBackend
type InstanceDescriptor ¶
type InstanceDescriptor struct {
Extras *InstanceExtras
}
type InstanceEnumerateAdapterOptions ¶
type InstanceEnumerateAdapterOptions struct {
Backends InstanceBackendFlags
}
type InstanceExtras ¶
type InstanceExtras struct {
Backends InstanceBackendFlags
Flags InstanceFlags
DX12ShaderCompiler DX12Compiler
GLES3MinorVersion GLES3MinorVersion
DXILPath string
DXCPath string
}
type InstanceFlag ¶
type InstanceFlag uint32
const ( InstanceFlagDefault InstanceFlag = C.WGPUInstanceFlag_Default // Default InstanceFlagDebug InstanceFlag = C.WGPUInstanceFlag_Debug // Debug InstanceFlagValidation InstanceFlag = C.WGPUInstanceFlag_Validation // Validation InstanceFlagDiscardHalLabels InstanceFlag = C.WGPUInstanceFlag_DiscardHalLabels // DiscardHalLabels )
func (InstanceFlag) String ¶
func (i InstanceFlag) String() string
type InstanceFlags ¶
type InstanceFlags = InstanceFlag
type InternalError ¶
type InternalError struct {
// contains filtered or unexported fields
}
func (InternalError) Error ¶
func (err InternalError) Error() string
type Limits ¶
type Limits struct {
MaxTextureDimension1D uint32
MaxTextureDimension2D uint32
MaxTextureDimension3D uint32
MaxTextureArrayLayers uint32
MaxBindGroups uint32
MaxBindGroupsPlusVertexBuffers uint32
MaxBindingsPerBindGroup uint32
MaxDynamicUniformBuffersPerPipelineLayout uint32
MaxDynamicStorageBuffersPerPipelineLayout uint32
MaxSampledTexturesPerShaderStage uint32
MaxSamplersPerShaderStage uint32
MaxStorageBuffersPerShaderStage uint32
MaxStorageTexturesPerShaderStage uint32
MaxUniformBuffersPerShaderStage uint32
MaxUniformBufferBindingSize uint64
MaxStorageBufferBindingSize uint64
MinUniformBufferOffsetAlignment uint32
MinStorageBufferOffsetAlignment uint32
MaxVertexBuffers uint32
MaxBufferSize uint64
MaxVertexAttributes uint32
MaxVertexBufferArrayStride uint32
MaxInterStageShaderComponents uint32
MaxInterStageShaderVariables uint32
MaxColorAttachments uint32
MaxColorAttachmentBytesPerSample uint32
MaxComputeWorkgroupStorageSize uint32
MaxComputeInvocationsPerWorkgroup uint32
MaxComputeWorkgroupSizeX uint32
MaxComputeWorkgroupSizeY uint32
MaxComputeWorkgroupSizeZ uint32
MaxComputeWorkgroupsPerDimension uint32
// contains filtered or unexported fields
}
type LoadOp ¶
type LoadOp uint32
const ( LoadOpUndefined LoadOp = C.WGPULoadOp_Undefined // Undefined LoadOpClear LoadOp = C.WGPULoadOp_Clear // Clear LoadOpLoad LoadOp = C.WGPULoadOp_Load // Load )
type LogLevel ¶
type LogLevel uint32
const ( LogLevelOff LogLevel = C.WGPULogLevel_Off // Off LogLevelError LogLevel = C.WGPULogLevel_Error // Error LogLevelWarn LogLevel = C.WGPULogLevel_Warn // Warn LogLevelInfo LogLevel = C.WGPULogLevel_Info // Info LogLevelDebug LogLevel = C.WGPULogLevel_Debug // Debug LogLevelTrace LogLevel = C.WGPULogLevel_Trace // Trace )
type MapMode ¶
type MapMode uint32
const ( MapModeNone MapMode = C.WGPUMapMode_None // None MapModeRead MapMode = C.WGPUMapMode_Read // Read MapModeWrite MapMode = C.WGPUMapMode_Write // Write )
type MetalLayer ¶
type MipmapFilterMode ¶
type MipmapFilterMode uint32
const ( MipmapFilterModeNearest MipmapFilterMode = C.WGPUMipmapFilterMode_Nearest // Nearest MipmapFilterModeLinear MipmapFilterMode = C.WGPUMipmapFilterMode_Linear // Linear )
func (MipmapFilterMode) String ¶
func (i MipmapFilterMode) String() string
type MultisampleState ¶
type NativeLimits ¶
type NativeSurface ¶
type NativeSurface interface {
// contains filtered or unexported methods
}
One of AndroidNativeWindow, MetalLayer, WaylandSurface, WindowsHWND, XCBWindow, or XlibWindow.
type OutOfMemoryError ¶
type OutOfMemoryError struct {
// contains filtered or unexported fields
}
func (OutOfMemoryError) Error ¶
func (err OutOfMemoryError) Error() string
type PipelineLayout ¶
type PipelineLayout C.struct_WGPUPipelineLayoutImpl
func (*PipelineLayout) Release ¶
func (ptr *PipelineLayout) Release()
type PipelineLayoutDescriptor ¶
type PipelineLayoutDescriptor struct {
Label string
BindGroupLayouts []*BindGroupLayout
}
type PowerPreference ¶
type PowerPreference uint32
const ( PowerPreferenceUndefined PowerPreference = C.WGPUPowerPreference_Undefined // Undefined PowerPreferenceLowPower PowerPreference = C.WGPUPowerPreference_LowPower // LowPower PowerPreferenceHighPerformance PowerPreference = C.WGPUPowerPreference_HighPerformance // HighPerformance )
func (PowerPreference) String ¶
func (i PowerPreference) String() string
type PresentMode ¶
type PresentMode uint32
const ( PresentModeFifo PresentMode = C.WGPUPresentMode_Fifo // Fifo PresentModeFifoRelaxed PresentMode = C.WGPUPresentMode_FifoRelaxed // FifoRelaxed PresentModeImmediate PresentMode = C.WGPUPresentMode_Immediate // Immediate PresentModeMailbox PresentMode = C.WGPUPresentMode_Mailbox // Mailbox )
func (PresentMode) String ¶
func (i PresentMode) String() string
type PrimitiveDepthClipControl ¶
type PrimitiveDepthClipControl struct {
UnclippedDepth bool
}
type PrimitiveState ¶
type PrimitiveState struct {
Topology PrimitiveTopology
StripIndexFormat IndexFormat
FrontFace FrontFace
CullMode CullMode
DepthClipControl *PrimitiveDepthClipControl
}
type PrimitiveTopology ¶
type PrimitiveTopology uint32
const ( PrimitiveTopologyPointList PrimitiveTopology = C.WGPUPrimitiveTopology_PointList // PointList PrimitiveTopologyLineList PrimitiveTopology = C.WGPUPrimitiveTopology_LineList // LineList PrimitiveTopologyLineStrip PrimitiveTopology = C.WGPUPrimitiveTopology_LineStrip // LineStrip PrimitiveTopologyTriangleList PrimitiveTopology = C.WGPUPrimitiveTopology_TriangleList // TriangleList PrimitiveTopologyTriangleStrip PrimitiveTopology = C.WGPUPrimitiveTopology_TriangleStrip // TriangleStrip )
func (PrimitiveTopology) String ¶
func (i PrimitiveTopology) String() string
type ProgrammableStageDescriptor ¶
type ProgrammableStageDescriptor struct {
Module *ShaderModule
EntryPoint string
Constants []ConstantEntry
}
type QuerySet ¶
type QuerySet C.struct_WGPUQuerySetImpl
type QuerySetDescriptor ¶
type QueryType ¶
type QueryType uint32
const ( QueryTypeOcclusion QueryType = C.WGPUQueryType_Occlusion // Occlusion QueryTypeTimestamp QueryType = C.WGPUQueryType_Timestamp // Timestamp )
type Queue ¶
type Queue C.struct_WGPUQueueImpl
func (*Queue) OnSubmittedWorkDone ¶
func (*Queue) Submit ¶
func (queue *Queue) Submit(commands ...*CommandBuffer)
func (*Queue) WriteTexture ¶
func (q *Queue) WriteTexture( destination *ImageCopyTexture, data []byte, dataLayout *TextureDataLayout, writeSize *Extent3D, )
type QueueDescriptor ¶
type QueueDescriptor struct {
Label string
}
type RegistryReport ¶
type RenderBundle ¶
type RenderBundle C.struct_WGPURenderBundleImpl
func (*RenderBundle) Release ¶
func (ptr *RenderBundle) Release()
type RenderBundleEncoder ¶
type RenderBundleEncoder C.struct_WGPURenderBundleEncoderImpl
func (*RenderBundleEncoder) Release ¶
func (ptr *RenderBundleEncoder) Release()
type RenderPassColorAttachment ¶
type RenderPassColorAttachment struct {
View *TextureView // nullable
ResolveTarget *TextureView // nullable
LoadOp LoadOp
StoreOp StoreOp
ClearValue Color
}
type RenderPassDescriptor ¶
type RenderPassDescriptor struct {
Label string
ColorAttachments []RenderPassColorAttachment
DepthStencilAttachment *RenderPassDepthStencilAttachment // nullable
OcclusionQuerySet *QuerySet // nullable
TimestampWrites *RenderPassTimestampWrites //nullable
}
type RenderPassEncoder ¶
type RenderPassEncoder C.struct_WGPURenderPassEncoderImpl
func (*RenderPassEncoder) BeginOcclusionQuery ¶
func (enc *RenderPassEncoder) BeginOcclusionQuery(queryIndex uint32)
func (*RenderPassEncoder) Draw ¶
func (enc *RenderPassEncoder) Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)
func (*RenderPassEncoder) DrawIndexed ¶
func (enc *RenderPassEncoder) DrawIndexed(indexCount, instanceCount, firstIndex uint32, baseVertex int32, firstInstance uint32)
func (*RenderPassEncoder) DrawIndexedIndirect ¶
func (enc *RenderPassEncoder) DrawIndexedIndirect(indirectBuffer *Buffer, indirectOffset uint64)
func (*RenderPassEncoder) DrawIndirect ¶
func (enc *RenderPassEncoder) DrawIndirect(indirectBuffer *Buffer, indirectOffset uint64)
func (*RenderPassEncoder) End ¶
func (enc *RenderPassEncoder) End()
func (*RenderPassEncoder) EndOcclusionQuery ¶
func (enc *RenderPassEncoder) EndOcclusionQuery()
func (*RenderPassEncoder) ExecuteBundles ¶
func (enc *RenderPassEncoder) ExecuteBundles(bundles ...*RenderBundle)
func (*RenderPassEncoder) InsertDebugMarker ¶
func (enc *RenderPassEncoder) InsertDebugMarker(markerLabel string)
func (*RenderPassEncoder) PopDebugGroup ¶
func (enc *RenderPassEncoder) PopDebugGroup()
func (*RenderPassEncoder) PushDebugGroup ¶
func (enc *RenderPassEncoder) PushDebugGroup(groupLabel string)
func (*RenderPassEncoder) Release ¶
func (ptr *RenderPassEncoder) Release()
func (*RenderPassEncoder) SetBindGroup ¶
func (enc *RenderPassEncoder) SetBindGroup( groupIndex uint32, group *BindGroup, dynamicOffsets []uint32, )
func (*RenderPassEncoder) SetBlendConstant ¶
func (enc *RenderPassEncoder) SetBlendConstant(color *Color)
func (*RenderPassEncoder) SetIndexBuffer ¶
func (enc *RenderPassEncoder) SetIndexBuffer(buffer *Buffer, format IndexFormat, offset, size uint64)
func (*RenderPassEncoder) SetPipeline ¶
func (enc *RenderPassEncoder) SetPipeline(p *RenderPipeline)
func (*RenderPassEncoder) SetScissorRect ¶
func (enc *RenderPassEncoder) SetScissorRect(x, y, width, height uint32)
func (*RenderPassEncoder) SetStencilReference ¶
func (enc *RenderPassEncoder) SetStencilReference(reference uint32)
func (*RenderPassEncoder) SetVertexBuffer ¶
func (enc *RenderPassEncoder) SetVertexBuffer(slot uint32, buffer *Buffer, offset, size uint64)
func (*RenderPassEncoder) SetViewport ¶
func (enc *RenderPassEncoder) SetViewport(x, y, width, height, minDepth, maxDepth float32)
type RenderPipeline ¶
type RenderPipeline C.struct_WGPURenderPipelineImpl
func (*RenderPipeline) BindGroupLayout ¶
func (p *RenderPipeline) BindGroupLayout(groupIndex uint32) *BindGroupLayout
func (*RenderPipeline) Release ¶
func (ptr *RenderPipeline) Release()
type RenderPipelineDescriptor ¶
type RenderPipelineDescriptor struct {
Label string // optional
Layout *PipelineLayout // optional
Vertex *VertexState
Primitive *PrimitiveState
DepthStencil *DepthStencilState // optional
Multisample *MultisampleState
Fragment *FragmentState // optional
}
type RequestAdapterError ¶
type RequestAdapterError struct {
Message string
}
func (RequestAdapterError) Error ¶
func (err RequestAdapterError) Error() string
type RequestAdapterOptions ¶
type RequestAdapterOptions struct {
CompatibleSurface *Surface
PowerPreference PowerPreference
ForceFallbackAdapter bool
}
type RequestDeviceError ¶
type RequestDeviceError struct {
Message string
}
func (RequestDeviceError) Error ¶
func (err RequestDeviceError) Error() string
type RequiredLimits ¶
type RequiredLimits struct {
Limits Limits
NativeLimits NativeLimits
}
type Sampler ¶
type Sampler C.struct_WGPUSamplerImpl
type SamplerBindingLayout ¶
type SamplerBindingLayout struct {
Type SamplerBindingType
}
type SamplerBindingType ¶
type SamplerBindingType uint32
const ( SamplerBindingTypeUndefined SamplerBindingType = C.WGPUSamplerBindingType_Undefined // Undefined SamplerBindingTypeFiltering SamplerBindingType = C.WGPUSamplerBindingType_Filtering // Filtering SamplerBindingTypeNonFiltering SamplerBindingType = C.WGPUSamplerBindingType_NonFiltering // NonFiltering SamplerBindingTypeComparison SamplerBindingType = C.WGPUSamplerBindingType_Comparison // Comparison )
func (SamplerBindingType) String ¶
func (i SamplerBindingType) String() string
type SamplerDescriptor ¶
type SamplerDescriptor struct {
Label string
AddressModeU AddressMode
AddressModeV AddressMode
AddressModeW AddressMode
MagFilter FilterMode
MinFilter FilterMode
MipmapFilter MipmapFilterMode
LODMinClamp float32
LODMaxClamp float32
Compare CompareFunction
MaxAnisotropy uint16
}
type ShaderModule ¶
type ShaderModule C.struct_WGPUShaderModuleImpl
func (*ShaderModule) Release ¶
func (ptr *ShaderModule) Release()
type ShaderModuleCompilationHint ¶
type ShaderModuleCompilationHint struct {
EntryPoint string
Layout *PipelineLayout
}
type ShaderModuleDescriptor ¶
type ShaderModuleDescriptor struct {
Label string
Hints []ShaderModuleCompilationHint
Source ShaderSource
}
type ShaderSource ¶
type ShaderSource interface {
// contains filtered or unexported methods
}
One of ShaderSourceWGSL.
type ShaderSourceWGSL ¶
type ShaderSourceWGSL []byte
type ShaderStage ¶
type ShaderStage uint32
const ( ShaderStageNone ShaderStage = C.WGPUShaderStage_None // None ShaderStageVertex ShaderStage = C.WGPUShaderStage_Vertex // Vertex ShaderStageFragment ShaderStage = C.WGPUShaderStage_Fragment // Fragment ShaderStageCompute ShaderStage = C.WGPUShaderStage_Compute // Compute )
func (ShaderStage) String ¶
func (i ShaderStage) String() string
type StencilFaceState ¶
type StencilFaceState struct {
Compare CompareFunction
FailOp StencilOperation
DepthFailOp StencilOperation
PassOp StencilOperation
// contains filtered or unexported fields
}
type StencilOperation ¶
type StencilOperation uint32
const ( StencilOperationKeep StencilOperation = C.WGPUStencilOperation_Keep // Keep StencilOperationZero StencilOperation = C.WGPUStencilOperation_Zero // Zero StencilOperationReplace StencilOperation = C.WGPUStencilOperation_Replace // Replace StencilOperationInvert StencilOperation = C.WGPUStencilOperation_Invert // Invert StencilOperationIncrementClamp StencilOperation = C.WGPUStencilOperation_IncrementClamp // IncrementClamp StencilOperationDecrementClamp StencilOperation = C.WGPUStencilOperation_DecrementClamp // DecrementClamp StencilOperationIncrementWrap StencilOperation = C.WGPUStencilOperation_IncrementWrap // IncrementWrap StencilOperationDecrementWrap StencilOperation = C.WGPUStencilOperation_DecrementWrap // DecrementWrap )
func (StencilOperation) String ¶
func (i StencilOperation) String() string
type StorageTextureAccess ¶
type StorageTextureAccess uint32
const ( StorageTextureAccessUndefined StorageTextureAccess = C.WGPUStorageTextureAccess_Undefined // Undefined StorageTextureAccessWriteOnly StorageTextureAccess = C.WGPUStorageTextureAccess_WriteOnly // WriteOnly StorageTextureAccessReadOnly StorageTextureAccess = C.WGPUStorageTextureAccess_ReadOnly // ReadOnly StorageTextureAccessReadWrite StorageTextureAccess = C.WGPUStorageTextureAccess_ReadWrite // ReadWrite )
func (StorageTextureAccess) String ¶
func (i StorageTextureAccess) String() string
type StorageTextureBindingLayout ¶
type StorageTextureBindingLayout struct {
Access StorageTextureAccess
Format TextureFormat
ViewDimension TextureViewDimension
}
type StoreOp ¶
type StoreOp uint32
const ( StoreOpUndefined StoreOp = C.WGPUStoreOp_Undefined // Undefined StoreOpStore StoreOp = C.WGPUStoreOp_Store // Store StoreOpDiscard StoreOp = C.WGPUStoreOp_Discard // Discard )
type Surface ¶
type Surface C.struct_WGPUSurfaceImpl
func (*Surface) Capabilities ¶
func (s *Surface) Capabilities(adapter *Adapter) SurfaceCapabilities
func (*Surface) Configure ¶
func (s *Surface) Configure(dev *Device, config *SurfaceConfiguration)
func (*Surface) CurrentTexture ¶
func (s *Surface) CurrentTexture() (SurfaceTexture, error)
func (*Surface) PreferredFormat ¶
func (s *Surface) PreferredFormat(adapter *Adapter) TextureFormat
func (*Surface) Unconfigure ¶
func (s *Surface) Unconfigure()
type SurfaceCapabilities ¶
type SurfaceCapabilities struct {
Formats []TextureFormat
PresentModes []PresentMode
AlphaModes []CompositeAlphaMode
}
type SurfaceConfiguration ¶
type SurfaceConfiguration struct {
Format TextureFormat
Usage TextureUsage
ViewFormats []TextureFormat
AlphaMode CompositeAlphaMode
Width uint32
Height uint32
PresentMode PresentMode
DesiredMaximumFrameLatency uint32
}
type SurfaceDescriptor ¶
type SurfaceDescriptor struct {
Label string
Native NativeSurface
}
type SurfaceTexture ¶
type Texture ¶
type Texture C.struct_WGPUTextureImpl
func (*Texture) CreateView ¶
func (tex *Texture) CreateView(desc *TextureViewDescriptor) *TextureView
func (*Texture) DepthOrArrayLayers ¶
func (*Texture) Dimension ¶
func (tex *Texture) Dimension() TextureDimension
func (*Texture) Format ¶
func (tex *Texture) Format() TextureFormat
func (*Texture) MipLevelCount ¶
func (*Texture) SampleCount ¶
func (*Texture) Usage ¶
func (tex *Texture) Usage() TextureUsage
type TextureAspect ¶
type TextureAspect uint32
const ( TextureAspectAll TextureAspect = C.WGPUTextureAspect_All // All TextureAspectStencilOnly TextureAspect = C.WGPUTextureAspect_StencilOnly // StencilOnly TextureAspectDepthOnly TextureAspect = C.WGPUTextureAspect_DepthOnly // DepthOnly )
func (TextureAspect) String ¶
func (i TextureAspect) String() string
type TextureBindingLayout ¶
type TextureBindingLayout struct {
SampleType TextureSampleType
ViewDimension TextureViewDimension
Multisampled bool
}
type TextureDataLayout ¶
type TextureDescriptor ¶
type TextureDescriptor struct {
Label string
Usage TextureUsage
Dimension TextureDimension
Size Extent3D
Format TextureFormat
MipLevelCount uint32
SampleCount uint32
ViewFormats []TextureFormat
}
type TextureDimension ¶
type TextureDimension uint32
const ( TextureDimension1D TextureDimension = C.WGPUTextureDimension_1D // 1D TextureDimension2D TextureDimension = C.WGPUTextureDimension_2D // 2D TextureDimension3D TextureDimension = C.WGPUTextureDimension_3D // 3D )
func (TextureDimension) String ¶
func (i TextureDimension) String() string
type TextureFormat ¶
type TextureFormat uint32
const ( TextureFormatUndefined TextureFormat = C.WGPUTextureFormat_Undefined // Undefined TextureFormatR8Unorm TextureFormat = C.WGPUTextureFormat_R8Unorm // R8Unorm TextureFormatR8Snorm TextureFormat = C.WGPUTextureFormat_R8Snorm // R8Snorm TextureFormatR8Uint TextureFormat = C.WGPUTextureFormat_R8Uint // R8Uint TextureFormatR8Sint TextureFormat = C.WGPUTextureFormat_R8Sint // R8Sint TextureFormatR16Uint TextureFormat = C.WGPUTextureFormat_R16Uint // R16Uint TextureFormatR16Sint TextureFormat = C.WGPUTextureFormat_R16Sint // R16Sint TextureFormatR16Float TextureFormat = C.WGPUTextureFormat_R16Float // R16Float TextureFormatRG8Unorm TextureFormat = C.WGPUTextureFormat_RG8Unorm // RG8Unorm TextureFormatRG8Snorm TextureFormat = C.WGPUTextureFormat_RG8Snorm // RG8Snorm TextureFormatRG8Uint TextureFormat = C.WGPUTextureFormat_RG8Uint // RG8Uint TextureFormatRG8Sint TextureFormat = C.WGPUTextureFormat_RG8Sint // RG8Sint TextureFormatR32Float TextureFormat = C.WGPUTextureFormat_R32Float // R32Float TextureFormatR32Uint TextureFormat = C.WGPUTextureFormat_R32Uint // R32Uint TextureFormatR32Sint TextureFormat = C.WGPUTextureFormat_R32Sint // R32Sint TextureFormatRG16Uint TextureFormat = C.WGPUTextureFormat_RG16Uint // RG16Uint TextureFormatRG16Sint TextureFormat = C.WGPUTextureFormat_RG16Sint // RG16Sint TextureFormatRG16Float TextureFormat = C.WGPUTextureFormat_RG16Float // RG16Float TextureFormatRGBA8Unorm TextureFormat = C.WGPUTextureFormat_RGBA8Unorm // RGBA8Unorm TextureFormatRGBA8UnormSrgb TextureFormat = C.WGPUTextureFormat_RGBA8UnormSrgb // RGBA8UnormSrgb TextureFormatRGBA8Snorm TextureFormat = C.WGPUTextureFormat_RGBA8Snorm // RGBA8Snorm TextureFormatRGBA8Uint TextureFormat = C.WGPUTextureFormat_RGBA8Uint // RGBA8Uint TextureFormatRGBA8Sint TextureFormat = C.WGPUTextureFormat_RGBA8Sint // RGBA8Sint TextureFormatBGRA8Unorm TextureFormat = C.WGPUTextureFormat_BGRA8Unorm // BGRA8Unorm TextureFormatBGRA8UnormSrgb TextureFormat = C.WGPUTextureFormat_BGRA8UnormSrgb // BGRA8UnormSrgb TextureFormatRGB10A2Uint TextureFormat = C.WGPUTextureFormat_RGB10A2Uint // RGB10A2Uint TextureFormatRGB10A2Unorm TextureFormat = C.WGPUTextureFormat_RGB10A2Unorm // RGB10A2Unorm TextureFormatRG11B10Ufloat TextureFormat = C.WGPUTextureFormat_RG11B10Ufloat // RG11B10Ufloat TextureFormatRGB9E5Ufloat TextureFormat = C.WGPUTextureFormat_RGB9E5Ufloat // RGB9E5Ufloat TextureFormatRG32Float TextureFormat = C.WGPUTextureFormat_RG32Float // RG32Float TextureFormatRG32Uint TextureFormat = C.WGPUTextureFormat_RG32Uint // RG32Uint TextureFormatRG32Sint TextureFormat = C.WGPUTextureFormat_RG32Sint // RG32Sint TextureFormatRGBA16Uint TextureFormat = C.WGPUTextureFormat_RGBA16Uint // RGBA16Uint TextureFormatRGBA16Sint TextureFormat = C.WGPUTextureFormat_RGBA16Sint // RGBA16Sint TextureFormatRGBA16Float TextureFormat = C.WGPUTextureFormat_RGBA16Float // RGBA16Float TextureFormatRGBA32Float TextureFormat = C.WGPUTextureFormat_RGBA32Float // RGBA32Float TextureFormatRGBA32Uint TextureFormat = C.WGPUTextureFormat_RGBA32Uint // RGBA32Uint TextureFormatRGBA32Sint TextureFormat = C.WGPUTextureFormat_RGBA32Sint // RGBA32Sint TextureFormatStencil8 TextureFormat = C.WGPUTextureFormat_Stencil8 // Stencil8 TextureFormatDepth16Unorm TextureFormat = C.WGPUTextureFormat_Depth16Unorm // Depth16Unorm TextureFormatDepth24Plus TextureFormat = C.WGPUTextureFormat_Depth24Plus // Depth24Plus TextureFormatDepth24PlusStencil8 TextureFormat = C.WGPUTextureFormat_Depth24PlusStencil8 // Depth24PlusStencil8 TextureFormatDepth32Float TextureFormat = C.WGPUTextureFormat_Depth32Float // Depth32Float TextureFormatDepth32FloatStencil8 TextureFormat = C.WGPUTextureFormat_Depth32FloatStencil8 // Depth32FloatStencil8 TextureFormatBC1RGBAUnorm TextureFormat = C.WGPUTextureFormat_BC1RGBAUnorm // BC1RGBAUnorm TextureFormatBC1RGBAUnormSrgb TextureFormat = C.WGPUTextureFormat_BC1RGBAUnormSrgb // BC1RGBAUnormSrgb TextureFormatBC2RGBAUnorm TextureFormat = C.WGPUTextureFormat_BC2RGBAUnorm // BC2RGBAUnorm TextureFormatBC2RGBAUnormSrgb TextureFormat = C.WGPUTextureFormat_BC2RGBAUnormSrgb // BC2RGBAUnormSrgb TextureFormatBC3RGBAUnorm TextureFormat = C.WGPUTextureFormat_BC3RGBAUnorm // BC3RGBAUnorm TextureFormatBC3RGBAUnormSrgb TextureFormat = C.WGPUTextureFormat_BC3RGBAUnormSrgb // BC3RGBAUnormSrgb TextureFormatBC4RUnorm TextureFormat = C.WGPUTextureFormat_BC4RUnorm // BC4RUnorm TextureFormatBC4RSnorm TextureFormat = C.WGPUTextureFormat_BC4RSnorm // BC4RSnorm TextureFormatBC5RGUnorm TextureFormat = C.WGPUTextureFormat_BC5RGUnorm // BC5RGUnorm TextureFormatBC5RGSnorm TextureFormat = C.WGPUTextureFormat_BC5RGSnorm // BC5RGSnorm TextureFormatBC6HRGBUfloat TextureFormat = C.WGPUTextureFormat_BC6HRGBUfloat // BC6HRGBUfloat TextureFormatBC6HRGBFloat TextureFormat = C.WGPUTextureFormat_BC6HRGBFloat // BC6HRGBFloat TextureFormatBC7RGBAUnorm TextureFormat = C.WGPUTextureFormat_BC7RGBAUnorm // BC7RGBAUnorm TextureFormatBC7RGBAUnormSrgb TextureFormat = C.WGPUTextureFormat_BC7RGBAUnormSrgb // BC7RGBAUnormSrgb TextureFormatETC2RGB8Unorm TextureFormat = C.WGPUTextureFormat_ETC2RGB8Unorm // ETC2RGB8Unorm TextureFormatETC2RGB8UnormSrgb TextureFormat = C.WGPUTextureFormat_ETC2RGB8UnormSrgb // ETC2RGB8UnormSrgb TextureFormatETC2RGB8A1Unorm TextureFormat = C.WGPUTextureFormat_ETC2RGB8A1Unorm // ETC2RGB8A1Unorm TextureFormatETC2RGB8A1UnormSrgb TextureFormat = C.WGPUTextureFormat_ETC2RGB8A1UnormSrgb // ETC2RGB8A1UnormSrgb TextureFormatETC2RGBA8Unorm TextureFormat = C.WGPUTextureFormat_ETC2RGBA8Unorm // ETC2RGBA8Unorm TextureFormatETC2RGBA8UnormSrgb TextureFormat = C.WGPUTextureFormat_ETC2RGBA8UnormSrgb // ETC2RGBA8UnormSrgb TextureFormatEACR11Unorm TextureFormat = C.WGPUTextureFormat_EACR11Unorm // EACR11Unorm TextureFormatEACR11Snorm TextureFormat = C.WGPUTextureFormat_EACR11Snorm // EACR11Snorm TextureFormatEACRG11Unorm TextureFormat = C.WGPUTextureFormat_EACRG11Unorm // EACRG11Unorm TextureFormatEACRG11Snorm TextureFormat = C.WGPUTextureFormat_EACRG11Snorm // EACRG11Snorm TextureFormatASTC4x4Unorm TextureFormat = C.WGPUTextureFormat_ASTC4x4Unorm // ASTC4x4Unorm TextureFormatASTC4x4UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC4x4UnormSrgb // ASTC4x4UnormSrgb TextureFormatASTC5x4Unorm TextureFormat = C.WGPUTextureFormat_ASTC5x4Unorm // ASTC5x4Unorm TextureFormatASTC5x4UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC5x4UnormSrgb // ASTC5x4UnormSrgb TextureFormatASTC5x5Unorm TextureFormat = C.WGPUTextureFormat_ASTC5x5Unorm // ASTC5x5Unorm TextureFormatASTC5x5UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC5x5UnormSrgb // ASTC5x5UnormSrgb TextureFormatASTC6x5Unorm TextureFormat = C.WGPUTextureFormat_ASTC6x5Unorm // ASTC6x5Unorm TextureFormatASTC6x5UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC6x5UnormSrgb // ASTC6x5UnormSrgb TextureFormatASTC6x6Unorm TextureFormat = C.WGPUTextureFormat_ASTC6x6Unorm // ASTC6x6Unorm TextureFormatASTC6x6UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC6x6UnormSrgb // ASTC6x6UnormSrgb TextureFormatASTC8x5Unorm TextureFormat = C.WGPUTextureFormat_ASTC8x5Unorm // ASTC8x5Unorm TextureFormatASTC8x5UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC8x5UnormSrgb // ASTC8x5UnormSrgb TextureFormatASTC8x6Unorm TextureFormat = C.WGPUTextureFormat_ASTC8x6Unorm // ASTC8x6Unorm TextureFormatASTC8x6UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC8x6UnormSrgb // ASTC8x6UnormSrgb TextureFormatASTC8x8Unorm TextureFormat = C.WGPUTextureFormat_ASTC8x8Unorm // ASTC8x8Unorm TextureFormatASTC8x8UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC8x8UnormSrgb // ASTC8x8UnormSrgb TextureFormatASTC10x5Unorm TextureFormat = C.WGPUTextureFormat_ASTC10x5Unorm // ASTC10x5Unorm TextureFormatASTC10x5UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC10x5UnormSrgb // ASTC10x5UnormSrgb TextureFormatASTC10x6Unorm TextureFormat = C.WGPUTextureFormat_ASTC10x6Unorm // ASTC10x6Unorm TextureFormatASTC10x6UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC10x6UnormSrgb // ASTC10x6UnormSrgb TextureFormatASTC10x8Unorm TextureFormat = C.WGPUTextureFormat_ASTC10x8Unorm // ASTC10x8Unorm TextureFormatASTC10x8UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC10x8UnormSrgb // ASTC10x8UnormSrgb TextureFormatASTC10x10Unorm TextureFormat = C.WGPUTextureFormat_ASTC10x10Unorm // ASTC10x10Unorm TextureFormatASTC10x10UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC10x10UnormSrgb // ASTC10x10UnormSrgb TextureFormatASTC12x10Unorm TextureFormat = C.WGPUTextureFormat_ASTC12x10Unorm // ASTC12x10Unorm TextureFormatASTC12x10UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC12x10UnormSrgb // ASTC12x10UnormSrgb TextureFormatASTC12x12Unorm TextureFormat = C.WGPUTextureFormat_ASTC12x12Unorm // ASTC12x12Unorm TextureFormatASTC12x12UnormSrgb TextureFormat = C.WGPUTextureFormat_ASTC12x12UnormSrgb // ASTC12x12UnormSrgb )
func (TextureFormat) BlockCopySize ¶
func (tf TextureFormat) BlockCopySize(aspect TextureAspect) (uint32, bool)
func (TextureFormat) String ¶
func (i TextureFormat) String() string
type TextureSampleType ¶
type TextureSampleType uint32
const ( TextureSampleTypeUndefined TextureSampleType = C.WGPUTextureSampleType_Undefined // Undefined TextureSampleTypeFloat TextureSampleType = C.WGPUTextureSampleType_Float // Float TextureSampleTypeUnfilterableFloat TextureSampleType = C.WGPUTextureSampleType_UnfilterableFloat // UnfilterableFloat TextureSampleTypeDepth TextureSampleType = C.WGPUTextureSampleType_Depth // Depth TextureSampleTypeSint TextureSampleType = C.WGPUTextureSampleType_Sint // Sint TextureSampleTypeUint TextureSampleType = C.WGPUTextureSampleType_Uint // Uint )
func (TextureSampleType) String ¶
func (i TextureSampleType) String() string
type TextureUsage ¶
type TextureUsage uint32
const ( TextureUsageNone TextureUsage = C.WGPUTextureUsage_None // None TextureUsageCopySrc TextureUsage = C.WGPUTextureUsage_CopySrc // CopySrc TextureUsageCopyDst TextureUsage = C.WGPUTextureUsage_CopyDst // CopyDst TextureUsageTextureBinding TextureUsage = C.WGPUTextureUsage_TextureBinding // TextureBinding TextureUsageStorageBinding TextureUsage = C.WGPUTextureUsage_StorageBinding // StorageBinding TextureUsageRenderAttachment TextureUsage = C.WGPUTextureUsage_RenderAttachment // RenderAttachment )
func (TextureUsage) String ¶
func (i TextureUsage) String() string
type TextureView ¶
type TextureView C.struct_WGPUTextureViewImpl
func (*TextureView) Release ¶
func (ptr *TextureView) Release()
type TextureViewDescriptor ¶
type TextureViewDescriptor struct {
Label string
Format TextureFormat
Dimension TextureViewDimension
BaseMipLevel uint32
MipLevelCount uint32
BaseArrayLayer uint32
ArrayLayerCount uint32
Aspect TextureAspect
}
type TextureViewDimension ¶
type TextureViewDimension uint32
const ( TextureViewDimensionUndefined TextureViewDimension = C.WGPUTextureViewDimension_Undefined // undefined TextureViewDimension1D TextureViewDimension = C.WGPUTextureViewDimension_1D // 1D TextureViewDimension2D TextureViewDimension = C.WGPUTextureViewDimension_2D // 2D TextureViewDimension2DArray TextureViewDimension = C.WGPUTextureViewDimension_2DArray // 2DArray TextureViewDimensionCube TextureViewDimension = C.WGPUTextureViewDimension_Cube // Cube TextureViewDimensionCubeArray TextureViewDimension = C.WGPUTextureViewDimension_CubeArray // CubeArray TextureViewDimension3D TextureViewDimension = C.WGPUTextureViewDimension_3D // 3D )
func (TextureViewDimension) String ¶
func (i TextureViewDimension) String() string
type UnknownError ¶
type UnknownError struct {
// contains filtered or unexported fields
}
func (UnknownError) Error ¶
func (err UnknownError) Error() string
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (ValidationError) Error ¶
func (err ValidationError) Error() string
type VertexAttribute ¶
type VertexAttribute struct {
Format VertexFormat
Offset uint64
ShaderLocation uint32
}
type VertexBufferLayout ¶
type VertexBufferLayout struct {
ArrayStride uint64
StepMode VertexStepMode
Attributes []VertexAttribute
}
type VertexFormat ¶
type VertexFormat uint32
const ( VertexFormatUndefined VertexFormat = C.WGPUVertexFormat_Undefined // Undefined VertexFormatUint8x2 VertexFormat = C.WGPUVertexFormat_Uint8x2 // Uint8x2 VertexFormatUint8x4 VertexFormat = C.WGPUVertexFormat_Uint8x4 // Uint8x4 VertexFormatSint8x2 VertexFormat = C.WGPUVertexFormat_Sint8x2 // Sint8x2 VertexFormatSint8x4 VertexFormat = C.WGPUVertexFormat_Sint8x4 // Sint8x4 VertexFormatUnorm8x2 VertexFormat = C.WGPUVertexFormat_Unorm8x2 // Unorm8x2 VertexFormatUnorm8x4 VertexFormat = C.WGPUVertexFormat_Unorm8x4 // Unorm8x4 VertexFormatSnorm8x2 VertexFormat = C.WGPUVertexFormat_Snorm8x2 // Snorm8x2 VertexFormatSnorm8x4 VertexFormat = C.WGPUVertexFormat_Snorm8x4 // Snorm8x4 VertexFormatUint16x2 VertexFormat = C.WGPUVertexFormat_Uint16x2 // Uint16x2 VertexFormatUint16x4 VertexFormat = C.WGPUVertexFormat_Uint16x4 // Uint16x4 VertexFormatSint16x2 VertexFormat = C.WGPUVertexFormat_Sint16x2 // Sint16x2 VertexFormatSint16x4 VertexFormat = C.WGPUVertexFormat_Sint16x4 // Sint16x4 VertexFormatUnorm16x2 VertexFormat = C.WGPUVertexFormat_Unorm16x2 // Unorm16x2 VertexFormatUnorm16x4 VertexFormat = C.WGPUVertexFormat_Unorm16x4 // Unorm16x4 VertexFormatSnorm16x2 VertexFormat = C.WGPUVertexFormat_Snorm16x2 // Snorm16x2 VertexFormatSnorm16x4 VertexFormat = C.WGPUVertexFormat_Snorm16x4 // Snorm16x4 VertexFormatFloat16x2 VertexFormat = C.WGPUVertexFormat_Float16x2 // Float16x2 VertexFormatFloat16x4 VertexFormat = C.WGPUVertexFormat_Float16x4 // Float16x4 VertexFormatFloat32 VertexFormat = C.WGPUVertexFormat_Float32 // Float32 VertexFormatFloat32x2 VertexFormat = C.WGPUVertexFormat_Float32x2 // Float32x2 VertexFormatFloat32x3 VertexFormat = C.WGPUVertexFormat_Float32x3 // Float32x3 VertexFormatFloat32x4 VertexFormat = C.WGPUVertexFormat_Float32x4 // Float32x4 VertexFormatUint32 VertexFormat = C.WGPUVertexFormat_Uint32 // Uint32 VertexFormatUint32x2 VertexFormat = C.WGPUVertexFormat_Uint32x2 // Uint32x2 VertexFormatUint32x3 VertexFormat = C.WGPUVertexFormat_Uint32x3 // Uint32x3 VertexFormatUint32x4 VertexFormat = C.WGPUVertexFormat_Uint32x4 // Uint32x4 VertexFormatSint32 VertexFormat = C.WGPUVertexFormat_Sint32 // Sint32 VertexFormatSint32x2 VertexFormat = C.WGPUVertexFormat_Sint32x2 // Sint32x2 VertexFormatSint32x3 VertexFormat = C.WGPUVertexFormat_Sint32x3 // Sint32x3 VertexFormatSint32x4 VertexFormat = C.WGPUVertexFormat_Sint32x4 // Sint32x4 )
func (VertexFormat) String ¶
func (i VertexFormat) String() string
type VertexState ¶
type VertexState struct {
Module *ShaderModule
EntryPoint string
Constants []ConstantEntry
Buffers []VertexBufferLayout
}
type VertexStepMode ¶
type VertexStepMode uint32
const ( VertexStepModeVertex VertexStepMode = C.WGPUVertexStepMode_Vertex // Vertex VertexStepModeInstance VertexStepMode = C.WGPUVertexStepMode_Instance // Instance VertexStepModeVertexBufferNotUsed VertexStepMode = C.WGPUVertexStepMode_VertexBufferNotUsed // VertexBufferNotUsed )
func (VertexStepMode) String ¶
func (i VertexStepMode) String() string