wgpu

package module
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 41

Documentation

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).WriteTexture()`.
	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 (
	Color_Transparent = Color{0, 0, 0, 0}
	Color_Black       = Color{0, 0, 0, 1}
	Color_White       = Color{1, 1, 1, 1}
	Color_Red         = Color{1, 0, 0, 1}
	Color_Green       = Color{0, 1, 0, 1}
	Color_Blue        = Color{0, 0, 1, 1}

	BlendComponent_Replace = BlendComponent{
		SrcFactor: BlendFactor_One,
		DstFactor: BlendFactor_Zero,
		Operation: BlendOperation_Add,
	}
	BlendComponent_Over = BlendComponent{
		SrcFactor: BlendFactor_One,
		DstFactor: BlendFactor_OneMinusSrcAlpha,
		Operation: BlendOperation_Add,
	}

	BlendState_Replace = BlendState{
		Color: BlendComponent_Replace,
		Alpha: BlendComponent_Replace,
	}
	BlendState_AlphaBlending = BlendState{
		Color: BlendComponent{
			SrcFactor: BlendFactor_SrcAlpha,
			DstFactor: BlendFactor_OneMinusSrcAlpha,
			Operation: BlendOperation_Add,
		},
		Alpha: BlendComponent_Over,
	}
	BlendState_PremultipliedAlphaBlending = BlendState{
		Color: BlendComponent_Over,
		Alpha: BlendComponent_Over,
	}
)

Functions

func FromBytes

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

func SetLogLevel

func SetLogLevel(level LogLevel)

func ToBytes

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

Types

type Adapter

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

func (*Adapter) EnumerateFeatures

func (p *Adapter) EnumerateFeatures() []FeatureName

func (*Adapter) GetLimits

func (p *Adapter) GetLimits() SupportedLimits

func (*Adapter) GetProperties

func (p *Adapter) GetProperties() AdapterProperties

func (*Adapter) HasFeature

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

func (*Adapter) Release added in v0.16.1

func (p *Adapter) Release()

func (*Adapter) RequestDevice

func (p *Adapter) RequestDevice(descriptor *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 (
	AdapterType_DiscreteGPU   AdapterType = 0x00000000
	AdapterType_IntegratedGPU AdapterType = 0x00000001
	AdapterType_CPU           AdapterType = 0x00000002
	AdapterType_Unknown       AdapterType = 0x00000003
)

func (AdapterType) String

func (v AdapterType) String() string

type AddressMode

type AddressMode uint32
const (
	AddressMode_Repeat       AddressMode = 0x00000000
	AddressMode_MirrorRepeat AddressMode = 0x00000001
	AddressMode_ClampToEdge  AddressMode = 0x00000002
)

func (AddressMode) String

func (v AddressMode) String() string

type BackendType

type BackendType uint32
const (
	BackendType_Undefined BackendType = 0x00000000
	BackendType_Null      BackendType = 0x00000001
	BackendType_WebGPU    BackendType = 0x00000002
	BackendType_D3D11     BackendType = 0x00000003
	BackendType_D3D12     BackendType = 0x00000004
	BackendType_Metal     BackendType = 0x00000005
	BackendType_Vulkan    BackendType = 0x00000006
	BackendType_OpenGL    BackendType = 0x00000007
	BackendType_OpenGLES  BackendType = 0x00000008
)

func (BackendType) String

func (v BackendType) String() string

type BindGroup

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

func (*BindGroup) Release added in v0.16.1

func (p *BindGroup) Release()

type BindGroupDescriptor

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

type BindGroupEntry

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

type BindGroupLayout

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

func (*BindGroupLayout) Release added in v0.16.1

func (p *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
}

type BlendComponent

type BlendComponent struct {
	Operation BlendOperation
	SrcFactor BlendFactor
	DstFactor BlendFactor
}

type BlendFactor

type BlendFactor uint32
const (
	BlendFactor_Zero              BlendFactor = 0x00000000
	BlendFactor_One               BlendFactor = 0x00000001
	BlendFactor_Src               BlendFactor = 0x00000002
	BlendFactor_OneMinusSrc       BlendFactor = 0x00000003
	BlendFactor_SrcAlpha          BlendFactor = 0x00000004
	BlendFactor_OneMinusSrcAlpha  BlendFactor = 0x00000005
	BlendFactor_Dst               BlendFactor = 0x00000006
	BlendFactor_OneMinusDst       BlendFactor = 0x00000007
	BlendFactor_DstAlpha          BlendFactor = 0x00000008
	BlendFactor_OneMinusDstAlpha  BlendFactor = 0x00000009
	BlendFactor_SrcAlphaSaturated BlendFactor = 0x0000000A
	BlendFactor_Constant          BlendFactor = 0x0000000B
	BlendFactor_OneMinusConstant  BlendFactor = 0x0000000C
)

func (BlendFactor) String

func (v BlendFactor) String() string

type BlendOperation

type BlendOperation uint32
const (
	BlendOperation_Add             BlendOperation = 0x00000000
	BlendOperation_Subtract        BlendOperation = 0x00000001
	BlendOperation_ReverseSubtract BlendOperation = 0x00000002
	BlendOperation_Min             BlendOperation = 0x00000003
	BlendOperation_Max             BlendOperation = 0x00000004
)

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 added in v0.16.1

func (p *Buffer) GetSize() uint64

func (*Buffer) GetUsage added in v0.16.1

func (p *Buffer) GetUsage() BufferUsage

func (*Buffer) MapAsync

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

func (*Buffer) Release added in v0.16.1

func (p *Buffer) Release()

func (*Buffer) Unmap

func (p *Buffer) Unmap() (err error)

type BufferBindingLayout

type BufferBindingLayout struct {
	Type             BufferBindingType
	HasDynamicOffset bool
	MinBindingSize   uint64
}

type BufferBindingType

type BufferBindingType uint32
const (
	BufferBindingType_Undefined       BufferBindingType = 0x00000000
	BufferBindingType_Uniform         BufferBindingType = 0x00000001
	BufferBindingType_Storage         BufferBindingType = 0x00000002
	BufferBindingType_ReadOnlyStorage BufferBindingType = 0x00000003
)

func (BufferBindingType) String

func (v BufferBindingType) String() string

type BufferDescriptor

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

type BufferInitDescriptor

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

type BufferMapAsyncStatus

type BufferMapAsyncStatus uint32
const (
	BufferMapAsyncStatus_Success                 BufferMapAsyncStatus = 0x00000000
	BufferMapAsyncStatus_ValidationError         BufferMapAsyncStatus = 0x00000001
	BufferMapAsyncStatus_Unknown                 BufferMapAsyncStatus = 0x00000002
	BufferMapAsyncStatus_DeviceLost              BufferMapAsyncStatus = 0x00000003
	BufferMapAsyncStatus_DestroyedBeforeCallback BufferMapAsyncStatus = 0x00000004
	BufferMapAsyncStatus_UnmappedBeforeCallback  BufferMapAsyncStatus = 0x00000005
	BufferMapAsyncStatus_MappingAlreadyPending   BufferMapAsyncStatus = 0x00000006
	BufferMapAsyncStatus_OffsetOutOfRange        BufferMapAsyncStatus = 0x00000007
	BufferMapAsyncStatus_SizeOutOfRange          BufferMapAsyncStatus = 0x00000008
)

func (BufferMapAsyncStatus) String

func (v BufferMapAsyncStatus) String() string

type BufferMapCallback

type BufferMapCallback func(BufferMapAsyncStatus)

type BufferMapState added in v0.16.1

type BufferMapState uint32
const (
	BufferMapState_Unmapped BufferMapState = 0x00000000
	BufferMapState_Pending  BufferMapState = 0x00000001
	BufferMapState_Mapped   BufferMapState = 0x00000002
)

func (BufferMapState) String added in v0.16.1

func (v BufferMapState) String() string

type BufferUsage

type BufferUsage uint32
const (
	BufferUsage_None         BufferUsage = 0x00000000
	BufferUsage_MapRead      BufferUsage = 0x00000001
	BufferUsage_MapWrite     BufferUsage = 0x00000002
	BufferUsage_CopySrc      BufferUsage = 0x00000004
	BufferUsage_CopyDst      BufferUsage = 0x00000008
	BufferUsage_Index        BufferUsage = 0x00000010
	BufferUsage_Vertex       BufferUsage = 0x00000020
	BufferUsage_Uniform      BufferUsage = 0x00000040
	BufferUsage_Storage      BufferUsage = 0x00000080
	BufferUsage_Indirect     BufferUsage = 0x00000100
	BufferUsage_QueryResolve BufferUsage = 0x00000200
)

func (BufferUsage) String

func (v BufferUsage) String() string

type Color

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

type ColorTargetState

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

type ColorWriteMask

type ColorWriteMask uint32
const (
	ColorWriteMask_None  ColorWriteMask = 0x00000000
	ColorWriteMask_Red   ColorWriteMask = 0x00000001
	ColorWriteMask_Green ColorWriteMask = 0x00000002
	ColorWriteMask_Blue  ColorWriteMask = 0x00000004
	ColorWriteMask_Alpha ColorWriteMask = 0x00000008
	ColorWriteMask_All   ColorWriteMask = 0x0000000F
)

func (ColorWriteMask) String

func (v ColorWriteMask) String() string

type CommandBuffer

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

func (*CommandBuffer) Release added in v0.16.1

func (p *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) (err error)

func (*CommandEncoder) CopyBufferToBuffer

func (p *CommandEncoder) CopyBufferToBuffer(source *Buffer, sourceOffset uint64, destination *Buffer, destinatonOffset uint64, size uint64) (err error)

func (*CommandEncoder) CopyBufferToTexture

func (p *CommandEncoder) CopyBufferToTexture(source *ImageCopyBuffer, destination *ImageCopyTexture, copySize *Extent3D) (err error)

func (*CommandEncoder) CopyTextureToBuffer

func (p *CommandEncoder) CopyTextureToBuffer(source *ImageCopyTexture, destination *ImageCopyBuffer, copySize *Extent3D) (err error)

func (*CommandEncoder) CopyTextureToTexture

func (p *CommandEncoder) CopyTextureToTexture(source *ImageCopyTexture, destination *ImageCopyTexture, copySize *Extent3D) (err error)

func (*CommandEncoder) Finish

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

func (*CommandEncoder) InsertDebugMarker

func (p *CommandEncoder) InsertDebugMarker(markerLabel string) (err error)

func (*CommandEncoder) PopDebugGroup

func (p *CommandEncoder) PopDebugGroup() (err error)

func (*CommandEncoder) PushDebugGroup

func (p *CommandEncoder) PushDebugGroup(groupLabel string) (err error)

func (*CommandEncoder) Release added in v0.16.1

func (p *CommandEncoder) Release()

func (*CommandEncoder) ResolveQuerySet added in v0.16.1

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

func (*CommandEncoder) WriteTimestamp added in v0.16.1

func (p *CommandEncoder) WriteTimestamp(querySet *QuerySet, queryIndex uint32) (err error)

type CommandEncoderDescriptor

type CommandEncoderDescriptor struct {
	Label string
}

type CompareFunction

type CompareFunction uint32
const (
	CompareFunction_Undefined    CompareFunction = 0x00000000
	CompareFunction_Never        CompareFunction = 0x00000001
	CompareFunction_Less         CompareFunction = 0x00000002
	CompareFunction_LessEqual    CompareFunction = 0x00000003
	CompareFunction_Greater      CompareFunction = 0x00000004
	CompareFunction_GreaterEqual CompareFunction = 0x00000005
	CompareFunction_Equal        CompareFunction = 0x00000006
	CompareFunction_NotEqual     CompareFunction = 0x00000007
	CompareFunction_Always       CompareFunction = 0x00000008
)

func (CompareFunction) String

func (v CompareFunction) String() string

type CompilationInfoRequestStatus

type CompilationInfoRequestStatus uint32
const (
	CompilationInfoRequestStatus_Success    CompilationInfoRequestStatus = 0x00000000
	CompilationInfoRequestStatus_Error      CompilationInfoRequestStatus = 0x00000001
	CompilationInfoRequestStatus_DeviceLost CompilationInfoRequestStatus = 0x00000002
	CompilationInfoRequestStatus_Unknown    CompilationInfoRequestStatus = 0x00000003
)

func (CompilationInfoRequestStatus) String

type CompilationMessageType

type CompilationMessageType uint32
const (
	CompilationMessageType_Error   CompilationMessageType = 0x00000000
	CompilationMessageType_Warning CompilationMessageType = 0x00000001
	CompilationMessageType_Info    CompilationMessageType = 0x00000002
)

func (CompilationMessageType) String

func (v CompilationMessageType) String() string

type CompositeAlphaMode added in v0.15.1

type CompositeAlphaMode uint32
const (
	CompositeAlphaMode_Auto           CompositeAlphaMode = 0x00000000
	CompositeAlphaMode_Opaque         CompositeAlphaMode = 0x00000001
	CompositeAlphaMode_PreMultiplied  CompositeAlphaMode = 0x00000002
	CompositeAlphaMode_PostMultiplied CompositeAlphaMode = 0x00000003
	CompositeAlphaMode_Inherit        CompositeAlphaMode = 0x00000004
)

func (CompositeAlphaMode) String added in v0.15.1

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 added in v0.16.1

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() (err error)

func (*ComputePassEncoder) EndPipelineStatisticsQuery added in v0.16.1

func (p *ComputePassEncoder) EndPipelineStatisticsQuery()

func (*ComputePassEncoder) InsertDebugMarker

func (p *ComputePassEncoder) InsertDebugMarker(markerLabel string)

func (*ComputePassEncoder) PopDebugGroup

func (p *ComputePassEncoder) PopDebugGroup()

func (*ComputePassEncoder) PushDebugGroup

func (p *ComputePassEncoder) PushDebugGroup(groupLabel string)

func (*ComputePassEncoder) Release added in v0.16.1

func (p *ComputePassEncoder) Release()

func (*ComputePassEncoder) SetBindGroup

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

func (*ComputePassEncoder) SetPipeline

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

type ComputePassTimestampLocation

type ComputePassTimestampLocation uint32
const (
	ComputePassTimestampLocation_Beginning ComputePassTimestampLocation = 0x00000000
	ComputePassTimestampLocation_End       ComputePassTimestampLocation = 0x00000001
)

func (ComputePassTimestampLocation) String

type ComputePipeline

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

func (*ComputePipeline) GetBindGroupLayout

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

func (*ComputePipeline) Release added in v0.16.1

func (p *ComputePipeline) Release()

type ComputePipelineDescriptor

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

type ConstantEntry

type ConstantEntry struct {
	Key   string
	Value float64
}

type CreatePipelineAsyncStatus

type CreatePipelineAsyncStatus uint32
const (
	CreatePipelineAsyncStatus_Success         CreatePipelineAsyncStatus = 0x00000000
	CreatePipelineAsyncStatus_ValidationError CreatePipelineAsyncStatus = 0x00000001
	CreatePipelineAsyncStatus_InternalError   CreatePipelineAsyncStatus = 0x00000002
	CreatePipelineAsyncStatus_DeviceLost      CreatePipelineAsyncStatus = 0x00000003
	CreatePipelineAsyncStatus_DeviceDestroyed CreatePipelineAsyncStatus = 0x00000004
	CreatePipelineAsyncStatus_Unknown         CreatePipelineAsyncStatus = 0x00000005
)

func (CreatePipelineAsyncStatus) String

func (v CreatePipelineAsyncStatus) String() string

type CullMode

type CullMode uint32
const (
	CullMode_None  CullMode = 0x00000000
	CullMode_Front CullMode = 0x00000001
	CullMode_Back  CullMode = 0x00000002
)

func (CullMode) String

func (v CullMode) 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 (p *Device) CreateBindGroup(descriptor *BindGroupDescriptor) (*BindGroup, error)

func (*Device) CreateBindGroupLayout

func (p *Device) CreateBindGroupLayout(descriptor *BindGroupLayoutDescriptor) (*BindGroupLayout, error)

func (*Device) CreateBuffer

func (p *Device) CreateBuffer(descriptor *BufferDescriptor) (*Buffer, error)

func (*Device) CreateBufferInit

func (p *Device) CreateBufferInit(descriptor *BufferInitDescriptor) (*Buffer, error)

func (*Device) CreateCommandEncoder

func (p *Device) CreateCommandEncoder(descriptor *CommandEncoderDescriptor) (*CommandEncoder, error)

func (*Device) CreateComputePipeline

func (p *Device) CreateComputePipeline(descriptor *ComputePipelineDescriptor) (*ComputePipeline, error)

func (*Device) CreatePipelineLayout

func (p *Device) CreatePipelineLayout(descriptor *PipelineLayoutDescriptor) (*PipelineLayout, error)

func (*Device) CreateQuerySet added in v0.16.1

func (p *Device) CreateQuerySet(descriptor *QuerySetDescriptor) (*QuerySet, error)

func (*Device) CreateRenderBundleEncoder

func (p *Device) CreateRenderBundleEncoder(descriptor *RenderBundleEncoderDescriptor) (*RenderBundleEncoder, error)

func (*Device) CreateRenderPipeline

func (p *Device) CreateRenderPipeline(descriptor *RenderPipelineDescriptor) (*RenderPipeline, error)

func (*Device) CreateSampler

func (p *Device) CreateSampler(descriptor *SamplerDescriptor) (*Sampler, error)

func (*Device) CreateShaderModule

func (p *Device) CreateShaderModule(descriptor *ShaderModuleDescriptor) (*ShaderModule, error)

func (*Device) CreateSwapChain

func (p *Device) CreateSwapChain(surface *Surface, descriptor *SwapChainDescriptor) (*SwapChain, error)

func (*Device) CreateTexture

func (p *Device) CreateTexture(descriptor *TextureDescriptor) (*Texture, error)

func (*Device) EnumerateFeatures

func (p *Device) EnumerateFeatures() []FeatureName

func (*Device) GetLimits

func (p *Device) GetLimits() SupportedLimits

func (*Device) GetQueue

func (p *Device) GetQueue() *Queue

func (*Device) HasFeature

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

func (*Device) Poll

func (p *Device) Poll(wait bool, wrappedSubmissionIndex *WrappedSubmissionIndex) (queueEmpty bool)

func (*Device) Release added in v0.16.1

func (p *Device) Release()

type DeviceDescriptor

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

type DeviceLostCallback added in v0.16.1

type DeviceLostCallback func(reason DeviceLostReason, message string)

type DeviceLostReason

type DeviceLostReason uint32
const (
	DeviceLostReason_Undefined DeviceLostReason = 0x00000000
	DeviceLostReason_Destroyed DeviceLostReason = 0x00000001
)

func (DeviceLostReason) String

func (v DeviceLostReason) String() string

type Dx12Compiler added in v0.15.1

type Dx12Compiler uint32
const (
	Dx12Compiler_Undefined Dx12Compiler = 0x00000000
	Dx12Compiler_Fxc       Dx12Compiler = 0x00000001
	Dx12Compiler_Dxc       Dx12Compiler = 0x00000002
)

func (Dx12Compiler) String added in v0.15.1

func (v Dx12Compiler) String() string

type Error

type Error struct {
	Type    ErrorType
	Message string
}

func (*Error) Error

func (v *Error) Error() string

type ErrorFilter

type ErrorFilter uint32
const (
	ErrorFilter_Validation  ErrorFilter = 0x00000000
	ErrorFilter_OutOfMemory ErrorFilter = 0x00000001
	ErrorFilter_Internal    ErrorFilter = 0x00000002
)

func (ErrorFilter) String

func (v ErrorFilter) String() string

type ErrorType

type ErrorType uint32
const (
	ErrorType_NoError     ErrorType = 0x00000000
	ErrorType_Validation  ErrorType = 0x00000001
	ErrorType_OutOfMemory ErrorType = 0x00000002
	ErrorType_Internal    ErrorType = 0x00000003
	ErrorType_Unknown     ErrorType = 0x00000004
	ErrorType_DeviceLost  ErrorType = 0x00000005
)

func (ErrorType) String

func (v ErrorType) String() string

type Extent3D

type Extent3D struct {
	Width              uint32
	Height             uint32
	DepthOrArrayLayers uint32
}

type FeatureName

type FeatureName uint32
const (
	FeatureName_Undefined                              FeatureName = 0x00000000
	FeatureName_DepthClipControl                       FeatureName = 0x00000001
	FeatureName_Depth32FloatStencil8                   FeatureName = 0x00000002
	FeatureName_TimestampQuery                         FeatureName = 0x00000003
	FeatureName_PipelineStatisticsQuery                FeatureName = 0x00000004
	FeatureName_TextureCompressionBC                   FeatureName = 0x00000005
	FeatureName_TextureCompressionETC2                 FeatureName = 0x00000006
	FeatureName_TextureCompressionASTC                 FeatureName = 0x00000007
	FeatureName_IndirectFirstInstance                  FeatureName = 0x00000008
	FeatureName_ShaderF16                              FeatureName = 0x00000009
	FeatureName_RG11B10UfloatRenderable                FeatureName = 0x0000000A
	FeatureName_BGRA8UnormStorage                      FeatureName = 0x0000000B
	FeatureName_Float32Filterable                      FeatureName = 0x0000000C
	NativeFeature_PushConstants                        FeatureName = 0x60000001
	NativeFeature_TextureAdapterSpecificFormatFeatures FeatureName = 0x60000002
	NativeFeature_MultiDrawIndirect                    FeatureName = 0x60000003
	NativeFeature_MultiDrawIndirectCount               FeatureName = 0x60000004
	NativeFeature_VertexWritableStorage                FeatureName = 0x60000005
)

func (FeatureName) String

func (v FeatureName) String() string

type FilterMode

type FilterMode uint32
const (
	FilterMode_Nearest FilterMode = 0x00000000
	FilterMode_Linear  FilterMode = 0x00000001
)

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 (
	FrontFace_CCW FrontFace = 0x00000000
	FrontFace_CW  FrontFace = 0x00000001
)

func (FrontFace) String

func (v FrontFace) String() string

type GlobalReport

type GlobalReport struct {
	Surfaces StorageReport
	Vulkan   *HubReport
	Metal    *HubReport
	Dx12     *HubReport
	Dx11     *HubReport
	Gl       *HubReport
}

type HubReport

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

type ImageCopyBuffer

type ImageCopyBuffer struct {
	Layout TextureDataLayout
	Buffer *Buffer
}

type ImageCopyTexture

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

type IndexFormat

type IndexFormat uint32
const (
	IndexFormat_Undefined IndexFormat = 0x00000000
	IndexFormat_Uint16    IndexFormat = 0x00000001
	IndexFormat_Uint32    IndexFormat = 0x00000002
)

func (IndexFormat) String

func (v IndexFormat) String() string

type Instance added in v0.15.1

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

func CreateInstance added in v0.15.1

func CreateInstance(descriptor *InstanceDescriptor) *Instance

func (*Instance) CreateSurface added in v0.15.1

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

func (*Instance) EnumerateAdapters added in v0.16.1

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

func (*Instance) GenerateReport added in v0.15.1

func (p *Instance) GenerateReport() GlobalReport

func (*Instance) Release added in v0.16.1

func (p *Instance) Release()

func (*Instance) RequestAdapter added in v0.15.1

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

type InstanceBackend added in v0.15.1

type InstanceBackend uint32
const (
	InstanceBackend_None          InstanceBackend = 0x00000000
	InstanceBackend_Vulkan        InstanceBackend = 0x00000002
	InstanceBackend_Metal         InstanceBackend = 0x00000004
	InstanceBackend_DX12          InstanceBackend = 0x00000008
	InstanceBackend_DX11          InstanceBackend = 0x00000010
	InstanceBackend_GL            InstanceBackend = 0x00000020
	InstanceBackend_Secondary     InstanceBackend = 0x00000030
	InstanceBackend_BrowserWebGPU InstanceBackend = 0x00000040
	InstanceBackend_Primary       InstanceBackend = 0x0000004E
)

func (InstanceBackend) String added in v0.15.1

func (v InstanceBackend) String() string

type InstanceDescriptor added in v0.15.1

type InstanceDescriptor struct {
	Backends           InstanceBackend
	Dx12ShaderCompiler Dx12Compiler
	DxilPath           string
	DxcPath            string
}

type InstanceEnumerateAdapterOptons added in v0.16.1

type InstanceEnumerateAdapterOptons struct {
	Backends InstanceBackend
}

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

	MaxPushConstantSize uint32
}

func DefaultLimits added in v0.15.1

func DefaultLimits() Limits

type LoadOp

type LoadOp uint32
const (
	LoadOp_Undefined LoadOp = 0x00000000
	LoadOp_Clear     LoadOp = 0x00000001
	LoadOp_Load      LoadOp = 0x00000002
)

func (LoadOp) String

func (v LoadOp) String() string

type LogLevel

type LogLevel uint32
const (
	LogLevel_Off   LogLevel = 0x00000000
	LogLevel_Error LogLevel = 0x00000001
	LogLevel_Warn  LogLevel = 0x00000002
	LogLevel_Info  LogLevel = 0x00000003
	LogLevel_Debug LogLevel = 0x00000004
	LogLevel_Trace LogLevel = 0x00000005
)

func (LogLevel) String

func (v LogLevel) String() string

type MapMode

type MapMode uint32
const (
	MapMode_None  MapMode = 0x00000000
	MapMode_Read  MapMode = 0x00000001
	MapMode_Write MapMode = 0x00000002
)

func (MapMode) String

func (v MapMode) String() string

type MipmapFilterMode

type MipmapFilterMode uint32
const (
	MipmapFilterMode_Nearest MipmapFilterMode = 0x00000000
	MipmapFilterMode_Linear  MipmapFilterMode = 0x00000001
)

func (MipmapFilterMode) String

func (v MipmapFilterMode) String() string

type MultisampleState

type MultisampleState struct {
	Count                  uint32
	Mask                   uint32
	AlphaToCoverageEnabled bool
}

type Origin3D

type Origin3D struct {
	X, Y, Z uint32
}

type PipelineLayout

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

func (*PipelineLayout) Release added in v0.16.1

func (p *PipelineLayout) Release()

type PipelineLayoutDescriptor

type PipelineLayoutDescriptor struct {
	Label              string
	BindGroupLayouts   []*BindGroupLayout
	PushConstantRanges []PushConstantRange
}

type PipelineStatisticName

type PipelineStatisticName uint32
const (
	PipelineStatisticName_VertexShaderInvocations   PipelineStatisticName = 0x00000000
	PipelineStatisticName_ClipperInvocations        PipelineStatisticName = 0x00000001
	PipelineStatisticName_ClipperPrimitivesOut      PipelineStatisticName = 0x00000002
	PipelineStatisticName_FragmentShaderInvocations PipelineStatisticName = 0x00000003
	PipelineStatisticName_ComputeShaderInvocations  PipelineStatisticName = 0x00000004
)

func (PipelineStatisticName) String

func (v PipelineStatisticName) String() string

type PowerPreference

type PowerPreference uint32
const (
	PowerPreference_Undefined       PowerPreference = 0x00000000
	PowerPreference_LowPower        PowerPreference = 0x00000001
	PowerPreference_HighPerformance PowerPreference = 0x00000002
)

func (PowerPreference) String

func (v PowerPreference) String() string

type PresentMode

type PresentMode uint32
const (
	PresentMode_Immediate PresentMode = 0x00000000
	PresentMode_Mailbox   PresentMode = 0x00000001
	PresentMode_Fifo      PresentMode = 0x00000002
)

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 (
	PrimitiveTopology_PointList     PrimitiveTopology = 0x00000000
	PrimitiveTopology_LineList      PrimitiveTopology = 0x00000001
	PrimitiveTopology_LineStrip     PrimitiveTopology = 0x00000002
	PrimitiveTopology_TriangleList  PrimitiveTopology = 0x00000003
	PrimitiveTopology_TriangleStrip PrimitiveTopology = 0x00000004
)

func (PrimitiveTopology) String

func (v PrimitiveTopology) String() string

type ProgrammableStageDescriptor

type ProgrammableStageDescriptor struct {
	Module     *ShaderModule
	EntryPoint string
}

type PushConstantRange

type PushConstantRange struct {
	Stages ShaderStage
	Start  uint32
	End    uint32
}

type QuerySet

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

func (*QuerySet) Release added in v0.16.1

func (p *QuerySet) Release()

type QuerySetDescriptor added in v0.16.1

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

type QueryType

type QueryType uint32
const (
	QueryType_Occlusion          QueryType = 0x00000000
	QueryType_PipelineStatistics QueryType = 0x00000001
	QueryType_Timestamp          QueryType = 0x00000002
)

func (QueryType) String

func (v QueryType) String() string

type Queue

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

func (*Queue) OnSubmittedWorkDone added in v0.16.1

func (p *Queue) OnSubmittedWorkDone(callback QueueWorkDoneCallback)

func (*Queue) Release added in v0.16.1

func (p *Queue) Release()

func (*Queue) Submit

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

func (*Queue) WriteBuffer

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

func (*Queue) WriteTexture

func (p *Queue) WriteTexture(destination *ImageCopyTexture, data []byte, dataLayout *TextureDataLayout, writeSize *Extent3D) (err error)

type QueueWorkDoneCallback added in v0.16.1

type QueueWorkDoneCallback func(QueueWorkDoneStatus)

type QueueWorkDoneStatus

type QueueWorkDoneStatus uint32
const (
	QueueWorkDoneStatus_Success    QueueWorkDoneStatus = 0x00000000
	QueueWorkDoneStatus_Error      QueueWorkDoneStatus = 0x00000001
	QueueWorkDoneStatus_Unknown    QueueWorkDoneStatus = 0x00000002
	QueueWorkDoneStatus_DeviceLost QueueWorkDoneStatus = 0x00000003
)

func (QueueWorkDoneStatus) String

func (v QueueWorkDoneStatus) String() string

type RenderBundle

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

func (*RenderBundle) Release added in v0.16.1

func (p *RenderBundle) Release()

type RenderBundleDescriptor

type RenderBundleDescriptor struct {
	Label string
}

type RenderBundleEncoder

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

func (*RenderBundleEncoder) Draw

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

func (*RenderBundleEncoder) DrawIndexed

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

func (*RenderBundleEncoder) DrawIndexedIndirect

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

func (*RenderBundleEncoder) DrawIndirect

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

func (*RenderBundleEncoder) Finish

func (*RenderBundleEncoder) InsertDebugMarker

func (p *RenderBundleEncoder) InsertDebugMarker(markerLabel string)

func (*RenderBundleEncoder) PopDebugGroup

func (p *RenderBundleEncoder) PopDebugGroup()

func (*RenderBundleEncoder) PushDebugGroup

func (p *RenderBundleEncoder) PushDebugGroup(groupLabel string)

func (*RenderBundleEncoder) Release added in v0.16.1

func (p *RenderBundleEncoder) Release()

func (*RenderBundleEncoder) SetBindGroup

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

func (*RenderBundleEncoder) SetIndexBuffer

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

func (*RenderBundleEncoder) SetPipeline

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

func (*RenderBundleEncoder) SetVertexBuffer

func (p *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
}

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
}

type RenderPassEncoder

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

func (*RenderPassEncoder) BeginOcclusionQuery added in v0.16.1

func (p *RenderPassEncoder) BeginOcclusionQuery(queryIndex uint32)

func (*RenderPassEncoder) BeginPipelineStatisticsQuery added in v0.16.1

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() (err error)

func (*RenderPassEncoder) EndOcclusionQuery added in v0.16.1

func (p *RenderPassEncoder) EndOcclusionQuery()

func (*RenderPassEncoder) EndPipelineStatisticsQuery added in v0.16.1

func (p *RenderPassEncoder) EndPipelineStatisticsQuery()

func (*RenderPassEncoder) ExecuteBundles

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

func (*RenderPassEncoder) InsertDebugMarker

func (p *RenderPassEncoder) InsertDebugMarker(markerLabel string)

func (*RenderPassEncoder) MultiDrawIndexedIndirect added in v0.1.4

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

func (*RenderPassEncoder) MultiDrawIndexedIndirectCount added in v0.1.4

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

func (*RenderPassEncoder) MultiDrawIndirect added in v0.1.4

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

func (*RenderPassEncoder) MultiDrawIndirectCount added in v0.1.4

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 added in v0.16.1

func (p *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) SetIndexBuffer

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

func (*RenderPassEncoder) SetPipeline

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

func (*RenderPassEncoder) SetPushConstants

func (p *RenderPassEncoder) SetPushConstants(stages ShaderStage, offset uint32, data []byte)

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)

type RenderPassTimestampLocation

type RenderPassTimestampLocation uint32
const (
	RenderPassTimestampLocation_Beginning RenderPassTimestampLocation = 0x00000000
	RenderPassTimestampLocation_End       RenderPassTimestampLocation = 0x00000001
)

func (RenderPassTimestampLocation) String

type RenderPipeline

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

func (*RenderPipeline) GetBindGroupLayout

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

func (*RenderPipeline) Release added in v0.16.1

func (p *RenderPipeline) Release()

type RenderPipelineDescriptor

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

type RequestAdapterOptions

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

type RequestAdapterStatus

type RequestAdapterStatus uint32
const (
	RequestAdapterStatus_Success     RequestAdapterStatus = 0x00000000
	RequestAdapterStatus_Unavailable RequestAdapterStatus = 0x00000001
	RequestAdapterStatus_Error       RequestAdapterStatus = 0x00000002
	RequestAdapterStatus_Unknown     RequestAdapterStatus = 0x00000003
)

func (RequestAdapterStatus) String

func (v RequestAdapterStatus) String() string

type RequestDeviceStatus

type RequestDeviceStatus uint32
const (
	RequestDeviceStatus_Success RequestDeviceStatus = 0x00000000
	RequestDeviceStatus_Error   RequestDeviceStatus = 0x00000001
	RequestDeviceStatus_Unknown RequestDeviceStatus = 0x00000002
)

func (RequestDeviceStatus) String

func (v RequestDeviceStatus) String() string

type RequiredLimits

type RequiredLimits struct {
	Limits Limits
}

type Sampler

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

func (*Sampler) Release added in v0.16.1

func (p *Sampler) Release()

type SamplerBindingLayout

type SamplerBindingLayout struct {
	Type SamplerBindingType
}

type SamplerBindingType

type SamplerBindingType uint32
const (
	SamplerBindingType_Undefined    SamplerBindingType = 0x00000000
	SamplerBindingType_Filtering    SamplerBindingType = 0x00000001
	SamplerBindingType_NonFiltering SamplerBindingType = 0x00000002
	SamplerBindingType_Comparison   SamplerBindingType = 0x00000003
)

func (SamplerBindingType) String

func (v 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
	MaxAnisotrophy uint16
}

type ShaderModule

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

func (*ShaderModule) Release added in v0.16.1

func (p *ShaderModule) Release()

type ShaderModuleDescriptor

type ShaderModuleDescriptor struct {
	Label           string
	SPIRVDescriptor *ShaderModuleSPIRVDescriptor
	WGSLDescriptor  *ShaderModuleWGSLDescriptor
	GLSLDescriptor  *ShaderModuleGLSLDescriptor
}

type ShaderModuleGLSLDescriptor

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

type ShaderModuleSPIRVDescriptor

type ShaderModuleSPIRVDescriptor struct {
	Code []byte
}

type ShaderModuleWGSLDescriptor

type ShaderModuleWGSLDescriptor struct {
	Code string
}

type ShaderStage

type ShaderStage uint32
const (
	ShaderStage_None     ShaderStage = 0x00000000
	ShaderStage_Vertex   ShaderStage = 0x00000001
	ShaderStage_Fragment ShaderStage = 0x00000002
	ShaderStage_Compute  ShaderStage = 0x00000004
)

func (ShaderStage) String

func (v ShaderStage) String() string

type StencilFaceState

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

type StencilOperation

type StencilOperation uint32
const (
	StencilOperation_Keep           StencilOperation = 0x00000000
	StencilOperation_Zero           StencilOperation = 0x00000001
	StencilOperation_Replace        StencilOperation = 0x00000002
	StencilOperation_Invert         StencilOperation = 0x00000003
	StencilOperation_IncrementClamp StencilOperation = 0x00000004
	StencilOperation_DecrementClamp StencilOperation = 0x00000005
	StencilOperation_IncrementWrap  StencilOperation = 0x00000006
	StencilOperation_DecrementWrap  StencilOperation = 0x00000007
)

func (StencilOperation) String

func (v StencilOperation) String() string

type StorageReport

type StorageReport struct {
	NumOccupied uint64
	NumVacant   uint64
	NumError    uint64
	ElementSize uint64
}

type StorageTextureAccess

type StorageTextureAccess uint32
const (
	StorageTextureAccess_Undefined StorageTextureAccess = 0x00000000
	StorageTextureAccess_WriteOnly StorageTextureAccess = 0x00000001
)

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 (
	StoreOp_Undefined StoreOp = 0x00000000
	StoreOp_Store     StoreOp = 0x00000001
	StoreOp_Discard   StoreOp = 0x00000002
)

func (StoreOp) String

func (v StoreOp) String() string

type SubmissionIndex

type SubmissionIndex uint64

type SupportedLimits

type SupportedLimits struct {
	Limits Limits
}

type Surface

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

func (*Surface) GetCapabilities added in v0.15.1

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

func (*Surface) GetPreferredFormat

func (p *Surface) GetPreferredFormat(adapter *Adapter) TextureFormat

func (*Surface) Release added in v0.16.1

func (p *Surface) Release()

type SurfaceCapabilities added in v0.15.1

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

type SurfaceDescriptorFromAndroidNativeWindow

type SurfaceDescriptorFromAndroidNativeWindow struct {
	Window unsafe.Pointer
}

type SurfaceDescriptorFromMetalLayer

type SurfaceDescriptorFromMetalLayer struct {
	Layer unsafe.Pointer
}

type SurfaceDescriptorFromWaylandSurface

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

type SurfaceDescriptorFromWindowsHWND

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

type SurfaceDescriptorFromXcbWindow

type SurfaceDescriptorFromXcbWindow struct {
	Connection unsafe.Pointer
	Window     uint32
}

type SurfaceDescriptorFromXlibWindow

type SurfaceDescriptorFromXlibWindow struct {
	Display unsafe.Pointer
	Window  uint32
}

type SwapChain

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

func (*SwapChain) GetCurrentTextureView

func (p *SwapChain) GetCurrentTextureView() (*TextureView, error)

func (*SwapChain) Present

func (p *SwapChain) Present()

func (*SwapChain) Release added in v0.16.1

func (p *SwapChain) Release()

type SwapChainDescriptor

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

type Texture

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

func (*Texture) AsImageCopy

func (p *Texture) AsImageCopy() *ImageCopyTexture

func (*Texture) CreateView

func (p *Texture) CreateView(descriptor *TextureViewDescriptor) (*TextureView, error)

func (*Texture) Destroy

func (p *Texture) Destroy()

func (*Texture) GetDepthOrArrayLayers added in v0.16.1

func (p *Texture) GetDepthOrArrayLayers() uint32

func (*Texture) GetDimension added in v0.16.1

func (p *Texture) GetDimension() TextureDimension

func (*Texture) GetFormat added in v0.16.1

func (p *Texture) GetFormat() TextureFormat

func (*Texture) GetHeight added in v0.16.1

func (p *Texture) GetHeight() uint32

func (*Texture) GetMipLevelCount added in v0.16.1

func (p *Texture) GetMipLevelCount() uint32

func (*Texture) GetSampleCount added in v0.16.1

func (p *Texture) GetSampleCount() uint32

func (*Texture) GetUsage added in v0.16.1

func (p *Texture) GetUsage() TextureUsage

func (*Texture) GetWidth added in v0.16.1

func (p *Texture) GetWidth() uint32

func (*Texture) Release added in v0.16.1

func (p *Texture) Release()

type TextureAspect

type TextureAspect uint32
const (
	TextureAspect_All         TextureAspect = 0x00000000
	TextureAspect_StencilOnly TextureAspect = 0x00000001
	TextureAspect_DepthOnly   TextureAspect = 0x00000002
)

func (TextureAspect) String

func (v TextureAspect) String() string

type TextureBindingLayout

type TextureBindingLayout struct {
	SampleType    TextureSampleType
	ViewDimension TextureViewDimension
	Multisampled  bool
}

type TextureDataLayout

type TextureDataLayout struct {
	Offset       uint64
	BytesPerRow  uint32
	RowsPerImage uint32
}

type TextureDescriptor

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

type TextureDimension

type TextureDimension uint32
const (
	TextureDimension_1D TextureDimension = 0x00000000
	TextureDimension_2D TextureDimension = 0x00000001
	TextureDimension_3D TextureDimension = 0x00000002
)

func (TextureDimension) String

func (v TextureDimension) String() string

type TextureFormat

type TextureFormat uint32
const (
	TextureFormat_Undefined            TextureFormat = 0x00000000
	TextureFormat_R8Unorm              TextureFormat = 0x00000001
	TextureFormat_R8Snorm              TextureFormat = 0x00000002
	TextureFormat_R8Uint               TextureFormat = 0x00000003
	TextureFormat_R8Sint               TextureFormat = 0x00000004
	TextureFormat_R16Uint              TextureFormat = 0x00000005
	TextureFormat_R16Sint              TextureFormat = 0x00000006
	TextureFormat_R16Float             TextureFormat = 0x00000007
	TextureFormat_RG8Unorm             TextureFormat = 0x00000008
	TextureFormat_RG8Snorm             TextureFormat = 0x00000009
	TextureFormat_RG8Uint              TextureFormat = 0x0000000A
	TextureFormat_RG8Sint              TextureFormat = 0x0000000B
	TextureFormat_R32Float             TextureFormat = 0x0000000C
	TextureFormat_R32Uint              TextureFormat = 0x0000000D
	TextureFormat_R32Sint              TextureFormat = 0x0000000E
	TextureFormat_RG16Uint             TextureFormat = 0x0000000F
	TextureFormat_RG16Sint             TextureFormat = 0x00000010
	TextureFormat_RG16Float            TextureFormat = 0x00000011
	TextureFormat_RGBA8Unorm           TextureFormat = 0x00000012
	TextureFormat_RGBA8UnormSrgb       TextureFormat = 0x00000013
	TextureFormat_RGBA8Snorm           TextureFormat = 0x00000014
	TextureFormat_RGBA8Uint            TextureFormat = 0x00000015
	TextureFormat_RGBA8Sint            TextureFormat = 0x00000016
	TextureFormat_BGRA8Unorm           TextureFormat = 0x00000017
	TextureFormat_BGRA8UnormSrgb       TextureFormat = 0x00000018
	TextureFormat_RGB10A2Unorm         TextureFormat = 0x00000019
	TextureFormat_RG11B10Ufloat        TextureFormat = 0x0000001A
	TextureFormat_RGB9E5Ufloat         TextureFormat = 0x0000001B
	TextureFormat_RG32Float            TextureFormat = 0x0000001C
	TextureFormat_RG32Uint             TextureFormat = 0x0000001D
	TextureFormat_RG32Sint             TextureFormat = 0x0000001E
	TextureFormat_RGBA16Uint           TextureFormat = 0x0000001F
	TextureFormat_RGBA16Sint           TextureFormat = 0x00000020
	TextureFormat_RGBA16Float          TextureFormat = 0x00000021
	TextureFormat_RGBA32Float          TextureFormat = 0x00000022
	TextureFormat_RGBA32Uint           TextureFormat = 0x00000023
	TextureFormat_RGBA32Sint           TextureFormat = 0x00000024
	TextureFormat_Stencil8             TextureFormat = 0x00000025
	TextureFormat_Depth16Unorm         TextureFormat = 0x00000026
	TextureFormat_Depth24Plus          TextureFormat = 0x00000027
	TextureFormat_Depth24PlusStencil8  TextureFormat = 0x00000028
	TextureFormat_Depth32Float         TextureFormat = 0x00000029
	TextureFormat_Depth32FloatStencil8 TextureFormat = 0x0000002A
	TextureFormat_BC1RGBAUnorm         TextureFormat = 0x0000002B
	TextureFormat_BC1RGBAUnormSrgb     TextureFormat = 0x0000002C
	TextureFormat_BC2RGBAUnorm         TextureFormat = 0x0000002D
	TextureFormat_BC2RGBAUnormSrgb     TextureFormat = 0x0000002E
	TextureFormat_BC3RGBAUnorm         TextureFormat = 0x0000002F
	TextureFormat_BC3RGBAUnormSrgb     TextureFormat = 0x00000030
	TextureFormat_BC4RUnorm            TextureFormat = 0x00000031
	TextureFormat_BC4RSnorm            TextureFormat = 0x00000032
	TextureFormat_BC5RGUnorm           TextureFormat = 0x00000033
	TextureFormat_BC5RGSnorm           TextureFormat = 0x00000034
	TextureFormat_BC6HRGBUfloat        TextureFormat = 0x00000035
	TextureFormat_BC6HRGBFloat         TextureFormat = 0x00000036
	TextureFormat_BC7RGBAUnorm         TextureFormat = 0x00000037
	TextureFormat_BC7RGBAUnormSrgb     TextureFormat = 0x00000038
	TextureFormat_ETC2RGB8Unorm        TextureFormat = 0x00000039
	TextureFormat_ETC2RGB8UnormSrgb    TextureFormat = 0x0000003A
	TextureFormat_ETC2RGB8A1Unorm      TextureFormat = 0x0000003B
	TextureFormat_ETC2RGB8A1UnormSrgb  TextureFormat = 0x0000003C
	TextureFormat_ETC2RGBA8Unorm       TextureFormat = 0x0000003D
	TextureFormat_ETC2RGBA8UnormSrgb   TextureFormat = 0x0000003E
	TextureFormat_EACR11Unorm          TextureFormat = 0x0000003F
	TextureFormat_EACR11Snorm          TextureFormat = 0x00000040
	TextureFormat_EACRG11Unorm         TextureFormat = 0x00000041
	TextureFormat_EACRG11Snorm         TextureFormat = 0x00000042
	TextureFormat_ASTC4x4Unorm         TextureFormat = 0x00000043
	TextureFormat_ASTC4x4UnormSrgb     TextureFormat = 0x00000044
	TextureFormat_ASTC5x4Unorm         TextureFormat = 0x00000045
	TextureFormat_ASTC5x4UnormSrgb     TextureFormat = 0x00000046
	TextureFormat_ASTC5x5Unorm         TextureFormat = 0x00000047
	TextureFormat_ASTC5x5UnormSrgb     TextureFormat = 0x00000048
	TextureFormat_ASTC6x5Unorm         TextureFormat = 0x00000049
	TextureFormat_ASTC6x5UnormSrgb     TextureFormat = 0x0000004A
	TextureFormat_ASTC6x6Unorm         TextureFormat = 0x0000004B
	TextureFormat_ASTC6x6UnormSrgb     TextureFormat = 0x0000004C
	TextureFormat_ASTC8x5Unorm         TextureFormat = 0x0000004D
	TextureFormat_ASTC8x5UnormSrgb     TextureFormat = 0x0000004E
	TextureFormat_ASTC8x6Unorm         TextureFormat = 0x0000004F
	TextureFormat_ASTC8x6UnormSrgb     TextureFormat = 0x00000050
	TextureFormat_ASTC8x8Unorm         TextureFormat = 0x00000051
	TextureFormat_ASTC8x8UnormSrgb     TextureFormat = 0x00000052
	TextureFormat_ASTC10x5Unorm        TextureFormat = 0x00000053
	TextureFormat_ASTC10x5UnormSrgb    TextureFormat = 0x00000054
	TextureFormat_ASTC10x6Unorm        TextureFormat = 0x00000055
	TextureFormat_ASTC10x6UnormSrgb    TextureFormat = 0x00000056
	TextureFormat_ASTC10x8Unorm        TextureFormat = 0x00000057
	TextureFormat_ASTC10x8UnormSrgb    TextureFormat = 0x00000058
	TextureFormat_ASTC10x10Unorm       TextureFormat = 0x00000059
	TextureFormat_ASTC10x10UnormSrgb   TextureFormat = 0x0000005A
	TextureFormat_ASTC12x10Unorm       TextureFormat = 0x0000005B
	TextureFormat_ASTC12x10UnormSrgb   TextureFormat = 0x0000005C
	TextureFormat_ASTC12x12Unorm       TextureFormat = 0x0000005D
	TextureFormat_ASTC12x12UnormSrgb   TextureFormat = 0x0000005E
)

func (TextureFormat) String

func (v TextureFormat) String() string

type TextureSampleType

type TextureSampleType uint32
const (
	TextureSampleType_Undefined         TextureSampleType = 0x00000000
	TextureSampleType_Float             TextureSampleType = 0x00000001
	TextureSampleType_UnfilterableFloat TextureSampleType = 0x00000002
	TextureSampleType_Depth             TextureSampleType = 0x00000003
	TextureSampleType_Sint              TextureSampleType = 0x00000004
	TextureSampleType_Uint              TextureSampleType = 0x00000005
)

func (TextureSampleType) String

func (v TextureSampleType) String() string

type TextureUsage

type TextureUsage uint32
const (
	TextureUsage_None             TextureUsage = 0x00000000
	TextureUsage_CopySrc          TextureUsage = 0x00000001
	TextureUsage_CopyDst          TextureUsage = 0x00000002
	TextureUsage_TextureBinding   TextureUsage = 0x00000004
	TextureUsage_StorageBinding   TextureUsage = 0x00000008
	TextureUsage_RenderAttachment TextureUsage = 0x00000010
)

func (TextureUsage) String

func (v TextureUsage) String() string

type TextureView

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

func (*TextureView) Release added in v0.16.1

func (p *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 (
	TextureViewDimension_Undefined TextureViewDimension = 0x00000000
	TextureViewDimension_1D        TextureViewDimension = 0x00000001
	TextureViewDimension_2D        TextureViewDimension = 0x00000002
	TextureViewDimension_2DArray   TextureViewDimension = 0x00000003
	TextureViewDimension_Cube      TextureViewDimension = 0x00000004
	TextureViewDimension_CubeArray TextureViewDimension = 0x00000005
	TextureViewDimension_3D        TextureViewDimension = 0x00000006
)

func (TextureViewDimension) String

func (v TextureViewDimension) 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 (
	VertexFormat_Undefined VertexFormat = 0x00000000
	VertexFormat_Uint8x2   VertexFormat = 0x00000001
	VertexFormat_Uint8x4   VertexFormat = 0x00000002
	VertexFormat_Sint8x2   VertexFormat = 0x00000003
	VertexFormat_Sint8x4   VertexFormat = 0x00000004
	VertexFormat_Unorm8x2  VertexFormat = 0x00000005
	VertexFormat_Unorm8x4  VertexFormat = 0x00000006
	VertexFormat_Snorm8x2  VertexFormat = 0x00000007
	VertexFormat_Snorm8x4  VertexFormat = 0x00000008
	VertexFormat_Uint16x2  VertexFormat = 0x00000009
	VertexFormat_Uint16x4  VertexFormat = 0x0000000A
	VertexFormat_Sint16x2  VertexFormat = 0x0000000B
	VertexFormat_Sint16x4  VertexFormat = 0x0000000C
	VertexFormat_Unorm16x2 VertexFormat = 0x0000000D
	VertexFormat_Unorm16x4 VertexFormat = 0x0000000E
	VertexFormat_Snorm16x2 VertexFormat = 0x0000000F
	VertexFormat_Snorm16x4 VertexFormat = 0x00000010
	VertexFormat_Float16x2 VertexFormat = 0x00000011
	VertexFormat_Float16x4 VertexFormat = 0x00000012
	VertexFormat_Float32   VertexFormat = 0x00000013
	VertexFormat_Float32x2 VertexFormat = 0x00000014
	VertexFormat_Float32x3 VertexFormat = 0x00000015
	VertexFormat_Float32x4 VertexFormat = 0x00000016
	VertexFormat_Uint32    VertexFormat = 0x00000017
	VertexFormat_Uint32x2  VertexFormat = 0x00000018
	VertexFormat_Uint32x3  VertexFormat = 0x00000019
	VertexFormat_Uint32x4  VertexFormat = 0x0000001A
	VertexFormat_Sint32    VertexFormat = 0x0000001B
	VertexFormat_Sint32x2  VertexFormat = 0x0000001C
	VertexFormat_Sint32x3  VertexFormat = 0x0000001D
	VertexFormat_Sint32x4  VertexFormat = 0x0000001E
)

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 (
	VertexStepMode_Vertex              VertexStepMode = 0x00000000
	VertexStepMode_Instance            VertexStepMode = 0x00000001
	VertexStepMode_VertexBufferNotUsed VertexStepMode = 0x00000002
)

func (VertexStepMode) String

func (v VertexStepMode) String() string

type WrappedSubmissionIndex

type WrappedSubmissionIndex struct {
	Queue           *Queue
	SubmissionIndex SubmissionIndex
}

Jump to

Keyboard shortcuts

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