wgpu

package
v1.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 11

Documentation

Overview

Package wgpu provides WebGPU bindings for golang

## Memory Management The wgpu package offers two ways of memory management that complement each other. In good go-fashion garbage collection works as expected. Every wgpu object returned by the api will be released automatically once it is garbage collected.

There is a small caviat when using garbage collection with externally allocated objects. The golang garbage collector does not know about the size of the wgpu object you've allocated. E.g. for a large texture it only sees the ~64byte allocation of wgpu.Texture, not the 20mb of texture data in gpu memory. Allocating and keeping around 100 textures is not a problem for golangs garbage collector, it might be for your system.

To handle this case, this package also offers a way to manually release resources. Each wgpu object has a Release() method. Once called, it will immediately release the underlaying wgpu object. It is okay to call Release() on an already released instance.

Sometimes you want to hand out wgpu objects from your code that the caller is not supposed to release, e.g. for caching. You can mark those instances as "shared" by calling the wgpu.Share method on the object. If you do that, the object returned will only be released during garbage collection, and explicit calls to Release will be a noop.

Code generated by ./cmd/wrappers: DO NOT EDIT.

Index

Constants

View Source
const (
	ArrayLayerCountUndefined        = 0xffffffff
	CopyStrideUndefined             = 0xffffffff
	LimitU32Undefined        uint32 = 0xffffffff
	LimitU64Undefined        uint64 = 0xffffffffffffffff
	MipLevelCountUndefined          = 0xffffffff
	WholeMapSize                    = ^uint(0)
	WholeSize                       = 0xffffffffffffffff
)
View Source
const (
	// Buffer-Texture copies must have `TextureDataLayout.BytesPerRow` aligned to this number.
	//
	// This doesn't apply to `(*Queue).TryWriteTexture()`.
	CopyBytesPerRowAlignment = 256
	// An offset into the query resolve buffer has to be aligned to this.
	QueryResolveBufferAlignment = 256
	// Buffer to buffer copy as well as buffer clear offsets and sizes must be aligned to this number.
	CopyBufferAlignment = 4
	// Size to align mappings.
	MapAlignment = 8
	// Vertex buffer strides have to be aligned to this number.
	VertexStrideAlignment = 4
	// Alignment all push constants need
	PushConstantAlignment = 4
	// Maximum queries in a query set
	QuerySetMaxQueries = 8192
	// Size of a single piece of query data.
	QuerySize = 8
)

Variables

View Source
var (
	ColorTransparent = Color{0, 0, 0, 0}
	ColorBlack       = Color{0, 0, 0, 1}
	ColorWhite       = Color{1, 1, 1, 1}
	ColorRed         = Color{1, 0, 0, 1}
	ColorGreen       = Color{0, 1, 0, 1}
	ColorBlue        = Color{0, 0, 1, 1}

	BlendComponentReplace = BlendComponent{
		SrcFactor: BlendFactorOne,
		DstFactor: BlendFactorZero,
		Operation: BlendOperationAdd,
	}
	BlendComponentOver = BlendComponent{
		SrcFactor: BlendFactorOne,
		DstFactor: BlendFactorOneMinusSrcAlpha,
		Operation: BlendOperationAdd,
	}

	BlendStateReplace = BlendState{
		Color: BlendComponentReplace,
		Alpha: BlendComponentReplace,
	}
	BlendStateAlphaBlending = BlendState{
		Color: BlendComponent{
			SrcFactor: BlendFactorSrcAlpha,
			DstFactor: BlendFactorOneMinusSrcAlpha,
			Operation: BlendOperationAdd,
		},
		Alpha: BlendComponentOver,
	}
	BlendStatePremultipliedAlphaBlending = BlendState{
		Color: BlendComponentOver,
		Alpha: BlendComponentOver,
	}
)

Functions

func FromBytes

func FromBytes[E any](src []byte) []E

func SetLogLevel

func SetLogLevel(level LogLevel)

func Share added in v1.33.3

func Share[T Shareable](s T) T

Share marks the given wgpu object as shared. A call to Release() will become a noop and the object will only be released once the garbage collector collects the object.

Check the package documentation for more details on memory management.

func ToBytes

func ToBytes[E any](src []E) []byte

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func (*Adapter) GetFeatures

func (g *Adapter) GetFeatures() []FeatureName

func (*Adapter) GetInfo

func (g *Adapter) GetInfo() AdapterInfo

func (*Adapter) GetLimits

func (g *Adapter) GetLimits() Limits

func (*Adapter) HasFeature

func (g *Adapter) HasFeature(feature FeatureName) bool

func (*Adapter) IsValid added in v1.30.2

func (g *Adapter) IsValid() bool

func (*Adapter) Release

func (g *Adapter) Release()

func (*Adapter) RequestDevice

func (g *Adapter) RequestDevice(descriptor *DeviceDescriptor) (*Device, error)

type AdapterInfo

type AdapterInfo struct {
	Vendor       string
	Architecture string
	Device       string
	Description  string
	AdapterType  AdapterType
	BackendType  BackendType
	VendorId     uint32
	DeviceId     uint32
}

type AdapterType

type AdapterType uint32
const AdapterTypeCPU AdapterType = 0x00000003
const AdapterTypeDiscreteGPU AdapterType = 0x00000001
const AdapterTypeIntegratedGPU AdapterType = 0x00000002
const AdapterTypeUnknown AdapterType = 0x00000004

func (AdapterType) String

func (v AdapterType) String() string

type AddressMode

type AddressMode uint32
const AddressModeClampToEdge AddressMode = 0x00000001
const AddressModeMirrorRepeat AddressMode = 0x00000003
const AddressModeRepeat AddressMode = 0x00000002
const AddressModeUndefined AddressMode = 0x00000000

func (AddressMode) String

func (v AddressMode) String() string

type BackendType

type BackendType uint32
const BackendTypeD3D11 BackendType = 0x00000003
const BackendTypeD3D12 BackendType = 0x00000004
const BackendTypeMetal BackendType = 0x00000005
const BackendTypeNull BackendType = 0x00000001
const BackendTypeOpenGL BackendType = 0x00000007
const BackendTypeOpenGLES BackendType = 0x00000008
const BackendTypeUndefined BackendType = 0x00000000
const BackendTypeVulkan BackendType = 0x00000006
const BackendTypeWebGPU BackendType = 0x00000002

func (BackendType) String

func (v BackendType) String() string

type BindGroup

type BindGroup struct {
	// contains filtered or unexported fields
}

func (*BindGroup) IsValid added in v1.30.2

func (g *BindGroup) IsValid() bool

func (*BindGroup) Release

func (g *BindGroup) Release()

type BindGroupDescriptor

type BindGroupDescriptor struct {
	Label   string
	Layout  *BindGroupLayout
	Entries []BindGroupEntry
}

BindGroupDescriptor as described: https://gpuweb.github.io/gpuweb/#dictdef-gpubindgroupdescriptor

type BindGroupEntry

type BindGroupEntry struct {
	Binding     uint32
	Buffer      *Buffer
	Offset      uint64
	Size        uint64
	Sampler     *Sampler
	TextureView *TextureView
}

BindGroupEntry as described: https://gpuweb.github.io/gpuweb/#dictdef-gpubindgroupentry

type BindGroupLayout

type BindGroupLayout struct {
	// contains filtered or unexported fields
}

func (*BindGroupLayout) IsValid added in v1.30.2

func (g *BindGroupLayout) IsValid() bool

func (*BindGroupLayout) Release

func (g *BindGroupLayout) Release()

type BindGroupLayoutDescriptor

type BindGroupLayoutDescriptor struct {
	Label   string
	Entries []BindGroupLayoutEntry
}

BindGroupLayoutDescriptor as described: https://gpuweb.github.io/gpuweb/#dictdef-gpubindgrouplayoutdescriptor

type BindGroupLayoutEntry

type BindGroupLayoutEntry struct {
	Binding        uint32
	Visibility     ShaderStage
	Buffer         BufferBindingLayout
	Sampler        SamplerBindingLayout
	Texture        TextureBindingLayout
	StorageTexture StorageTextureBindingLayout
}

type BlendComponent

type BlendComponent struct {
	Operation BlendOperation
	SrcFactor BlendFactor
	DstFactor BlendFactor
}

type BlendFactor

type BlendFactor uint32
const BlendFactorConstant BlendFactor = 0x0000000C
const BlendFactorDst BlendFactor = 0x00000007
const BlendFactorDstAlpha BlendFactor = 0x00000009
const BlendFactorOne BlendFactor = 0x00000002
const BlendFactorOneMinusConstant BlendFactor = 0x0000000D
const BlendFactorOneMinusDst BlendFactor = 0x00000008
const BlendFactorOneMinusDstAlpha BlendFactor = 0x0000000A
const BlendFactorOneMinusSrc BlendFactor = 0x00000004
const BlendFactorOneMinusSrc1 BlendFactor = 0x0000000F
const BlendFactorOneMinusSrc1Alpha BlendFactor = 0x00000011
const BlendFactorOneMinusSrcAlpha BlendFactor = 0x00000006
const BlendFactorSrc BlendFactor = 0x00000003
const BlendFactorSrc1 BlendFactor = 0x0000000E
const BlendFactorSrc1Alpha BlendFactor = 0x00000010
const BlendFactorSrcAlpha BlendFactor = 0x00000005
const BlendFactorSrcAlphaSaturated BlendFactor = 0x0000000B
const BlendFactorUndefined BlendFactor = 0x00000000
const BlendFactorZero BlendFactor = 0x00000001

func (BlendFactor) String

func (v BlendFactor) String() string

type BlendOperation

type BlendOperation uint32
const BlendOperationAdd BlendOperation = 0x00000001
const BlendOperationMax BlendOperation = 0x00000005
const BlendOperationMin BlendOperation = 0x00000004
const BlendOperationReverseSubtract BlendOperation = 0x00000003
const BlendOperationSubtract BlendOperation = 0x00000002
const BlendOperationUndefined BlendOperation = 0x00000000

func (BlendOperation) String

func (v BlendOperation) String() string

type BlendState

type BlendState struct {
	Color BlendComponent
	Alpha BlendComponent
}

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func (*Buffer) Destroy

func (p *Buffer) Destroy()

func (*Buffer) GetMappedRange

func (p *Buffer) GetMappedRange(offset, size uint) []byte

func (*Buffer) GetSize

func (p *Buffer) GetSize() uint64

func (*Buffer) GetUsage

func (p *Buffer) GetUsage() BufferUsage

func (*Buffer) IsValid added in v1.30.2

func (g *Buffer) IsValid() bool

func (*Buffer) MapAsync

func (p *Buffer) MapAsync(mode MapMode, offset uint64, size uint64, callback BufferMapCallback)

func (*Buffer) Release

func (g *Buffer) Release()

func (*Buffer) TryMapAsync added in v0.27.1

func (p *Buffer) TryMapAsync(mode MapMode, offset uint64, size uint64, callback BufferMapCallback) error

func (*Buffer) TryUnmap added in v0.27.1

func (p *Buffer) TryUnmap() error

func (*Buffer) Unmap

func (p *Buffer) Unmap()

type BufferBindingLayout

type BufferBindingLayout struct {
	Type             BufferBindingType
	HasDynamicOffset bool
	MinBindingSize   uint64
}

type BufferBindingType

type BufferBindingType uint32
const BufferBindingTypeBindingNotUsed BufferBindingType = 0x00000000
const BufferBindingTypeReadOnlyStorage BufferBindingType = 0x00000004
const BufferBindingTypeStorage BufferBindingType = 0x00000003
const BufferBindingTypeUndefined BufferBindingType = 0x00000001
const BufferBindingTypeUniform BufferBindingType = 0x00000002

func (BufferBindingType) String

func (v BufferBindingType) String() string

type BufferDescriptor

type BufferDescriptor struct {
	Label            string
	Usage            BufferUsage
	Size             uint64
	MappedAtCreation bool
}

BufferDescriptor as described: https://gpuweb.github.io/gpuweb/#gpubufferdescriptor

type BufferInitDescriptor

type BufferInitDescriptor struct {
	Label    string
	Contents []byte
	Usage    BufferUsage
}

type BufferMapCallback

type BufferMapCallback func(MapAsyncStatus)

type BufferMapState

type BufferMapState uint32
const BufferMapStateMapped BufferMapState = 0x00000003
const BufferMapStatePending BufferMapState = 0x00000002
const BufferMapStateUnmapped BufferMapState = 0x00000001

func (BufferMapState) String

func (v BufferMapState) String() string

type BufferUsage

type BufferUsage uint64
const BufferUsageCopyDst BufferUsage = 0x00000008
const BufferUsageCopySrc BufferUsage = 0x00000004
const BufferUsageIndex BufferUsage = 0x00000010
const BufferUsageIndirect BufferUsage = 0x00000100
const BufferUsageMapRead BufferUsage = 0x00000001
const BufferUsageMapWrite BufferUsage = 0x00000002
const BufferUsageNone BufferUsage = 0x00000000
const BufferUsageQueryResolve BufferUsage = 0x00000200
const BufferUsageStorage BufferUsage = 0x00000080
const BufferUsageUniform BufferUsage = 0x00000040
const BufferUsageVertex BufferUsage = 0x00000020

func (BufferUsage) String added in v0.27.1

func (v BufferUsage) String() string

type CallbackMode

type CallbackMode uint32
const CallbackModeAllowProcessEvents CallbackMode = 0x00000002
const CallbackModeAllowSpontaneous CallbackMode = 0x00000003
const CallbackModeWaitAnyOnly CallbackMode = 0x00000001

func (CallbackMode) String

func (v CallbackMode) String() string

type Color

type Color struct {
	R, G, B, A float64
}

Color as described: https://gpuweb.github.io/gpuweb/#typedefdef-gpucolor

type ColorTargetState

type ColorTargetState struct {
	Format    TextureFormat
	Blend     *BlendState
	WriteMask ColorWriteMask
}

type ColorWriteMask

type ColorWriteMask uint64
const ColorWriteMaskAll ColorWriteMask = 0x0000000F
const ColorWriteMaskAlpha ColorWriteMask = 0x00000008
const ColorWriteMaskBlue ColorWriteMask = 0x00000004
const ColorWriteMaskGreen ColorWriteMask = 0x00000002
const ColorWriteMaskNone ColorWriteMask = 0x00000000
const ColorWriteMaskRed ColorWriteMask = 0x00000001

func (ColorWriteMask) String added in v0.27.1

func (v ColorWriteMask) String() string

type CommandBuffer

type CommandBuffer struct {
	// contains filtered or unexported fields
}

func (*CommandBuffer) IsValid added in v1.30.2

func (g *CommandBuffer) IsValid() bool

func (*CommandBuffer) Release

func (g *CommandBuffer) Release()

type CommandBufferDescriptor

type CommandBufferDescriptor struct {
	Label string
}

type CommandEncoder

type CommandEncoder struct {
	// contains filtered or unexported fields
}

func (*CommandEncoder) BeginComputePass

func (p *CommandEncoder) BeginComputePass(descriptor *ComputePassDescriptor) *ComputePassEncoder

func (*CommandEncoder) BeginRenderPass

func (p *CommandEncoder) BeginRenderPass(descriptor *RenderPassDescriptor) *RenderPassEncoder

func (*CommandEncoder) ClearBuffer

func (p *CommandEncoder) ClearBuffer(buffer *Buffer, offset uint64, size uint64)

func (*CommandEncoder) CopyBufferToBuffer

func (p *CommandEncoder) CopyBufferToBuffer(source *Buffer, sourceOffset uint64, destination *Buffer, destinationOffset uint64, size uint64)

func (*CommandEncoder) CopyBufferToTexture

func (p *CommandEncoder) CopyBufferToTexture(source *TexelCopyBufferInfo, destination *TexelCopyTextureInfo, copySize *Extent3D)

func (*CommandEncoder) CopyTextureToBuffer

func (p *CommandEncoder) CopyTextureToBuffer(source *TexelCopyTextureInfo, destination *TexelCopyBufferInfo, copySize *Extent3D)

func (*CommandEncoder) CopyTextureToTexture

func (p *CommandEncoder) CopyTextureToTexture(source *TexelCopyTextureInfo, destination *TexelCopyTextureInfo, copySize *Extent3D)

func (*CommandEncoder) Finish

func (p *CommandEncoder) Finish(descriptor *CommandBufferDescriptor) *CommandBuffer

func (*CommandEncoder) InsertDebugMarker

func (p *CommandEncoder) InsertDebugMarker(markerLabel string)

func (*CommandEncoder) IsValid added in v1.30.2

func (g *CommandEncoder) IsValid() bool

func (*CommandEncoder) PopDebugGroup

func (p *CommandEncoder) PopDebugGroup()

func (*CommandEncoder) PushDebugGroup

func (p *CommandEncoder) PushDebugGroup(groupLabel string)

func (*CommandEncoder) Release

func (g *CommandEncoder) Release()

func (*CommandEncoder) ResolveQuerySet

func (p *CommandEncoder) ResolveQuerySet(querySet *QuerySet, firstQuery uint32, queryCount uint32, destination *Buffer, destinationOffset uint64)

func (*CommandEncoder) TryBeginRenderPass added in v1.34.0

func (p *CommandEncoder) TryBeginRenderPass(descriptor *RenderPassDescriptor) (*RenderPassEncoder, error)

func (*CommandEncoder) TryClearBuffer added in v0.27.1

func (p *CommandEncoder) TryClearBuffer(buffer *Buffer, offset uint64, size uint64) error

func (*CommandEncoder) TryCopyBufferToBuffer added in v0.27.1

func (p *CommandEncoder) TryCopyBufferToBuffer(source *Buffer, sourceOffset uint64, destination *Buffer, destinationOffset uint64, size uint64) error

func (*CommandEncoder) TryCopyBufferToTexture added in v0.27.1

func (p *CommandEncoder) TryCopyBufferToTexture(source *TexelCopyBufferInfo, destination *TexelCopyTextureInfo, copySize *Extent3D) error

func (*CommandEncoder) TryCopyTextureToBuffer added in v0.27.1

func (p *CommandEncoder) TryCopyTextureToBuffer(source *TexelCopyTextureInfo, destination *TexelCopyBufferInfo, copySize *Extent3D) error

func (*CommandEncoder) TryCopyTextureToTexture added in v0.27.1

func (p *CommandEncoder) TryCopyTextureToTexture(source *TexelCopyTextureInfo, destination *TexelCopyTextureInfo, copySize *Extent3D) error

func (*CommandEncoder) TryFinish added in v0.27.1

func (p *CommandEncoder) TryFinish(descriptor *CommandBufferDescriptor) (*CommandBuffer, error)

func (*CommandEncoder) TryInsertDebugMarker added in v0.27.1

func (p *CommandEncoder) TryInsertDebugMarker(markerLabel string) error

func (*CommandEncoder) TryPopDebugGroup added in v0.27.1

func (p *CommandEncoder) TryPopDebugGroup() error

func (*CommandEncoder) TryPushDebugGroup added in v0.27.1

func (p *CommandEncoder) TryPushDebugGroup(groupLabel string) error

func (*CommandEncoder) TryResolveQuerySet added in v0.27.1

func (p *CommandEncoder) TryResolveQuerySet(querySet *QuerySet, firstQuery uint32, queryCount uint32, destination *Buffer, destinationOffset uint64) error

type CommandEncoderDescriptor

type CommandEncoderDescriptor struct {
	Label string
}

type CompareFunction

type CompareFunction uint32
const CompareFunctionAlways CompareFunction = 0x00000008
const CompareFunctionEqual CompareFunction = 0x00000003
const CompareFunctionGreater CompareFunction = 0x00000005
const CompareFunctionGreaterEqual CompareFunction = 0x00000007
const CompareFunctionLess CompareFunction = 0x00000002
const CompareFunctionLessEqual CompareFunction = 0x00000004
const CompareFunctionNever CompareFunction = 0x00000001
const CompareFunctionNotEqual CompareFunction = 0x00000006
const CompareFunctionUndefined CompareFunction = 0x00000000

func (CompareFunction) String

func (v CompareFunction) String() string

type CompilationInfoRequestStatus

type CompilationInfoRequestStatus uint32
const CompilationInfoRequestStatusCallbackCancelled CompilationInfoRequestStatus = 0x00000002
const CompilationInfoRequestStatusSuccess CompilationInfoRequestStatus = 0x00000001

func (CompilationInfoRequestStatus) String

type CompilationMessageType

type CompilationMessageType uint32
const CompilationMessageTypeError CompilationMessageType = 0x00000001
const CompilationMessageTypeInfo CompilationMessageType = 0x00000003
const CompilationMessageTypeWarning CompilationMessageType = 0x00000002

func (CompilationMessageType) String

func (v CompilationMessageType) String() string

type ComponentSwizzle added in v1.30.0

type ComponentSwizzle uint32
const ComponentSwizzleA ComponentSwizzle = 0x00000006
const ComponentSwizzleB ComponentSwizzle = 0x00000005
const ComponentSwizzleG ComponentSwizzle = 0x00000004
const ComponentSwizzleOne ComponentSwizzle = 0x00000002
const ComponentSwizzleR ComponentSwizzle = 0x00000003
const ComponentSwizzleUndefined ComponentSwizzle = 0x00000000
const ComponentSwizzleZero ComponentSwizzle = 0x00000001

func (ComponentSwizzle) String added in v1.30.0

func (v ComponentSwizzle) String() string

type CompositeAlphaMode

type CompositeAlphaMode uint32
const CompositeAlphaModeAuto CompositeAlphaMode = 0x00000000
const CompositeAlphaModeInherit CompositeAlphaMode = 0x00000004
const CompositeAlphaModeOpaque CompositeAlphaMode = 0x00000001
const CompositeAlphaModePremultiplied CompositeAlphaMode = 0x00000002
const CompositeAlphaModeUnpremultiplied CompositeAlphaMode = 0x00000003

func (CompositeAlphaMode) String

func (v CompositeAlphaMode) String() string

type ComputePassDescriptor

type ComputePassDescriptor struct {
	Label string
}

type ComputePassEncoder

type ComputePassEncoder struct {
	// contains filtered or unexported fields
}

func (*ComputePassEncoder) BeginPipelineStatisticsQuery

func (p *ComputePassEncoder) BeginPipelineStatisticsQuery(querySet *QuerySet, queryIndex uint32)

func (*ComputePassEncoder) DispatchWorkgroups

func (p *ComputePassEncoder) DispatchWorkgroups(workgroupCountX, workgroupCountY, workgroupCountZ uint32)

func (*ComputePassEncoder) DispatchWorkgroupsIndirect

func (p *ComputePassEncoder) DispatchWorkgroupsIndirect(indirectBuffer *Buffer, indirectOffset uint64)

func (*ComputePassEncoder) End

func (p *ComputePassEncoder) End()

func (*ComputePassEncoder) EndPipelineStatisticsQuery

func (p *ComputePassEncoder) EndPipelineStatisticsQuery()

func (*ComputePassEncoder) InsertDebugMarker

func (p *ComputePassEncoder) InsertDebugMarker(markerLabel string)

func (*ComputePassEncoder) IsValid added in v1.30.2

func (g *ComputePassEncoder) IsValid() bool

func (*ComputePassEncoder) PopDebugGroup

func (p *ComputePassEncoder) PopDebugGroup()

func (*ComputePassEncoder) PushDebugGroup

func (p *ComputePassEncoder) PushDebugGroup(groupLabel string)

func (*ComputePassEncoder) Release

func (g *ComputePassEncoder) Release()

func (*ComputePassEncoder) SetBindGroup

func (p *ComputePassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)

func (*ComputePassEncoder) SetPipeline

func (p *ComputePassEncoder) SetPipeline(pipeline *ComputePipeline)

func (*ComputePassEncoder) TryEnd added in v0.27.1

func (p *ComputePassEncoder) TryEnd() error

type ComputePipeline

type ComputePipeline struct {
	// contains filtered or unexported fields
}

func (*ComputePipeline) GetBindGroupLayout

func (g *ComputePipeline) GetBindGroupLayout(groupIndex uint32) *BindGroupLayout

func (*ComputePipeline) IsValid added in v1.30.2

func (g *ComputePipeline) IsValid() bool

func (*ComputePipeline) Release

func (g *ComputePipeline) Release()

type ComputePipelineDescriptor

type ComputePipelineDescriptor struct {
	Label   string
	Layout  *PipelineLayout
	Compute ProgrammableStageDescriptor
}

type CreatePipelineAsyncStatus

type CreatePipelineAsyncStatus uint32
const CreatePipelineAsyncStatusCallbackCancelled CreatePipelineAsyncStatus = 0x00000002
const CreatePipelineAsyncStatusInternalError CreatePipelineAsyncStatus = 0x00000004
const CreatePipelineAsyncStatusSuccess CreatePipelineAsyncStatus = 0x00000001
const CreatePipelineAsyncStatusValidationError CreatePipelineAsyncStatus = 0x00000003

func (CreatePipelineAsyncStatus) String

func (v CreatePipelineAsyncStatus) String() string

type CullMode

type CullMode uint32
const CullModeBack CullMode = 0x00000003
const CullModeFront CullMode = 0x00000002
const CullModeNone CullMode = 0x00000001
const CullModeUndefined CullMode = 0x00000000

func (CullMode) String

func (v CullMode) String() string

type DepthStencilState

type DepthStencilState struct {
	Format              TextureFormat
	DepthWriteEnabled   OptionalBool
	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 (g *Device) CreateBindGroup(descriptor *BindGroupDescriptor) *BindGroup

func (*Device) CreateBindGroupLayout

func (g *Device) CreateBindGroupLayout(descriptor *BindGroupLayoutDescriptor) *BindGroupLayout

func (*Device) CreateBuffer

func (g *Device) CreateBuffer(descriptor *BufferDescriptor) *Buffer

func (*Device) CreateBufferInit

func (g *Device) CreateBufferInit(descriptor *BufferInitDescriptor) *Buffer

func (*Device) CreateCommandEncoder

func (g *Device) CreateCommandEncoder(descriptor *CommandEncoderDescriptor) *CommandEncoder

func (*Device) CreateComputePipeline

func (g *Device) CreateComputePipeline(descriptor *ComputePipelineDescriptor) *ComputePipeline

func (*Device) CreatePipelineLayout

func (g *Device) CreatePipelineLayout(descriptor *PipelineLayoutDescriptor) *PipelineLayout

func (*Device) CreateQuerySet

func (g *Device) CreateQuerySet(descriptor *QuerySetDescriptor) *QuerySet

func (*Device) CreateRenderBundleEncoder

func (g *Device) CreateRenderBundleEncoder(descriptor *RenderBundleEncoderDescriptor) *RenderBundleEncoder

func (*Device) CreateRenderPipeline

func (g *Device) CreateRenderPipeline(descriptor *RenderPipelineDescriptor) *RenderPipeline

func (*Device) CreateSampler

func (g *Device) CreateSampler(descriptor *SamplerDescriptor) *Sampler

func (*Device) CreateShaderModule

func (g *Device) CreateShaderModule(descriptor *ShaderModuleDescriptor) *ShaderModule

func (*Device) CreateTexture

func (g *Device) CreateTexture(descriptor *TextureDescriptor) *Texture

func (*Device) GetFeatures

func (g *Device) GetFeatures() []FeatureName

func (*Device) GetLimits

func (g *Device) GetLimits() Limits

func (*Device) GetQueue

func (g *Device) GetQueue() *Queue

func (*Device) HasFeature

func (g *Device) HasFeature(feature FeatureName) bool

func (*Device) IsValid added in v1.30.2

func (g *Device) IsValid() bool

func (*Device) Poll

func (g *Device) Poll(wait bool, submissionIndex *uint64) (queueEmpty bool)

func (*Device) Release

func (g *Device) Release()

func (*Device) TryCreateBindGroup added in v0.27.1

func (g *Device) TryCreateBindGroup(descriptor *BindGroupDescriptor) (*BindGroup, error)

func (*Device) TryCreateBindGroupLayout added in v0.27.1

func (g *Device) TryCreateBindGroupLayout(descriptor *BindGroupLayoutDescriptor) (*BindGroupLayout, error)

func (*Device) TryCreateBuffer added in v0.27.1

func (g *Device) TryCreateBuffer(descriptor *BufferDescriptor) (*Buffer, error)

func (*Device) TryCreateBufferInit added in v0.27.1

func (g *Device) TryCreateBufferInit(descriptor *BufferInitDescriptor) (*Buffer, error)

func (*Device) TryCreateCommandEncoder added in v0.27.1

func (g *Device) TryCreateCommandEncoder(descriptor *CommandEncoderDescriptor) (*CommandEncoder, error)

func (*Device) TryCreateComputePipeline added in v0.27.1

func (g *Device) TryCreateComputePipeline(descriptor *ComputePipelineDescriptor) (*ComputePipeline, error)

func (*Device) TryCreatePipelineLayout added in v0.27.1

func (g *Device) TryCreatePipelineLayout(descriptor *PipelineLayoutDescriptor) (*PipelineLayout, error)

func (*Device) TryCreateQuerySet added in v0.27.1

func (g *Device) TryCreateQuerySet(descriptor *QuerySetDescriptor) (*QuerySet, error)

func (*Device) TryCreateRenderBundleEncoder added in v0.27.1

func (g *Device) TryCreateRenderBundleEncoder(descriptor *RenderBundleEncoderDescriptor) (*RenderBundleEncoder, error)

func (*Device) TryCreateRenderPipeline added in v0.27.1

func (g *Device) TryCreateRenderPipeline(descriptor *RenderPipelineDescriptor) (*RenderPipeline, error)

func (*Device) TryCreateSampler added in v0.27.1

func (g *Device) TryCreateSampler(descriptor *SamplerDescriptor) (*Sampler, error)

func (*Device) TryCreateShaderModule added in v0.27.1

func (g *Device) TryCreateShaderModule(descriptor *ShaderModuleDescriptor) (*ShaderModule, error)

func (*Device) TryCreateTexture added in v0.27.1

func (g *Device) TryCreateTexture(descriptor *TextureDescriptor) (*Texture, error)

type DeviceDescriptor

type DeviceDescriptor struct {
	Label              string
	RequiredFeatures   []FeatureName
	RequiredLimits     *Limits
	DeviceLostCallback DeviceLostCallback
	TracePath          string
}

type DeviceLostCallback

type DeviceLostCallback func(reason DeviceLostReason, message string)

type DeviceLostReason

type DeviceLostReason uint32
const DeviceLostReasonCallbackCancelled DeviceLostReason = 0x00000003
const DeviceLostReasonDestroyed DeviceLostReason = 0x00000002
const DeviceLostReasonFailedCreation DeviceLostReason = 0x00000004
const DeviceLostReasonUnknown DeviceLostReason = 0x00000001

func (DeviceLostReason) String

func (v DeviceLostReason) String() string

type Dx12Compiler

type Dx12Compiler uint32
const Dx12CompilerDxc Dx12Compiler = 0x00000002
const Dx12CompilerFxc Dx12Compiler = 0x00000001
const Dx12CompilerUndefined Dx12Compiler = 0x00000000

func (Dx12Compiler) String

func (v Dx12Compiler) String() string

type Dx12SwapchainKind added in v1.30.0

type Dx12SwapchainKind uint32
const Dx12SwapchainKindDxgiFromHwnd Dx12SwapchainKind = 0x00000001
const Dx12SwapchainKindDxgiFromVisual Dx12SwapchainKind = 0x00000002
const Dx12SwapchainKindUndefined Dx12SwapchainKind = 0x00000000

func (Dx12SwapchainKind) String added in v1.30.0

func (v Dx12SwapchainKind) String() string

type Error

type Error struct {
	Context string
	Wrapped error
}

func (Error) Error

func (v Error) Error() string

func (Error) Unwrap added in v0.27.1

func (v Error) Unwrap() error

type ErrorFilter

type ErrorFilter uint32
const ErrorFilterInternal ErrorFilter = 0x00000003
const ErrorFilterOutOfMemory ErrorFilter = 0x00000002
const ErrorFilterValidation ErrorFilter = 0x00000001

func (ErrorFilter) String

func (v ErrorFilter) String() string

type ErrorType

type ErrorType uint32
const ErrorTypeInternal ErrorType = 0x00000004
const ErrorTypeNoError ErrorType = 0x00000001
const ErrorTypeOutOfMemory ErrorType = 0x00000003
const ErrorTypeUnknown ErrorType = 0x00000005
const ErrorTypeValidation ErrorType = 0x00000002

func (ErrorType) String

func (v ErrorType) String() string

type Extent3D

type Extent3D struct {
	Width              uint32
	Height             uint32
	DepthOrArrayLayers uint32
}

type FeatureLevel

type FeatureLevel uint32
const FeatureLevelCompatibility FeatureLevel = 0x00000001
const FeatureLevelCore FeatureLevel = 0x00000002
const FeatureLevelUndefined FeatureLevel = 0x00000000

func (FeatureLevel) String

func (v FeatureLevel) String() string

type FeatureName

type FeatureName uint32
const FeatureNameBGRA8UnormStorage FeatureName = 0x0000000D
const FeatureNameClipDistances FeatureName = 0x00000010
const FeatureNameCoreFeaturesAndLimits FeatureName = 0x00000001
const FeatureNameDepth32FloatStencil8 FeatureName = 0x00000003
const FeatureNameDepthClipControl FeatureName = 0x00000002
const FeatureNameDualSourceBlending FeatureName = 0x00000011
const FeatureNameFloat32Blendable FeatureName = 0x0000000F
const FeatureNameFloat32Filterable FeatureName = 0x0000000E
const FeatureNameIndirectFirstInstance FeatureName = 0x0000000A
const FeatureNamePrimitiveIndex FeatureName = 0x00000015
const FeatureNameRG11B10UfloatRenderable FeatureName = 0x0000000C
const FeatureNameShaderF16 FeatureName = 0x0000000B
const FeatureNameSubgroups FeatureName = 0x00000012
const FeatureNameTextureComponentSwizzle FeatureName = 0x00000016
const FeatureNameTextureCompressionASTC FeatureName = 0x00000007
const FeatureNameTextureCompressionASTCSliced3D FeatureName = 0x00000008
const FeatureNameTextureCompressionBC FeatureName = 0x00000004
const FeatureNameTextureCompressionBCSliced3D FeatureName = 0x00000005
const FeatureNameTextureCompressionETC2 FeatureName = 0x00000006
const FeatureNameTextureFormatsTier1 FeatureName = 0x00000013
const FeatureNameTextureFormatsTier2 FeatureName = 0x00000014
const FeatureNameTimestampQuery FeatureName = 0x00000009
const NativeFeatureAccelerationStructureBindingArray FeatureName = 0x0003003E
const NativeFeatureAddressModeClampToBorder FeatureName = 0x00030012
const NativeFeatureAddressModeClampToZero FeatureName = 0x00030011
const NativeFeatureBufferBindingArray FeatureName = 0x0003000F
const NativeFeatureClearTexture FeatureName = 0x00030016
const NativeFeatureConservativeRasterization FeatureName = 0x00030015
const NativeFeatureCooperativeMatrix FeatureName = 0x0003003B
const NativeFeatureImmediates FeatureName = 0x00030001
const NativeFeatureMappablePrimaryBuffers FeatureName = 0x0003000E
const NativeFeatureMemoryDecorationCoherent FeatureName = 0x0003003F
const NativeFeatureMemoryDecorationVolatile FeatureName = 0x00030040
const NativeFeatureMultiDrawIndirectCount FeatureName = 0x00030004
const NativeFeatureMultisampleArray FeatureName = 0x0003003A
const NativeFeatureMultiview FeatureName = 0x00030018
const NativeFeaturePartiallyBoundBindingArray FeatureName = 0x0003000A
const NativeFeaturePipelineCache FeatureName = 0x0003002B
const NativeFeaturePipelineStatisticsQuery FeatureName = 0x00030008
const NativeFeaturePolygonModeLine FeatureName = 0x00030013
const NativeFeaturePolygonModePoint FeatureName = 0x00030014
const NativeFeatureRayQuery FeatureName = 0x0003001C
const NativeFeatureSampledTextureAndStorageBufferArrayNonUniformIndexing FeatureName = 0x00030007
const NativeFeatureSelectiveMultiview FeatureName = 0x00030038
const NativeFeatureShaderBarycentrics FeatureName = 0x00030037
const NativeFeatureShaderDrawIndex FeatureName = 0x0003003D
const NativeFeatureShaderEarlyDepthTest FeatureName = 0x00030020
const NativeFeatureShaderF64 FeatureName = 0x0003001D
const NativeFeatureShaderFloat32Atomic FeatureName = 0x00030027
const NativeFeatureShaderI16 FeatureName = 0x0003001E
const NativeFeatureShaderInt64 FeatureName = 0x00030026
const NativeFeatureShaderInt64AtomicAllOps FeatureName = 0x0003002D
const NativeFeatureShaderInt64AtomicMinMax FeatureName = 0x0003002C
const NativeFeatureShaderPerVertex FeatureName = 0x0003003C
const NativeFeatureStorageResourceBindingArray FeatureName = 0x00030009
const NativeFeatureStorageTextureArrayNonUniformIndexing FeatureName = 0x00030010
const NativeFeatureSubgroup FeatureName = 0x00030021
const NativeFeatureSubgroupBarrier FeatureName = 0x00030023
const NativeFeatureSubgroupVertex FeatureName = 0x00030022
const NativeFeatureTextureAdapterSpecificFormatFeatures FeatureName = 0x00030002
const NativeFeatureTextureAtomic FeatureName = 0x00030028
const NativeFeatureTextureBindingArray FeatureName = 0x00030006
const NativeFeatureTextureCompressionAstcHdr FeatureName = 0x0003000C
const NativeFeatureTextureFormat16bitNorm FeatureName = 0x0003000B
const NativeFeatureTextureFormatNv12 FeatureName = 0x0003001A
const NativeFeatureTextureFormatP010 FeatureName = 0x00030029
const NativeFeatureTextureInt64Atomic FeatureName = 0x00030030
const NativeFeatureTimestampQueryInsideEncoders FeatureName = 0x00030024
const NativeFeatureTimestampQueryInsidePasses FeatureName = 0x00030025
const NativeFeatureVertexAttribute64bit FeatureName = 0x00030019
const NativeFeatureVertexWritableStorage FeatureName = 0x00030005

func (FeatureName) String

func (v FeatureName) String() string

type FilterMode

type FilterMode uint32
const FilterModeLinear FilterMode = 0x00000002
const FilterModeNearest FilterMode = 0x00000001
const FilterModeUndefined FilterMode = 0x00000000

func (FilterMode) String

func (v FilterMode) String() string

type FragmentState

type FragmentState struct {
	Module     *ShaderModule
	EntryPoint string
	Targets    []ColorTargetState
}

type FrontFace

type FrontFace uint32
const FrontFaceCCW FrontFace = 0x00000001
const FrontFaceCW FrontFace = 0x00000002
const FrontFaceUndefined FrontFace = 0x00000000

func (FrontFace) String

func (v FrontFace) String() string

type GLFenceBehaviour added in v0.27.1

type GLFenceBehaviour uint32
const GLFenceBehaviourAutoFinish GLFenceBehaviour = 0x00000001
const GLFenceBehaviourNormal GLFenceBehaviour = 0x00000000

func (GLFenceBehaviour) String added in v0.27.1

func (v GLFenceBehaviour) String() string

type Gles3MinorVersion

type Gles3MinorVersion uint32
const Gles3MinorVersionAutomatic Gles3MinorVersion = 0x00000000
const Gles3MinorVersionVersion0 Gles3MinorVersion = 0x00000001
const Gles3MinorVersionVersion1 Gles3MinorVersion = 0x00000002
const Gles3MinorVersionVersion2 Gles3MinorVersion = 0x00000003

func (Gles3MinorVersion) String

func (v Gles3MinorVersion) String() string

type GlobalReport

type GlobalReport struct {
	Surfaces RegistryReport
	Hub      *HubReport
}

type HubReport

type HubReport struct {
	Adapters         RegistryReport
	Devices          RegistryReport
	PipelineLayouts  RegistryReport
	ShaderModules    RegistryReport
	BindGroupLayouts RegistryReport
	BindGroups       RegistryReport
	CommandBuffers   RegistryReport
	RenderBundles    RegistryReport
	RenderPipelines  RegistryReport
	ComputePipelines RegistryReport
	PipelineCaches   RegistryReport
	QuerySets        RegistryReport
	Buffers          RegistryReport
	Textures         RegistryReport
	TextureViews     RegistryReport
	Samplers         RegistryReport
}

type IndexFormat

type IndexFormat uint32
const IndexFormatUint16 IndexFormat = 0x00000001
const IndexFormatUint32 IndexFormat = 0x00000002
const IndexFormatUndefined IndexFormat = 0x00000000

func (IndexFormat) String

func (v IndexFormat) String() string

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func CreateInstance

func CreateInstance(descriptor *InstanceDescriptor) *Instance

func (*Instance) CreateSurface

func (g *Instance) CreateSurface(descriptor *SurfaceDescriptor) *Surface

func (*Instance) EnumerateAdapters

func (g *Instance) EnumerateAdapters(options *InstanceEnumerateAdapterOptons) []*Adapter

func (*Instance) GenerateReport

func (g *Instance) GenerateReport() GlobalReport

func (*Instance) IsValid added in v1.30.2

func (g *Instance) IsValid() bool

func (*Instance) Release

func (g *Instance) Release()

func (*Instance) RequestAdapter

func (g *Instance) RequestAdapter(options *RequestAdapterOptions) (*Adapter, error)

type InstanceBackend

type InstanceBackend uint64
const InstanceBackendAll InstanceBackend = 0x00000000

func (InstanceBackend) String added in v0.27.1

func (v InstanceBackend) String() string

type InstanceDescriptor

type InstanceDescriptor struct {
	Backends           InstanceBackend
	Dx12ShaderCompiler Dx12Compiler
	DxcPath            string
}

type InstanceEnumerateAdapterOptons

type InstanceEnumerateAdapterOptons struct {
	Backends InstanceBackend
}

type InstanceFeatureName added in v1.30.0

type InstanceFeatureName uint32
const InstanceFeatureNameMultipleDevicesPerAdapter InstanceFeatureName = 0x00000003
const InstanceFeatureNameShaderSourceSPIRV InstanceFeatureName = 0x00000002
const InstanceFeatureNameTimedWaitAny InstanceFeatureName = 0x00000001

func (InstanceFeatureName) String added in v1.30.0

func (v InstanceFeatureName) String() string

type InstanceFlag

type InstanceFlag uint64
const InstanceFlagEmpty InstanceFlag = 0x00000000

func (InstanceFlag) String added in v0.27.1

func (v InstanceFlag) String() string

type Limits

type Limits struct {
	MaxTextureDimension1D                     uint32
	MaxTextureDimension2D                     uint32
	MaxTextureDimension3D                     uint32
	MaxTextureArrayLayers                     uint32
	MaxBindGroups                             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

	MaxImmediateSize      uint32
	MaxNonSamplerBindings uint32
}

func DefaultLimits

func DefaultLimits() Limits

type LoadOp

type LoadOp uint32
const LoadOpClear LoadOp = 0x00000002
const LoadOpLoad LoadOp = 0x00000001
const LoadOpUndefined LoadOp = 0x00000000

func (LoadOp) String

func (v LoadOp) String() string

type LogLevel

type LogLevel uint32
const LogLevelDebug LogLevel = 0x00000004
const LogLevelError LogLevel = 0x00000001
const LogLevelInfo LogLevel = 0x00000003
const LogLevelOff LogLevel = 0x00000000
const LogLevelTrace LogLevel = 0x00000005
const LogLevelWarn LogLevel = 0x00000002

func (LogLevel) String

func (v LogLevel) String() string

type MapAsyncStatus

type MapAsyncStatus uint32
const MapAsyncStatusAborted MapAsyncStatus = 0x00000004
const MapAsyncStatusCallbackCancelled MapAsyncStatus = 0x00000002
const MapAsyncStatusError MapAsyncStatus = 0x00000003
const MapAsyncStatusSuccess MapAsyncStatus = 0x00000001

func (MapAsyncStatus) String

func (v MapAsyncStatus) String() string

type MapMode

type MapMode uint64
const MapModeNone MapMode = 0x00000000
const MapModeRead MapMode = 0x00000001
const MapModeWrite MapMode = 0x00000002

func (MapMode) String added in v0.27.1

func (v MapMode) String() string

type MipmapFilterMode

type MipmapFilterMode uint32
const MipmapFilterModeLinear MipmapFilterMode = 0x00000002
const MipmapFilterModeNearest MipmapFilterMode = 0x00000001
const MipmapFilterModeUndefined MipmapFilterMode = 0x00000000

func (MipmapFilterMode) String

func (v MipmapFilterMode) String() string

type MultisampleState

type MultisampleState struct {
	Count                  uint32
	Mask                   uint32
	AlphaToCoverageEnabled bool
}

type NativeAddressMode added in v1.34.0

type NativeAddressMode uint32
const NativeAddressModeClampToBorder NativeAddressMode = 0x00000004

func (NativeAddressMode) String added in v1.34.0

func (v NativeAddressMode) String() string

type NativeDisplayHandleType added in v1.30.0

type NativeDisplayHandleType uint32
const NativeDisplayHandleTypeNone NativeDisplayHandleType = 0x00000000
const NativeDisplayHandleTypeWayland NativeDisplayHandleType = 0x00000003
const NativeDisplayHandleTypeXcb NativeDisplayHandleType = 0x00000002
const NativeDisplayHandleTypeXlib NativeDisplayHandleType = 0x00000001

func (NativeDisplayHandleType) String added in v1.30.0

func (v NativeDisplayHandleType) String() string

type NativeQueryType

type NativeQueryType uint32
const NativeQueryTypePipelineStatistics NativeQueryType = 0x00030000

func (NativeQueryType) String

func (v NativeQueryType) String() string

type NativeTextureFormat

type NativeTextureFormat uint32
const NativeTextureFormatNV12 NativeTextureFormat = 0x00030007
const NativeTextureFormatP010 NativeTextureFormat = 0x00030008

func (NativeTextureFormat) String

func (v NativeTextureFormat) String() string

type OptionalBool

type OptionalBool uint32
const OptionalBoolFalse OptionalBool = 0x00000000
const OptionalBoolTrue OptionalBool = 0x00000001
const OptionalBoolUndefined OptionalBool = 0x00000002

func (OptionalBool) String

func (v OptionalBool) String() string

type Origin3D

type Origin3D struct {
	X, Y, Z uint32
}

type PipelineLayout

type PipelineLayout struct {
	// contains filtered or unexported fields
}

func (*PipelineLayout) IsValid added in v1.30.2

func (g *PipelineLayout) IsValid() bool

func (*PipelineLayout) Release

func (g *PipelineLayout) Release()

type PipelineLayoutDescriptor

type PipelineLayoutDescriptor struct {
	Label            string
	BindGroupLayouts []*BindGroupLayout

	// enable support for immediates
	EnableImmediates bool
}

type PipelineStatisticName

type PipelineStatisticName uint32
const PipelineStatisticNameClipperInvocations PipelineStatisticName = 0x00000001
const PipelineStatisticNameClipperPrimitivesOut PipelineStatisticName = 0x00000002
const PipelineStatisticNameComputeShaderInvocations PipelineStatisticName = 0x00000004
const PipelineStatisticNameFragmentShaderInvocations PipelineStatisticName = 0x00000003
const PipelineStatisticNameVertexShaderInvocations PipelineStatisticName = 0x00000000

func (PipelineStatisticName) String

func (v PipelineStatisticName) String() string

type PopErrorScopeStatus

type PopErrorScopeStatus uint32
const PopErrorScopeStatusCallbackCancelled PopErrorScopeStatus = 0x00000002
const PopErrorScopeStatusError PopErrorScopeStatus = 0x00000003
const PopErrorScopeStatusSuccess PopErrorScopeStatus = 0x00000001

func (PopErrorScopeStatus) String

func (v PopErrorScopeStatus) String() string

type PowerPreference

type PowerPreference uint32
const PowerPreferenceHighPerformance PowerPreference = 0x00000002
const PowerPreferenceLowPower PowerPreference = 0x00000001
const PowerPreferenceUndefined PowerPreference = 0x00000000

func (PowerPreference) String

func (v PowerPreference) String() string

type PredefinedColorSpace added in v1.30.0

type PredefinedColorSpace uint32
const PredefinedColorSpaceDisplayP3 PredefinedColorSpace = 0x00000002
const PredefinedColorSpaceSRGB PredefinedColorSpace = 0x00000001

func (PredefinedColorSpace) String added in v1.30.0

func (v PredefinedColorSpace) String() string

type PresentMode

type PresentMode uint32
const PresentModeFifo PresentMode = 0x00000001
const PresentModeFifoRelaxed PresentMode = 0x00000002
const PresentModeImmediate PresentMode = 0x00000003
const PresentModeMailbox PresentMode = 0x00000004
const PresentModeUndefined PresentMode = 0x00000000

func (PresentMode) String

func (v PresentMode) String() string

type PrimitiveState

type PrimitiveState struct {
	Topology         PrimitiveTopology
	StripIndexFormat IndexFormat
	FrontFace        FrontFace
	CullMode         CullMode
}

type PrimitiveTopology

type PrimitiveTopology uint32
const PrimitiveTopologyLineList PrimitiveTopology = 0x00000002
const PrimitiveTopologyLineStrip PrimitiveTopology = 0x00000003
const PrimitiveTopologyPointList PrimitiveTopology = 0x00000001
const PrimitiveTopologyTriangleList PrimitiveTopology = 0x00000004
const PrimitiveTopologyTriangleStrip PrimitiveTopology = 0x00000005
const PrimitiveTopologyUndefined PrimitiveTopology = 0x00000000

func (PrimitiveTopology) String

func (v PrimitiveTopology) String() string

type ProgrammableStageDescriptor

type ProgrammableStageDescriptor struct {
	Module     *ShaderModule
	EntryPoint string
}

ProgrammableStageDescriptor as described: https://gpuweb.github.io/gpuweb/#gpuprogrammablestage

type QuerySet

type QuerySet struct {
	// contains filtered or unexported fields
}

func (*QuerySet) IsValid added in v1.30.2

func (g *QuerySet) IsValid() bool

func (*QuerySet) Release

func (g *QuerySet) Release()

type QuerySetDescriptor

type QuerySetDescriptor struct {
	Label              string
	Type               QueryType
	Count              uint32
	PipelineStatistics []PipelineStatisticName
}

type QueryType

type QueryType uint32
const QueryTypeOcclusion QueryType = 0x00000001
const QueryTypeTimestamp QueryType = 0x00000002

func (QueryType) String

func (v QueryType) String() string

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

func (*Queue) IsValid added in v1.30.2

func (g *Queue) IsValid() bool

func (*Queue) OnSubmittedWorkDone

func (p *Queue) OnSubmittedWorkDone(callback QueueWorkDoneCallback)

func (*Queue) Release

func (g *Queue) Release()

func (*Queue) Submit

func (p *Queue) Submit(commands ...*CommandBuffer) (submissionIndex SubmissionIndex)

func (*Queue) TryWriteBuffer added in v0.27.1

func (p *Queue) TryWriteBuffer(buffer *Buffer, bufferOffset uint64, data []byte) error

func (*Queue) TryWriteTexture added in v0.27.1

func (p *Queue) TryWriteTexture(destination *TexelCopyTextureInfo, data []byte, dataLayout *TexelCopyBufferLayout, writeSize *Extent3D) error

func (*Queue) WriteBuffer

func (p *Queue) WriteBuffer(buffer *Buffer, bufferOffset uint64, data []byte)

func (*Queue) WriteTexture

func (p *Queue) WriteTexture(destination *TexelCopyTextureInfo, data []byte, dataLayout *TexelCopyBufferLayout, writeSize *Extent3D)

type QueueWorkDoneCallback

type QueueWorkDoneCallback func(QueueWorkDoneStatus)

type QueueWorkDoneStatus

type QueueWorkDoneStatus uint32
const QueueWorkDoneStatusCallbackCancelled QueueWorkDoneStatus = 0x00000002
const QueueWorkDoneStatusError QueueWorkDoneStatus = 0x00000003
const QueueWorkDoneStatusSuccess QueueWorkDoneStatus = 0x00000001

func (QueueWorkDoneStatus) String

func (v QueueWorkDoneStatus) String() string

type RegistryReport

type RegistryReport struct {
	NumAllocated        uint64
	NumKeptFromUser     uint64
	NumReleasedFromUser uint64
	ElementSize         uint64
}

type RenderBundle

type RenderBundle struct {
	// contains filtered or unexported fields
}

func (*RenderBundle) IsValid added in v1.30.2

func (g *RenderBundle) IsValid() bool

func (*RenderBundle) Release

func (g *RenderBundle) Release()

type RenderBundleDescriptor

type RenderBundleDescriptor struct {
	Label string
}

type RenderBundleEncoder

type RenderBundleEncoder struct {
	// contains filtered or unexported fields
}

func (*RenderBundleEncoder) Draw

func (g *RenderBundleEncoder) Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)

func (*RenderBundleEncoder) DrawIndexed

func (g *RenderBundleEncoder) DrawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance uint32)

func (*RenderBundleEncoder) DrawIndexedIndirect

func (g *RenderBundleEncoder) DrawIndexedIndirect(indirectBuffer *Buffer, indirectOffset uint64)

func (*RenderBundleEncoder) DrawIndirect

func (g *RenderBundleEncoder) DrawIndirect(indirectBuffer *Buffer, indirectOffset uint64)

func (*RenderBundleEncoder) Finish

func (*RenderBundleEncoder) InsertDebugMarker

func (g *RenderBundleEncoder) InsertDebugMarker(markerLabel string)

func (*RenderBundleEncoder) IsValid added in v1.30.2

func (g *RenderBundleEncoder) IsValid() bool

func (*RenderBundleEncoder) PopDebugGroup

func (g *RenderBundleEncoder) PopDebugGroup()

func (*RenderBundleEncoder) PushDebugGroup

func (g *RenderBundleEncoder) PushDebugGroup(groupLabel string)

func (*RenderBundleEncoder) Release

func (g *RenderBundleEncoder) Release()

func (*RenderBundleEncoder) SetBindGroup

func (g *RenderBundleEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)

func (*RenderBundleEncoder) SetIndexBuffer

func (g *RenderBundleEncoder) SetIndexBuffer(buffer *Buffer, format IndexFormat, offset uint64, size uint64)

func (*RenderBundleEncoder) SetPipeline

func (g *RenderBundleEncoder) SetPipeline(pipeline *RenderPipeline)

func (*RenderBundleEncoder) SetVertexBuffer

func (g *RenderBundleEncoder) SetVertexBuffer(slot uint32, buffer *Buffer, offset uint64, size uint64)

type RenderBundleEncoderDescriptor

type RenderBundleEncoderDescriptor struct {
	Label              string
	ColorFormats       []TextureFormat
	DepthStencilFormat TextureFormat
	SampleCount        uint32
	DepthReadOnly      bool
	StencilReadOnly    bool
}

type RenderPassColorAttachment

type RenderPassColorAttachment struct {
	View          *TextureView
	ResolveTarget *TextureView
	LoadOp        LoadOp
	StoreOp       StoreOp
	ClearValue    Color
}

RenderPassColorAttachment as described: https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpasscolorattachment

type RenderPassDepthStencilAttachment

type RenderPassDepthStencilAttachment struct {
	View              *TextureView
	DepthLoadOp       LoadOp
	DepthStoreOp      StoreOp
	DepthClearValue   float32
	DepthReadOnly     bool
	StencilLoadOp     LoadOp
	StencilStoreOp    StoreOp
	StencilClearValue uint32
	StencilReadOnly   bool
}

type RenderPassDescriptor

type RenderPassDescriptor struct {
	Label                  string
	ColorAttachments       []RenderPassColorAttachment
	DepthStencilAttachment *RenderPassDepthStencilAttachment
}

RenderPassDescriptor as described: https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpassdescriptor

type RenderPassEncoder

type RenderPassEncoder struct {
	// contains filtered or unexported fields
}

func (*RenderPassEncoder) BeginOcclusionQuery

func (p *RenderPassEncoder) BeginOcclusionQuery(queryIndex uint32)

func (*RenderPassEncoder) BeginPipelineStatisticsQuery

func (p *RenderPassEncoder) BeginPipelineStatisticsQuery(querySet *QuerySet, queryIndex uint32)

func (*RenderPassEncoder) Draw

func (p *RenderPassEncoder) Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)

func (*RenderPassEncoder) DrawIndexed

func (p *RenderPassEncoder) DrawIndexed(indexCount uint32, instanceCount uint32, firstIndex uint32, baseVertex int32, firstInstance uint32)

func (*RenderPassEncoder) DrawIndexedIndirect

func (p *RenderPassEncoder) DrawIndexedIndirect(indirectBuffer *Buffer, indirectOffset uint64)

func (*RenderPassEncoder) DrawIndirect

func (p *RenderPassEncoder) DrawIndirect(indirectBuffer *Buffer, indirectOffset uint64)

func (*RenderPassEncoder) End

func (p *RenderPassEncoder) End()

TryEnd ends the current render pass encoder. This will also release the instance, so it must not be used afterwards

func (*RenderPassEncoder) EndOcclusionQuery

func (p *RenderPassEncoder) EndOcclusionQuery()

func (*RenderPassEncoder) EndPipelineStatisticsQuery

func (p *RenderPassEncoder) EndPipelineStatisticsQuery()

func (*RenderPassEncoder) ExecuteBundles

func (p *RenderPassEncoder) ExecuteBundles(bundles ...*RenderBundle)

func (*RenderPassEncoder) InsertDebugMarker

func (p *RenderPassEncoder) InsertDebugMarker(markerLabel string)

func (*RenderPassEncoder) IsValid added in v1.30.2

func (g *RenderPassEncoder) IsValid() bool

func (*RenderPassEncoder) MultiDrawIndexedIndirect

func (p *RenderPassEncoder) MultiDrawIndexedIndirect(encoder *RenderPassEncoder, buffer Buffer, offset uint64, count uint32)

func (*RenderPassEncoder) MultiDrawIndexedIndirectCount

func (p *RenderPassEncoder) MultiDrawIndexedIndirectCount(encoder *RenderPassEncoder, buffer Buffer, offset uint64, countBuffer Buffer, countBufferOffset uint64, maxCount uint32)

func (*RenderPassEncoder) MultiDrawIndirect

func (p *RenderPassEncoder) MultiDrawIndirect(encoder *RenderPassEncoder, buffer Buffer, offset uint64, count uint32)

func (*RenderPassEncoder) MultiDrawIndirectCount

func (p *RenderPassEncoder) MultiDrawIndirectCount(encoder *RenderPassEncoder, buffer Buffer, offset uint64, countBuffer Buffer, countBufferOffset uint64, maxCount uint32)

func (*RenderPassEncoder) PopDebugGroup

func (p *RenderPassEncoder) PopDebugGroup()

func (*RenderPassEncoder) PushDebugGroup

func (p *RenderPassEncoder) PushDebugGroup(groupLabel string)

func (*RenderPassEncoder) Release

func (g *RenderPassEncoder) Release()

func (*RenderPassEncoder) SetBindGroup

func (p *RenderPassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)

func (*RenderPassEncoder) SetBlendConstant

func (p *RenderPassEncoder) SetBlendConstant(color *Color)

func (*RenderPassEncoder) SetImmediates added in v1.30.0

func (p *RenderPassEncoder) SetImmediates(offset uint32, data []byte)

func (*RenderPassEncoder) SetIndexBuffer

func (p *RenderPassEncoder) SetIndexBuffer(buffer *Buffer, format IndexFormat, offset uint64, size uint64)

func (*RenderPassEncoder) SetPipeline

func (p *RenderPassEncoder) SetPipeline(pipeline *RenderPipeline)

func (*RenderPassEncoder) SetScissorRect

func (p *RenderPassEncoder) SetScissorRect(x, y, width, height uint32)

func (*RenderPassEncoder) SetStencilReference

func (p *RenderPassEncoder) SetStencilReference(reference uint32)

func (*RenderPassEncoder) SetVertexBuffer

func (p *RenderPassEncoder) SetVertexBuffer(slot uint32, buffer *Buffer, offset uint64, size uint64)

func (*RenderPassEncoder) SetViewport

func (p *RenderPassEncoder) SetViewport(x, y, width, height, minDepth, maxDepth float32)

func (*RenderPassEncoder) TryEnd added in v0.27.1

func (p *RenderPassEncoder) TryEnd() error

TryEnd ends the current render pass encoder. This will also release the instance, so it must not be used afterwards

type RenderPipeline

type RenderPipeline struct {
	// contains filtered or unexported fields
}

func (*RenderPipeline) GetBindGroupLayout

func (g *RenderPipeline) GetBindGroupLayout(groupIndex uint32) *BindGroupLayout

func (*RenderPipeline) IsValid added in v1.30.2

func (g *RenderPipeline) IsValid() bool

func (*RenderPipeline) Release

func (g *RenderPipeline) Release()

type RenderPipelineDescriptor

type RenderPipelineDescriptor struct {
	Label        string
	Layout       *PipelineLayout
	Vertex       VertexState
	Primitive    PrimitiveState
	DepthStencil *DepthStencilState
	Multisample  MultisampleState
	Fragment     *FragmentState
}

RenderPipelineDescriptor as described: https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpipelinedescriptor

type RequestAdapterOptions

type RequestAdapterOptions struct {
	CompatibleSurface    *Surface
	PowerPreference      PowerPreference
	ForceFallbackAdapter bool
	BackendType          BackendType
}

RequestAdapterOptions as described: https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions

type RequestAdapterStatus

type RequestAdapterStatus uint32
const RequestAdapterStatusCallbackCancelled RequestAdapterStatus = 0x00000002
const RequestAdapterStatusError RequestAdapterStatus = 0x00000004
const RequestAdapterStatusSuccess RequestAdapterStatus = 0x00000001
const RequestAdapterStatusUnavailable RequestAdapterStatus = 0x00000003

func (RequestAdapterStatus) String

func (v RequestAdapterStatus) String() string

type RequestDeviceStatus

type RequestDeviceStatus uint32
const RequestDeviceStatusCallbackCancelled RequestDeviceStatus = 0x00000002
const RequestDeviceStatusError RequestDeviceStatus = 0x00000003
const RequestDeviceStatusSuccess RequestDeviceStatus = 0x00000001

func (RequestDeviceStatus) String

func (v RequestDeviceStatus) String() string

type Sampler

type Sampler struct {
	// contains filtered or unexported fields
}

func (*Sampler) IsValid added in v1.30.2

func (g *Sampler) IsValid() bool

func (*Sampler) Release

func (g *Sampler) Release()

type SamplerBindingLayout

type SamplerBindingLayout struct {
	Type SamplerBindingType
}

type SamplerBindingType

type SamplerBindingType uint32
const SamplerBindingTypeBindingNotUsed SamplerBindingType = 0x00000000
const SamplerBindingTypeComparison SamplerBindingType = 0x00000004
const SamplerBindingTypeFiltering SamplerBindingType = 0x00000002
const SamplerBindingTypeNonFiltering SamplerBindingType = 0x00000003
const SamplerBindingTypeUndefined SamplerBindingType = 0x00000001

func (SamplerBindingType) String

func (v SamplerBindingType) String() string

type SamplerBorderColor added in v1.34.0

type SamplerBorderColor uint32
const SamplerBorderColorOpaqueBlack SamplerBorderColor = 0x00000002
const SamplerBorderColorOpaqueWhite SamplerBorderColor = 0x00000003
const SamplerBorderColorTransparentBlack SamplerBorderColor = 0x00000001
const SamplerBorderColorUndefined SamplerBorderColor = 0x00000000
const SamplerBorderColorZero SamplerBorderColor = 0x00000004

func (SamplerBorderColor) String added in v1.34.0

func (v SamplerBorderColor) 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 struct {
	// contains filtered or unexported fields
}

func (*ShaderModule) IsValid added in v1.30.2

func (g *ShaderModule) IsValid() bool

func (*ShaderModule) Release

func (g *ShaderModule) Release()

type ShaderModuleDescriptor

type ShaderModuleDescriptor struct {
	Label       string
	SPIRVSource *ShaderSourceSPIRV
	WGSLSource  *ShaderSourceWGSL
	GLSLSource  *ShaderSourceGLSL
}

type ShaderRuntimeChecks added in v1.34.0

type ShaderRuntimeChecks uint64
const ShaderRuntimeChecksBoundsChecks ShaderRuntimeChecks = 0x00000001
const ShaderRuntimeChecksForceLoopBounding ShaderRuntimeChecks = 0x00000002
const ShaderRuntimeChecksMeshShaderPrimitiveIndicesClamp ShaderRuntimeChecks = 0x00000010
const ShaderRuntimeChecksNone ShaderRuntimeChecks = 0x00000000
const ShaderRuntimeChecksRayQueryInitializationTracking ShaderRuntimeChecks = 0x00000004
const ShaderRuntimeChecksTaskShaderDispatchTracking ShaderRuntimeChecks = 0x00000008

func (ShaderRuntimeChecks) String added in v1.34.0

func (v ShaderRuntimeChecks) String() string

type ShaderSourceGLSL

type ShaderSourceGLSL struct {
	Code        string
	Defines     map[string]string
	ShaderStage ShaderStage
}

type ShaderSourceSPIRV

type ShaderSourceSPIRV struct {
	Code []byte
}

type ShaderSourceWGSL

type ShaderSourceWGSL struct {
	Code string
}

type ShaderStage

type ShaderStage uint64
const ShaderStageCompute ShaderStage = 0x00000004
const ShaderStageFragment ShaderStage = 0x00000002
const ShaderStageNone ShaderStage = 0x00000000
const ShaderStageVertex ShaderStage = 0x00000001

func (ShaderStage) String added in v0.27.1

func (v ShaderStage) String() string

type Shareable added in v1.33.3

type Shareable interface {
	// contains filtered or unexported methods
}

type Status

type Status uint32
const StatusError Status = 0x00000002
const StatusSuccess Status = 0x00000001

func (Status) String

func (v Status) String() string

type StencilFaceState

type StencilFaceState struct {
	Compare     CompareFunction
	FailOp      StencilOperation
	DepthFailOp StencilOperation
	PassOp      StencilOperation
}

type StencilOperation

type StencilOperation uint32
const StencilOperationDecrementClamp StencilOperation = 0x00000006
const StencilOperationDecrementWrap StencilOperation = 0x00000008
const StencilOperationIncrementClamp StencilOperation = 0x00000005
const StencilOperationIncrementWrap StencilOperation = 0x00000007
const StencilOperationInvert StencilOperation = 0x00000004
const StencilOperationKeep StencilOperation = 0x00000001
const StencilOperationReplace StencilOperation = 0x00000003
const StencilOperationUndefined StencilOperation = 0x00000000
const StencilOperationZero StencilOperation = 0x00000002

func (StencilOperation) String

func (v StencilOperation) String() string

type StorageTextureAccess

type StorageTextureAccess uint32
const StorageTextureAccessBindingNotUsed StorageTextureAccess = 0x00000000
const StorageTextureAccessReadOnly StorageTextureAccess = 0x00000003
const StorageTextureAccessReadWrite StorageTextureAccess = 0x00000004
const StorageTextureAccessUndefined StorageTextureAccess = 0x00000001
const StorageTextureAccessWriteOnly StorageTextureAccess = 0x00000002

func (StorageTextureAccess) String

func (v StorageTextureAccess) String() string

type StorageTextureBindingLayout

type StorageTextureBindingLayout struct {
	Access        StorageTextureAccess
	Format        TextureFormat
	ViewDimension TextureViewDimension
}

type StoreOp

type StoreOp uint32
const StoreOpDiscard StoreOp = 0x00000002
const StoreOpStore StoreOp = 0x00000001
const StoreOpUndefined StoreOp = 0x00000000

func (StoreOp) String

func (v StoreOp) String() string

type SubmissionIndex

type SubmissionIndex uint64

type Surface

type Surface struct {
	// contains filtered or unexported fields
}

func (*Surface) Configure

func (g *Surface) Configure(device *Device, config *SurfaceConfiguration)

func (*Surface) GetCapabilities

func (g *Surface) GetCapabilities(adapter *Adapter) (ret SurfaceCapabilities)

func (*Surface) GetCurrentTexture

func (g *Surface) GetCurrentTexture() SurfaceTexture

NOTE: you should typically not call Texture.Release on the returned texture. Instead, you should call TextureView.Release on any TextureView you create from it. You need to check the status of the returned texture, or use SurfaceTexture.Get.

func (*Surface) IsValid added in v1.30.2

func (g *Surface) IsValid() bool

func (*Surface) Present

func (g *Surface) Present()

func (*Surface) Release

func (g *Surface) Release()

func (*Surface) TryGetCurrentTexture added in v0.27.1

func (g *Surface) TryGetCurrentTexture() (SurfaceTexture, error)

NOTE: you should typically not call Texture.Release on the returned texture. Instead, you should call TextureView.Release on any TextureView you create from it. You need to check the status of the returned texture, or use SurfaceTexture.Get.

type SurfaceCapabilities

type SurfaceCapabilities struct {
	Formats      []TextureFormat
	PresentModes []PresentMode
	AlphaModes   []CompositeAlphaMode
}

type SurfaceConfiguration

type SurfaceConfiguration struct {
	Usage                      TextureUsage
	Format                     TextureFormat
	Width                      uint32
	Height                     uint32
	PresentMode                PresentMode
	AlphaMode                  CompositeAlphaMode
	ViewFormats                []TextureFormat
	DesiredMaximumFrameLatency uint32
}

SurfaceConfiguration corresponding to GPUCanvasConfiguration: https://gpuweb.github.io/gpuweb/#dictdef-gpucanvasconfiguration

type SurfaceDescriptor

type SurfaceDescriptor struct {
	Label string

	WindowsHWND         *SurfaceSourceWindowsHWND
	XcbWindow           *SurfaceSourceXcbWindow
	XlibWindow          *SurfaceSourceXlibWindow
	MetalLayer          *SurfaceSourceMetalLayer
	WaylandSurface      *SurfaceSourceWaylandSurface
	AndroidNativeWindow *SurfaceSourceAndroidNativeWindow
}

type SurfaceGetCurrentTextureStatus

type SurfaceGetCurrentTextureStatus uint32
const SurfaceGetCurrentTextureStatusError SurfaceGetCurrentTextureStatus = 0x00000006
const SurfaceGetCurrentTextureStatusLost SurfaceGetCurrentTextureStatus = 0x00000005
const SurfaceGetCurrentTextureStatusOccluded SurfaceGetCurrentTextureStatus = 0x00030001
const SurfaceGetCurrentTextureStatusOutdated SurfaceGetCurrentTextureStatus = 0x00000004
const SurfaceGetCurrentTextureStatusSuccessOptimal SurfaceGetCurrentTextureStatus = 0x00000001
const SurfaceGetCurrentTextureStatusSuccessSuboptimal SurfaceGetCurrentTextureStatus = 0x00000002
const SurfaceGetCurrentTextureStatusTimeout SurfaceGetCurrentTextureStatus = 0x00000003

func (SurfaceGetCurrentTextureStatus) String

type SurfaceSourceAndroidNativeWindow

type SurfaceSourceAndroidNativeWindow struct {
	Window unsafe.Pointer
}

type SurfaceSourceMetalLayer

type SurfaceSourceMetalLayer struct {
	Layer unsafe.Pointer
}

type SurfaceSourceWaylandSurface

type SurfaceSourceWaylandSurface struct {
	Display unsafe.Pointer
	Surface unsafe.Pointer
}

type SurfaceSourceWindowsHWND

type SurfaceSourceWindowsHWND struct {
	Hinstance unsafe.Pointer
	Hwnd      unsafe.Pointer
}

type SurfaceSourceXcbWindow

type SurfaceSourceXcbWindow struct {
	Connection unsafe.Pointer
	Window     uint32
}

type SurfaceSourceXlibWindow

type SurfaceSourceXlibWindow struct {
	Display unsafe.Pointer
	Window  uint32
}

type SurfaceTexture added in v1.33.0

type SurfaceTexture struct {
	// Texture might not be set depending on Status
	Texture *Texture

	// Status of the texture returned
	Status SurfaceGetCurrentTextureStatus
}

func (*SurfaceTexture) Get added in v1.33.0

func (s *SurfaceTexture) Get() (nextTexture *Texture, success bool)

func (*SurfaceTexture) IsStatusSuccess added in v1.33.0

func (s *SurfaceTexture) IsStatusSuccess() bool

type TexelCopyBufferInfo

type TexelCopyBufferInfo struct {
	Layout TexelCopyBufferLayout
	Buffer *Buffer
}

type TexelCopyBufferLayout

type TexelCopyBufferLayout struct {
	Offset       uint64
	BytesPerRow  uint32
	RowsPerImage uint32
}

type TexelCopyTextureInfo

type TexelCopyTextureInfo struct {
	Texture  *Texture
	MipLevel uint32
	Origin   Origin3D
	Aspect   TextureAspect
}

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

func (*Texture) AsImageCopy

func (g *Texture) AsImageCopy() *TexelCopyTextureInfo

func (*Texture) CreateView

func (g *Texture) CreateView(descriptor *TextureViewDescriptor) *TextureView

func (*Texture) Destroy

func (g *Texture) Destroy()

func (*Texture) GetDepthOrArrayLayers

func (g *Texture) GetDepthOrArrayLayers() uint32

func (*Texture) GetDimension

func (g *Texture) GetDimension() TextureDimension

func (*Texture) GetFormat

func (g *Texture) GetFormat() TextureFormat

func (*Texture) GetHeight

func (g *Texture) GetHeight() uint32

func (*Texture) GetMipLevelCount

func (g *Texture) GetMipLevelCount() uint32

func (*Texture) GetSampleCount

func (g *Texture) GetSampleCount() uint32

func (*Texture) GetUsage

func (g *Texture) GetUsage() TextureUsage

func (*Texture) GetWidth

func (g *Texture) GetWidth() uint32

func (*Texture) IsValid added in v1.30.2

func (g *Texture) IsValid() bool

func (*Texture) Release

func (g *Texture) Release()

func (*Texture) TryCreateView added in v0.27.1

func (g *Texture) TryCreateView(descriptor *TextureViewDescriptor) (*TextureView, error)

type TextureAspect

type TextureAspect uint32
const TextureAspectAll TextureAspect = 0x00000001
const TextureAspectDepthOnly TextureAspect = 0x00000003
const TextureAspectStencilOnly TextureAspect = 0x00000002
const TextureAspectUndefined TextureAspect = 0x00000000

func (TextureAspect) String

func (v TextureAspect) String() string

type TextureBindingLayout

type TextureBindingLayout struct {
	SampleType    TextureSampleType
	ViewDimension TextureViewDimension
	Multisampled  bool
}

type TextureDescriptor

type TextureDescriptor struct {
	Label         string
	Usage         TextureUsage
	Dimension     TextureDimension
	Size          Extent3D
	Format        TextureFormat
	MipLevelCount uint32
	SampleCount   uint32
}

TextureDescriptor as described: https://gpuweb.github.io/gpuweb/#gputexturedescriptor

type TextureDimension

type TextureDimension uint32
const TextureDimension1D TextureDimension = 0x00000001
const TextureDimension2D TextureDimension = 0x00000002
const TextureDimension3D TextureDimension = 0x00000003
const TextureDimensionUndefined TextureDimension = 0x00000000

func (TextureDimension) String

func (v TextureDimension) String() string

type TextureFormat

type TextureFormat uint32
const TextureFormatASTC10x10Unorm TextureFormat = 0x00000060
const TextureFormatASTC10x10UnormSrgb TextureFormat = 0x00000061
const TextureFormatASTC10x5Unorm TextureFormat = 0x0000005A
const TextureFormatASTC10x5UnormSrgb TextureFormat = 0x0000005B
const TextureFormatASTC10x6Unorm TextureFormat = 0x0000005C
const TextureFormatASTC10x6UnormSrgb TextureFormat = 0x0000005D
const TextureFormatASTC10x8Unorm TextureFormat = 0x0000005E
const TextureFormatASTC10x8UnormSrgb TextureFormat = 0x0000005F
const TextureFormatASTC12x10Unorm TextureFormat = 0x00000062
const TextureFormatASTC12x10UnormSrgb TextureFormat = 0x00000063
const TextureFormatASTC12x12Unorm TextureFormat = 0x00000064
const TextureFormatASTC12x12UnormSrgb TextureFormat = 0x00000065
const TextureFormatASTC4x4Unorm TextureFormat = 0x0000004A
const TextureFormatASTC4x4UnormSrgb TextureFormat = 0x0000004B
const TextureFormatASTC5x4Unorm TextureFormat = 0x0000004C
const TextureFormatASTC5x4UnormSrgb TextureFormat = 0x0000004D
const TextureFormatASTC5x5Unorm TextureFormat = 0x0000004E
const TextureFormatASTC5x5UnormSrgb TextureFormat = 0x0000004F
const TextureFormatASTC6x5Unorm TextureFormat = 0x00000050
const TextureFormatASTC6x5UnormSrgb TextureFormat = 0x00000051
const TextureFormatASTC6x6Unorm TextureFormat = 0x00000052
const TextureFormatASTC6x6UnormSrgb TextureFormat = 0x00000053
const TextureFormatASTC8x5Unorm TextureFormat = 0x00000054
const TextureFormatASTC8x5UnormSrgb TextureFormat = 0x00000055
const TextureFormatASTC8x6Unorm TextureFormat = 0x00000056
const TextureFormatASTC8x6UnormSrgb TextureFormat = 0x00000057
const TextureFormatASTC8x8Unorm TextureFormat = 0x00000058
const TextureFormatASTC8x8UnormSrgb TextureFormat = 0x00000059
const TextureFormatBC1RGBAUnorm TextureFormat = 0x00000032
const TextureFormatBC1RGBAUnormSrgb TextureFormat = 0x00000033
const TextureFormatBC2RGBAUnorm TextureFormat = 0x00000034
const TextureFormatBC2RGBAUnormSrgb TextureFormat = 0x00000035
const TextureFormatBC3RGBAUnorm TextureFormat = 0x00000036
const TextureFormatBC3RGBAUnormSrgb TextureFormat = 0x00000037
const TextureFormatBC4RSnorm TextureFormat = 0x00000039
const TextureFormatBC4RUnorm TextureFormat = 0x00000038
const TextureFormatBC5RGSnorm TextureFormat = 0x0000003B
const TextureFormatBC5RGUnorm TextureFormat = 0x0000003A
const TextureFormatBC6HRGBFloat TextureFormat = 0x0000003D
const TextureFormatBC6HRGBUfloat TextureFormat = 0x0000003C
const TextureFormatBC7RGBAUnorm TextureFormat = 0x0000003E
const TextureFormatBC7RGBAUnormSrgb TextureFormat = 0x0000003F
const TextureFormatBGRA8Unorm TextureFormat = 0x0000001B
const TextureFormatBGRA8UnormSrgb TextureFormat = 0x0000001C
const TextureFormatDepth16Unorm TextureFormat = 0x0000002D
const TextureFormatDepth24Plus TextureFormat = 0x0000002E
const TextureFormatDepth24PlusStencil8 TextureFormat = 0x0000002F
const TextureFormatDepth32Float TextureFormat = 0x00000030
const TextureFormatDepth32FloatStencil8 TextureFormat = 0x00000031
const TextureFormatEACR11Snorm TextureFormat = 0x00000047
const TextureFormatEACR11Unorm TextureFormat = 0x00000046
const TextureFormatEACRG11Snorm TextureFormat = 0x00000049
const TextureFormatEACRG11Unorm TextureFormat = 0x00000048
const TextureFormatETC2RGB8A1Unorm TextureFormat = 0x00000042
const TextureFormatETC2RGB8A1UnormSrgb TextureFormat = 0x00000043
const TextureFormatETC2RGB8Unorm TextureFormat = 0x00000040
const TextureFormatETC2RGB8UnormSrgb TextureFormat = 0x00000041
const TextureFormatETC2RGBA8Unorm TextureFormat = 0x00000044
const TextureFormatETC2RGBA8UnormSrgb TextureFormat = 0x00000045
const TextureFormatR16Float TextureFormat = 0x00000009
const TextureFormatR16Sint TextureFormat = 0x00000008
const TextureFormatR16Snorm TextureFormat = 0x00000006
const TextureFormatR16Uint TextureFormat = 0x00000007
const TextureFormatR16Unorm TextureFormat = 0x00000005
const TextureFormatR32Float TextureFormat = 0x0000000E
const TextureFormatR32Sint TextureFormat = 0x00000010
const TextureFormatR32Uint TextureFormat = 0x0000000F
const TextureFormatR8Sint TextureFormat = 0x00000004
const TextureFormatR8Snorm TextureFormat = 0x00000002
const TextureFormatR8Uint TextureFormat = 0x00000003
const TextureFormatR8Unorm TextureFormat = 0x00000001
const TextureFormatRG11B10Ufloat TextureFormat = 0x0000001F
const TextureFormatRG16Float TextureFormat = 0x00000015
const TextureFormatRG16Sint TextureFormat = 0x00000014
const TextureFormatRG16Snorm TextureFormat = 0x00000012
const TextureFormatRG16Uint TextureFormat = 0x00000013
const TextureFormatRG16Unorm TextureFormat = 0x00000011
const TextureFormatRG32Float TextureFormat = 0x00000021
const TextureFormatRG32Sint TextureFormat = 0x00000023
const TextureFormatRG32Uint TextureFormat = 0x00000022
const TextureFormatRG8Sint TextureFormat = 0x0000000D
const TextureFormatRG8Snorm TextureFormat = 0x0000000B
const TextureFormatRG8Uint TextureFormat = 0x0000000C
const TextureFormatRG8Unorm TextureFormat = 0x0000000A
const TextureFormatRGB10A2Uint TextureFormat = 0x0000001D
const TextureFormatRGB10A2Unorm TextureFormat = 0x0000001E
const TextureFormatRGB9E5Ufloat TextureFormat = 0x00000020
const TextureFormatRGBA16Float TextureFormat = 0x00000028
const TextureFormatRGBA16Sint TextureFormat = 0x00000027
const TextureFormatRGBA16Snorm TextureFormat = 0x00000025
const TextureFormatRGBA16Uint TextureFormat = 0x00000026
const TextureFormatRGBA16Unorm TextureFormat = 0x00000024
const TextureFormatRGBA32Float TextureFormat = 0x00000029
const TextureFormatRGBA32Sint TextureFormat = 0x0000002B
const TextureFormatRGBA32Uint TextureFormat = 0x0000002A
const TextureFormatRGBA8Sint TextureFormat = 0x0000001A
const TextureFormatRGBA8Snorm TextureFormat = 0x00000018
const TextureFormatRGBA8Uint TextureFormat = 0x00000019
const TextureFormatRGBA8Unorm TextureFormat = 0x00000016
const TextureFormatRGBA8UnormSrgb TextureFormat = 0x00000017
const TextureFormatStencil8 TextureFormat = 0x0000002C
const TextureFormatUndefined TextureFormat = 0x00000000

func (TextureFormat) String

func (v TextureFormat) String() string

type TextureSampleType

type TextureSampleType uint32
const TextureSampleTypeBindingNotUsed TextureSampleType = 0x00000000
const TextureSampleTypeDepth TextureSampleType = 0x00000004
const TextureSampleTypeFloat TextureSampleType = 0x00000002
const TextureSampleTypeSint TextureSampleType = 0x00000005
const TextureSampleTypeUint TextureSampleType = 0x00000006
const TextureSampleTypeUndefined TextureSampleType = 0x00000001
const TextureSampleTypeUnfilterableFloat TextureSampleType = 0x00000003

func (TextureSampleType) String

func (v TextureSampleType) String() string

type TextureUsage

type TextureUsage uint64
const TextureUsageCopyDst TextureUsage = 0x00000002
const TextureUsageCopySrc TextureUsage = 0x00000001
const TextureUsageNone TextureUsage = 0x00000000
const TextureUsageRenderAttachment TextureUsage = 0x00000010
const TextureUsageStorageBinding TextureUsage = 0x00000008
const TextureUsageTextureBinding TextureUsage = 0x00000004
const TextureUsageTransientAttachment TextureUsage = 0x00000020

func (TextureUsage) String added in v0.27.1

func (v TextureUsage) String() string

type TextureView

type TextureView struct {
	// contains filtered or unexported fields
}

func (*TextureView) IsValid added in v1.30.2

func (g *TextureView) IsValid() bool

func (*TextureView) Release

func (g *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 TextureViewDimension1D TextureViewDimension = 0x00000001
const TextureViewDimension2D TextureViewDimension = 0x00000002
const TextureViewDimension2DArray TextureViewDimension = 0x00000003
const TextureViewDimension3D TextureViewDimension = 0x00000006
const TextureViewDimensionCube TextureViewDimension = 0x00000004
const TextureViewDimensionCubeArray TextureViewDimension = 0x00000005
const TextureViewDimensionUndefined TextureViewDimension = 0x00000000

func (TextureViewDimension) String

func (v TextureViewDimension) String() string

type ToneMappingMode added in v1.30.0

type ToneMappingMode uint32
const ToneMappingModeExtended ToneMappingMode = 0x00000002
const ToneMappingModeStandard ToneMappingMode = 0x00000001

func (ToneMappingMode) String added in v1.30.0

func (v ToneMappingMode) String() string

type Version

type Version uint32

func GetVersion

func GetVersion() Version

func (Version) String

func (v Version) String() 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 VertexFormatFloat16 VertexFormat = 0x00000019
const VertexFormatFloat16x2 VertexFormat = 0x0000001A
const VertexFormatFloat16x4 VertexFormat = 0x0000001B
const VertexFormatFloat32 VertexFormat = 0x0000001C
const VertexFormatFloat32x2 VertexFormat = 0x0000001D
const VertexFormatFloat32x3 VertexFormat = 0x0000001E
const VertexFormatFloat32x4 VertexFormat = 0x0000001F
const VertexFormatSint16 VertexFormat = 0x00000010
const VertexFormatSint16x2 VertexFormat = 0x00000011
const VertexFormatSint16x4 VertexFormat = 0x00000012
const VertexFormatSint32 VertexFormat = 0x00000024
const VertexFormatSint32x2 VertexFormat = 0x00000025
const VertexFormatSint32x3 VertexFormat = 0x00000026
const VertexFormatSint32x4 VertexFormat = 0x00000027
const VertexFormatSint8 VertexFormat = 0x00000004
const VertexFormatSint8x2 VertexFormat = 0x00000005
const VertexFormatSint8x4 VertexFormat = 0x00000006
const VertexFormatSnorm16 VertexFormat = 0x00000016
const VertexFormatSnorm16x2 VertexFormat = 0x00000017
const VertexFormatSnorm16x4 VertexFormat = 0x00000018
const VertexFormatSnorm8 VertexFormat = 0x0000000A
const VertexFormatSnorm8x2 VertexFormat = 0x0000000B
const VertexFormatSnorm8x4 VertexFormat = 0x0000000C
const VertexFormatUint16 VertexFormat = 0x0000000D
const VertexFormatUint16x2 VertexFormat = 0x0000000E
const VertexFormatUint16x4 VertexFormat = 0x0000000F
const VertexFormatUint32 VertexFormat = 0x00000020
const VertexFormatUint32x2 VertexFormat = 0x00000021
const VertexFormatUint32x3 VertexFormat = 0x00000022
const VertexFormatUint32x4 VertexFormat = 0x00000023
const VertexFormatUint8 VertexFormat = 0x00000001
const VertexFormatUint8x2 VertexFormat = 0x00000002
const VertexFormatUint8x4 VertexFormat = 0x00000003
const VertexFormatUnorm16 VertexFormat = 0x00000013
const VertexFormatUnorm16x2 VertexFormat = 0x00000014
const VertexFormatUnorm16x4 VertexFormat = 0x00000015
const VertexFormatUnorm8 VertexFormat = 0x00000007
const VertexFormatUnorm8x2 VertexFormat = 0x00000008
const VertexFormatUnorm8x4 VertexFormat = 0x00000009
const VertexFormatUnorm8x4BGRA VertexFormat = 0x00000029

func (VertexFormat) ByteSize added in v1.34.0

func (v VertexFormat) ByteSize() uint32

func (VertexFormat) Size

func (v VertexFormat) Size() uint64

func (VertexFormat) String

func (v VertexFormat) String() string

type VertexState

type VertexState struct {
	Module     *ShaderModule
	EntryPoint string
	Buffers    []VertexBufferLayout
}

type VertexStepMode

type VertexStepMode uint32
const VertexStepModeInstance VertexStepMode = 0x00000002
const VertexStepModeUndefined VertexStepMode = 0x00000000
const VertexStepModeVertex VertexStepMode = 0x00000001

func (VertexStepMode) String

func (v VertexStepMode) String() string

type WGSLLanguageFeatureName

type WGSLLanguageFeatureName uint32
const WGSLLanguageFeatureNameLinearIndexing WGSLLanguageFeatureName = 0x0000000A
const WGSLLanguageFeatureNamePacked4x8IntegerDotProduct WGSLLanguageFeatureName = 0x00000002
const WGSLLanguageFeatureNamePointerCompositeAccess WGSLLanguageFeatureName = 0x00000004
const WGSLLanguageFeatureNameReadonlyAndReadwriteStorageTextures WGSLLanguageFeatureName = 0x00000001
const WGSLLanguageFeatureNameSubgroupId WGSLLanguageFeatureName = 0x00000006
const WGSLLanguageFeatureNameSubgroupUniformity WGSLLanguageFeatureName = 0x00000008
const WGSLLanguageFeatureNameTextureAndSamplerLet WGSLLanguageFeatureName = 0x00000007
const WGSLLanguageFeatureNameTextureFormatsTier1 WGSLLanguageFeatureName = 0x00000009
const WGSLLanguageFeatureNameUniformBufferStandardLayout WGSLLanguageFeatureName = 0x00000005
const WGSLLanguageFeatureNameUnrestrictedPointerParameters WGSLLanguageFeatureName = 0x00000003

func (WGSLLanguageFeatureName) String

func (v WGSLLanguageFeatureName) String() string

type WaitStatus

type WaitStatus uint32
const WaitStatusError WaitStatus = 0x00000003
const WaitStatusSuccess WaitStatus = 0x00000001
const WaitStatusTimedOut WaitStatus = 0x00000002

func (WaitStatus) String

func (v WaitStatus) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL