wgpu

package
v0.0.0-...-6fe0358 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WASM_NOT_SUPPORT = errors.New("wasm target is not support yet.")

Functions

This section is empty.

Types

type AdapterDescriptor

type AdapterDescriptor struct {
	PowerPreference PowerPreference
}

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 StringToAdapterType

func StringToAdapterType(str string) AdapterType

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
	AddressMode_Force32      AddressMode = 0x7FFFFFFF
)

func StringToAddressMode

func StringToAddressMode(str string) AddressMode

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 BindGroupDescriptor

type BindGroupDescriptor struct {
	Label  string
	Layout IGPUBindGroupLayout
	// Entries An array of entry objects describing the resources to expose to the shader.
	// There will be one for each corresponding entry described by the GPUBindGroupLayout referenced in layout.
	// Each entry object has the following properties:
	Entries []*GPUBindGroupEntry
}

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
	BlendFactor_Force32           BlendFactor = 0x7FFFFFFF
)

func StringToBlendFactor

func StringToBlendFactor(str string) BlendFactor

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
	BlendOperation_Force32         BlendOperation = 0x7FFFFFFF
)

func StringToBlendOperation

func StringToBlendOperation(str string) BlendOperation

func (BlendOperation) String

func (v BlendOperation) String() string

type BlendState

type BlendState struct {
	Color *BlendComponent
	Alpha *BlendComponent
}

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 StringToBufferBindingType

func StringToBufferBindingType(str string) BufferBindingType

func (BufferBindingType) String

func (v BufferBindingType) String() string

type BufferDescriptor

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

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 StringToBufferMapAsyncStatus

func StringToBufferMapAsyncStatus(str string) BufferMapAsyncStatus

func (BufferMapAsyncStatus) String

func (v BufferMapAsyncStatus) String() string

type BufferMapCallback

type BufferMapCallback func(BufferMapAsyncStatus)

type BufferMapState

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

func StringToBufferMapState

func StringToBufferMapState(str string) BufferMapState

func (BufferMapState) String

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 StringToBufferUsage

func StringToBufferUsage(str string) BufferUsage

func (BufferUsage) String

func (v BufferUsage) String() string

type CanvasDescriptor

type CanvasDescriptor struct {
	Width    int
	Height   int
	Title    string
	ParentId string
	CanvasId 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
	ColorWriteMask_Force32 ColorWriteMask = 0x7FFFFFFF
)

func StringToColorWriteMask

func StringToColorWriteMask(str string) ColorWriteMask

func (ColorWriteMask) String

func (v ColorWriteMask) String() string

type CommandBufferDescriptor

type CommandBufferDescriptor struct {
	Label string
}

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
	CompareFunction_Force32      CompareFunction = 0x7FFFFFFF
)

func StringToCompareFunction

func StringToCompareFunction(str string) CompareFunction

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
	CompilationInfoRequestStatus_Force32    CompilationInfoRequestStatus = 0x7FFFFFFF
)

func StringToCompilationInfoRequestStatus

func StringToCompilationInfoRequestStatus(str string) CompilationInfoRequestStatus

func (CompilationInfoRequestStatus) String

type CompilationMessageType

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

func StringToCompilationMessageType

func StringToCompilationMessageType(str string) CompilationMessageType

func (CompilationMessageType) String

func (v CompilationMessageType) String() string

type CompositeAlphaMode

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

func StringToCompositeAlphaMode

func StringToCompositeAlphaMode(str string) CompositeAlphaMode

func (CompositeAlphaMode) String

func (v CompositeAlphaMode) String() string

type ComputePassDescriptor

type ComputePassDescriptor struct {
	Label string
}

type ComputePassTimestampLocation

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

func StringToComputePassTimestampLocation

func StringToComputePassTimestampLocation(str string) ComputePassTimestampLocation

func (ComputePassTimestampLocation) String

type ComputePipelineDescriptor

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

type ConfigureDescriptor

type ConfigureDescriptor struct {

	// Device The GPUDevice that the rendering information for the context will come from.
	Device IDevice

	// Format The format that textures returned by getCurrentTexture() will have.
	// This can be bgra8unorm, rgba8unorm, or rgba16float.
	// The optimal canvas texture format for the current system can be returned by GPU.getPreferredCanvasFormat().
	// Using this is recommended — if you don't use the preferred format when configuring the canvas context,
	// you may incur additional overhead, such as additional texture copies, depending on the platform.
	Format TextureFormat

	// AlphaMode Optional
	AlphaMode CompositeAlphaMode

	// ViewFormats Optional
	ViewFormats []TextureFormat
}

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
	CreatePipelineAsyncStatus_Force32         CreatePipelineAsyncStatus = 0x7FFFFFFF
)

func StringToCreatePipelineAsyncStatus

func StringToCreatePipelineAsyncStatus(str string) CreatePipelineAsyncStatus

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
	CullMode_Force32 CullMode = 0x7FFFFFFF
)

func StringToCullMode

func StringToCullMode(str string) CullMode

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 DeviceDescriptor

type DeviceDescriptor struct {
	// Label 标记
	Label string
	// RequiredFeatures 需要支持的扩展
	RequiredFeatures []FeatureName
	// RequiredLimits 资源限制
	RequiredLimits     *RequiredLimits
	DeviceLostCallback DeviceLostCallback
	TracePath          string
}

type DeviceLostCallback

type DeviceLostCallback func(reason DeviceLostReason, message string)

type DeviceLostReason

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

func StringToDeviceLostReason

func StringToDeviceLostReason(str string) DeviceLostReason

func (DeviceLostReason) String

func (v DeviceLostReason) String() string

type Dx12Compiler

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

func StringToDx12Compiler

func StringToDx12Compiler(str string) Dx12Compiler

func (Dx12Compiler) String

func (v Dx12Compiler) String() string

type ErrorFilter

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

func StringToErrorFilter

func StringToErrorFilter(str string) ErrorFilter

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
	ErrorType_Force32     ErrorType = 0x7FFFFFFF
)

func StringToErrorType

func StringToErrorType(str string) ErrorType

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
	FilterMode_Force32 FilterMode = 0x7FFFFFFF
)

func StringToFilterMode

func StringToFilterMode(str string) FilterMode

func (FilterMode) String

func (v FilterMode) String() string

type FragmentState

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

type FrontFace

type FrontFace uint32
const (
	FrontFace_CCW     FrontFace = 0x00000000
	FrontFace_CW      FrontFace = 0x00000001
	FrontFace_Force32 FrontFace = 0x7FFFFFFF
)

func StringToFrontFace

func StringToFrontFace(str string) FrontFace

func (FrontFace) String

func (v FrontFace) String() string

type GPUBindGroupEntry

type GPUBindGroupEntry struct {
	// Binding A number representing a unique identifier for this resource binding, which matches the binding value
	// of a corresponding GPUBindGroupLayout entry. In addition, it matches the n index value of the corresponding
	// @binding(n) attribute in the shader (GPUShaderModule) used in the related pipeline.
	Binding uint32
	// Resource 开头三选一
	Buffer      IBuffer
	Offset      uint64
	Size        uint64
	Sampler     IGPUSampler
	TextureView ITextureView
}

type IAdapter

type IAdapter interface {
	IGPUBasic
	// RequestDevice The requestDevice() method of the GPUAdapter interface returns a Promise that fulfills
	// with a GPUDevice object, which is the primary interface for communicating with the GPU.
	RequestDevice(descriptor *DeviceDescriptor) (IDevice, error)
	EnumerateFeatures() []FeatureName
	GetLimits() SupportedLimits
	GetProperties() AdapterProperties
	HasFeature(feature FeatureName) bool
}

type IBridge

type IBridge interface {
	CreateCanvas(descriptor *CanvasDescriptor) (ICanvas, error)
	RequestAnimationFrame(fn func())
	GetGPU() IGPU
}

type IBuffer

type IBuffer interface {
	IGPUBasic
	MapAsync(mode MapMode, offset uint64, size uint64, callback BufferMapCallback) error
	GetMappedRange(offset, size uint) []byte
	Unmap() error
	GetSize() uint64
	GetUsage() BufferUsage
	Release()
}

type ICanvas

type ICanvas interface {
	IGPUBasic
	// Configure The configure() method of the GPUCanvasContext interface configures the context to use for
	// rendering with a given GPUDevice. When called the canvas will initially be cleared to transparent black.
	Configure(descriptor *ConfigureDescriptor) error
	// UnConfigure The unconfigure() method of the GPUCanvasContext interface removes any previously-set context
	// configuration, and destroys any textures returned via getCurrentTexture() while the canvas context was configured.
	UnConfigure()
	// GetCurrentTexture The getCurrentTexture() method of the GPUCanvasContext interface returns the next GPUTexture
	// to be composited to the document by the canvas context.
	GetCurrentTexture() ITexture
}

ICanvas 暂定等同于 GPUCanvasContext

type ICommandBuffer

type ICommandBuffer interface {
	IGPUBasic
}

type ICommandEncoder

type ICommandEncoder interface {
	IGPUBasic
	BeginComputePass(descriptor *ComputePassDescriptor) IComputePassEncoder
	BeginRenderPass(descriptor *RenderPassDescriptor) IRenderPassEncoder
	ClearBuffer(buffer IBuffer, offset uint64, size uint64)
	CopyBufferToBuffer(source IBuffer, sourceOffset uint64, destination IBuffer, destinatonOffset uint64, size uint64)
	CopyBufferToTexture(source *ImageCopyBuffer, destination *ImageCopyTexture, copySize *Extent3D)
	CopyTextureToBuffer(source *ImageCopyTexture, destination *ImageCopyBuffer, copySize *Extent3D)
	CopyTextureToTexture(source *ImageCopyTexture, destination *ImageCopyTexture, copySize *Extent3D)
	Finish(descriptor *CommandBufferDescriptor) ICommandBuffer
	InsertDebugMarker(markerLabel string)
	PopDebugGroup()
	PushDebugGroup(groupLabel string)
}

type IComputePassEncoder

type IComputePassEncoder interface {
	DispatchWorkgroups(workgroupCountX, workgroupCountY, workgroupCountZ uint32)
	DispatchWorkgroupsIndirect(indirectBuffer IBuffer, indirectOffset uint64)
	End()
	InsertDebugMarker(markerLabel string)
	PopDebugGroup()
	PushDebugGroup(groupLabel string)
	SetBindGroup(groupIndex uint32, group IGPUBindGroup, dynamicOffsets []uint32)
	SetPipeline(pipeline IComputePipeline)
}

type IComputePipeline

type IComputePipeline interface {
	IGPUBasic
	GetBindGroupLayout(groupIndex uint32) IGPUBindGroupLayout
}

type IDevice

type IDevice interface {
	IGPUBasic
	// GetQueue A GPUQueue object instance.
	GetQueue() IQueue
	// CreateBindGroup The createBindGroup() method of the GPUDevice interface creates a GPUBindGroup based
	// on a GPUBindGroupLayout that defines a set of resources to be bound together in a group and how those
	// resources are used in shader stages.
	CreateBindGroup(descriptor *BindGroupDescriptor) (IGPUBindGroup, error)
	// CreateBindGroupLayout The createBindGroupLayout() method of the GPUDevice interface creates a GPUBindGroupLayout
	// that defines the structure and purpose of related GPU resources such as buffers that will be used in a pipeline,
	// and is used as a template when creating GPUBindGroups.
	CreateBindGroupLayout(descriptor *BindGroupLayoutDescriptor) (IGPUBindGroupLayout, error)
	// CreateBuffer The createBuffer() method of the GPUDevice interface creates a GPUBuffer in which to store
	// raw data to use in GPU operations.
	CreateBuffer(descriptor *BufferDescriptor) (IBuffer, error)
	// CreateCommandEncoder The createCommandEncoder() method of the GPUDevice interface creates a GPUCommandEncoder,
	// used to encode commands to be issued to the GPU.
	CreateCommandEncoder(descriptor *CommandEncoderDescriptor) (ICommandEncoder, error)
	CreateShaderModule(descriptor *ShaderModuleDescriptor) (IShaderModule, error)
	CreateTexture(descriptor *TextureDescriptor) (ITexture, error)
	CreateRenderPipeline(descriptor *RenderPipelineDescriptor) (IRenderPipeLine, error)
	CreateComputePipeline(descriptor *ComputePipelineDescriptor) (IComputePipeline, error)
	CreatePipelineLayout(descriptor *PipelineLayoutDescriptor) (IPipelineLayout, error)
	CreateRenderBundleEncoder(descriptor *RenderBundleEncoderDescriptor) (IRenderBundleEncoder, error)
	Poll(wait bool, wrappedSubmissionIndex *WrappedSubmissionIndex) (queueEmpty bool)
	CreateQuerySet(descriptor *QuerySetDescriptor) (*IQuerySet, error)
}

type IGPU

type IGPU interface {
	// GetPreferredCanvasFormat The getPreferredCanvasFormat() method of the GPU interface returns the optimal canvas
	// texture format for displaying 8-bit depth, standard dynamic range content on the current system.
	// This is commonly used to provide a GPUCanvasContext.configure() call with the optimal format value for the
	// current system. This is recommended — if you don't use the preferred format when configuring the canvas context,
	// you may incur additional overhead, such as additional texture copies, depending on the platform.
	GetPreferredCanvasFormat() TextureFormat
	// RequestAdapter The requestAdapter() method of the GPU interface returns a Promise that fulfills with a GPUAdapter
	// object instance. From this you can request a GPUDevice, adapter info, features, and limits.
	// Note that the user agent chooses whether to return an adapter. If so, it chooses according to the provided
	// options. If no options are provided, the device will provide access to the default adapter, which is usually
	// good enough for most purposes.
	RequestAdapter(descriptor *AdapterDescriptor) (IAdapter, error)
}

IGPU navigator.gpu The GPU interface of the WebGPU API is the starting point for using WebGPU. It can be used to return a GPUAdapter from which you can request devices, configure features and limits, and more. The GPU object for the current context is accessed via the Navigator.gpu or WorkerNavigator.gpu properties.

type IGPUBasic

type IGPUBasic interface {
	Release()
	// Ref 获取引用对象, 可能为空
	Ref() any
}

type IGPUBindGroup

type IGPUBindGroup interface {
	IGPUBasic
}

type IGPUBindGroupLayout

type IGPUBindGroupLayout interface {
	IGPUBasic
}

type IGPUSampler

type IGPUSampler interface {
	IGPUBasic
}

type IPipelineLayout

type IPipelineLayout interface {
	IGPUBasic
}

type IQuerySet

type IQuerySet interface {
	IGPUBasic
}

type IQueue

type IQueue interface {
	WriteTexture(destination *ImageCopyTexture, data []byte, dataLayout *TextureDataLayout, writeSize *Extent3D) error
	WriteBuffer(buffer IBuffer, bufferOffset uint64, data []byte) error
	Submit(commands ...ICommandBuffer) (submissionIndex SubmissionIndex)
	OnSubmittedWorkDone(callback QueueWorkDoneCallback)
}

type IRenderBundle

type IRenderBundle interface {
	IGPUBasic
}

type IRenderBundleEncoder

type IRenderBundleEncoder interface {
	IGPUBasic
	Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)
	DrawIndexed(indexCount, instanceCount, firstIndex, baseVertex, firstInstance uint32)
	DrawIndexedIndirect(indirectBuffer IBuffer, indirectOffset uint64)
	DrawIndirect(indirectBuffer IBuffer, indirectOffset uint64)
	Finish(descriptor *RenderBundleDescriptor) IRenderBundle
	InsertDebugMarker(markerLabel string)
	PopDebugGroup()
	PushDebugGroup(groupLabel string)
	SetBindGroup(groupIndex uint32, group IGPUBindGroup, dynamicOffsets []uint32)
	SetIndexBuffer(buffer IBuffer, format IndexFormat, offset, size uint64)
	SetPipeline(pipeline IRenderPipeLine)
	SetVertexBuffer(slot uint32, buffer IBuffer, offset, size uint64)
}

type IRenderPassEncoder

type IRenderPassEncoder interface {
	IGPUBasic
	Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)
	DrawIndexed(indexCount, instanceCount, firstIndex uint32, baseVertex int32, firstInstance uint32)
	DrawIndexedIndirect(indirectBuffer IBuffer, indirectOffset uint64)
	DrawIndirect(indirectBuffer IBuffer, indirectOffset uint64)
	End()
	ExecuteBundles(bundles ...IRenderBundle)
	InsertDebugMarker(markerLabel string)
	PopDebugGroup()
	PushDebugGroup(groupLabel string)
	SetBindGroup(groupIndex uint32, group IGPUBindGroup, dynamicOffsets []uint32)
	SetBlendConstant(color *Color)
	SetIndexBuffer(buffer IBuffer, format IndexFormat, offset, size uint64)
	SetPipeline(pipeline IRenderPipeLine)
	SetScissorRect(x, y, width, height uint32)
	SetStencilReference(reference uint32)
	SetVertexBuffer(slot uint32, buffer IBuffer, offset, size uint64)
	SetViewport(x, y, width, height, minDepth, maxDepth float32)
	SetPushConstants(stages ShaderStage, offset uint32, data []byte)
	MultiDrawIndirect(encoder IRenderPassEncoder, buffer IBuffer, offset uint64, count uint32)
	MultiDrawIndexedIndirect(encoder IRenderPassEncoder, buffer IBuffer, offset uint64, count uint32)
	MultiDrawIndirectCount(encoder IRenderPassEncoder, buffer IBuffer, offset uint64, countBuffer IBuffer, countBufferOffset uint64, maxCount uint32)
	MultiDrawIndexedIndirectCount(encoder IRenderPassEncoder, buffer IBuffer, offset uint64, countBuffer IBuffer, countBufferOffset uint64, maxCount uint32)
}

type IRenderPipeLine

type IRenderPipeLine interface {
	IGPUBasic
	GetBindGroupLayout(groupIndex uint32) IGPUBindGroupLayout
}

type IShaderModule

type IShaderModule interface {
	IGPUBasic
}

type ITexture

type ITexture interface {
	IGPUBasic
	CreateView(descriptor *TextureViewDescriptor) ITextureView
}

type ITextureView

type ITextureView interface {
	IGPUBasic
}

type ImageCopyBuffer

type ImageCopyBuffer struct {
	Layout *TextureDataLayout
	Buffer IBuffer
}

type ImageCopyTexture

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

type IndexFormat

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

func StringToIndexFormat

func StringToIndexFormat(str string) IndexFormat

func (IndexFormat) String

func (v IndexFormat) String() string

type InstanceBackend

type InstanceBackend uint32
const (
	InstanceBackend_None    InstanceBackend = 0x00000000
	InstanceBackend_Force32 InstanceBackend = 0x7FFFFFFF
)

func StringToInstanceBackend

func StringToInstanceBackend(str string) InstanceBackend

func (InstanceBackend) String

func (v InstanceBackend) 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

	MaxPushConstantSize uint32
}

type LoadOp

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

func StringToLoadOp

func StringToLoadOp(str string) LoadOp

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
	LogLevel_Force32 LogLevel = 0x7FFFFFFF
)

func StringToLogLevel

func StringToLogLevel(str string) LogLevel

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 StringToMapMode

func StringToMapMode(str string) MapMode

func (MapMode) String

func (v MapMode) String() string

type MipmapFilterMode

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

func StringToMipmapFilterMode

func StringToMipmapFilterMode(str string) MipmapFilterMode

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 PipelineLayoutDescriptor

type PipelineLayoutDescriptor struct {
	Label              string
	BindGroupLayouts   []IGPUBindGroupLayout
	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
	PipelineStatisticName_Force32                   PipelineStatisticName = 0x7FFFFFFF
)

func StringToPipelineStatisticName

func StringToPipelineStatisticName(str string) PipelineStatisticName

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
	PowerPreference_Force32         PowerPreference = 0x7FFFFFFF
)

func StringToPowerPreference

func StringToPowerPreference(str string) PowerPreference

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
	PresentMode_Force32   PresentMode = 0x7FFFFFFF
)

func StringToPresentMode

func StringToPresentMode(str string) PresentMode

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
	PrimitiveTopology_Force32       PrimitiveTopology = 0x7FFFFFFF
)

func StringToPrimitiveTopology

func StringToPrimitiveTopology(str string) PrimitiveTopology

func (PrimitiveTopology) String

func (v PrimitiveTopology) String() string

type ProgrammableStageDescriptor

type ProgrammableStageDescriptor struct {
	Module     IShaderModule
	EntryPoint string
}

type PushConstantRange

type PushConstantRange struct {
	Stages ShaderStage
	Start  uint32
	End    uint32
}

type QuerySetDescriptor

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
	QueryType_Force32            QueryType = 0x7FFFFFFF
)

func StringToQueryType

func StringToQueryType(str string) QueryType

func (QueryType) String

func (v QueryType) String() string

type QueueWorkDoneCallback

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 StringToQueueWorkDoneStatus

func StringToQueueWorkDoneStatus(str string) QueueWorkDoneStatus

func (QueueWorkDoneStatus) String

func (v QueueWorkDoneStatus) String() string

type RenderBundleDescriptor

type RenderBundleDescriptor struct {
	Label string
}

type RenderBundleEncoderDescriptor

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

type RenderPassColorAttachment

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

type RenderPassDepthStencilAttachment

type RenderPassDepthStencilAttachment struct {
	View              ITextureView
	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 RenderPassTimestampLocation

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

func StringToRenderPassTimestampLocation

func StringToRenderPassTimestampLocation(str string) RenderPassTimestampLocation

func (RenderPassTimestampLocation) String

type RenderPipelineDescriptor

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

type RequestAdapterStatus

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

func StringToRequestAdapterStatus

func StringToRequestAdapterStatus(str string) RequestAdapterStatus

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
	RequestDeviceStatus_Force32 RequestDeviceStatus = 0x7FFFFFFF
)

func StringToRequestDeviceStatus

func StringToRequestDeviceStatus(str string) RequestDeviceStatus

func (RequestDeviceStatus) String

func (v RequestDeviceStatus) String() string

type RequiredLimits

type RequiredLimits struct {
	Limits Limits
}

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 StringToSamplerBindingType

func StringToSamplerBindingType(str string) SamplerBindingType

func (SamplerBindingType) String

func (v SamplerBindingType) String() string

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 StringToShaderStage

func StringToShaderStage(str string) ShaderStage

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
	StencilOperation_Force32        StencilOperation = 0x7FFFFFFF
)

func StringToStencilOperation

func StringToStencilOperation(str string) StencilOperation

func (StencilOperation) String

func (v StencilOperation) String() string

type StorageTextureAccess

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

func StringToStorageTextureAccess

func StringToStorageTextureAccess(str string) StorageTextureAccess

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
	StoreOp_Force32   StoreOp = 0x7FFFFFFF
)

func StringToStoreOp

func StringToStoreOp(str string) StoreOp

func (StoreOp) String

func (v StoreOp) String() string

type SubmissionIndex

type SubmissionIndex uint64

type SupportedLimits

type SupportedLimits struct {
	Limits Limits
}

type TextureAspect

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

func StringToTextureAspect

func StringToTextureAspect(str string) TextureAspect

func (TextureAspect) String

func (v TextureAspect) String() string

type TextureBindingLayout

type TextureBindingLayout struct {
	SampleType    TextureSampleType
	ViewDimension TextureViewDimension
	Multisampled  bool
}

type TextureComponentType

type TextureComponentType uint32
const (
	TextureComponentType_Float           TextureComponentType = 0x00000000
	TextureComponentType_Sint            TextureComponentType = 0x00000001
	TextureComponentType_Uint            TextureComponentType = 0x00000002
	TextureComponentType_DepthComparison TextureComponentType = 0x00000003
	TextureComponentType_Force32         TextureComponentType = 0x7FFFFFFF
)

func StringToTextureComponentType

func StringToTextureComponentType(str string) TextureComponentType

func (TextureComponentType) String

func (v TextureComponentType) String() string

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
	TextureDimension_Force32 TextureDimension = 0x7FFFFFFF
)

func StringToTextureDimension

func StringToTextureDimension(str string) TextureDimension

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 StringToTextureSampleType

func StringToTextureSampleType(str string) TextureSampleType

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
	TextureUsage_Force32          TextureUsage = 0x7FFFFFFF
)

func StringToTextureUsage

func StringToTextureUsage(str string) TextureUsage

func (TextureUsage) String

func (v TextureUsage) String() string

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 StringToTextureViewDimension

func StringToTextureViewDimension(str string) TextureViewDimension

func (TextureViewDimension) String

func (v TextureViewDimension) 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
	VertexFormat_Force32   VertexFormat = 0x7FFFFFFF
)

func StringToVertexFormat

func StringToVertexFormat(str string) VertexFormat

func (VertexFormat) String

func (v VertexFormat) String() string

type VertexState

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

type VertexStepMode

type VertexStepMode uint32
const (
	VertexStepMode_Vertex              VertexStepMode = 0x00000000
	VertexStepMode_Instance            VertexStepMode = 0x00000001
	VertexStepMode_VertexBufferNotUsed VertexStepMode = 0x00000002
	VertexStepMode_Force32             VertexStepMode = 0x7FFFFFFF
)

func StringToVertexStepMode

func StringToVertexStepMode(str string) VertexStepMode

func (VertexStepMode) String

func (v VertexStepMode) String() string

type WrappedSubmissionIndex

type WrappedSubmissionIndex struct {
	Queue           *IQueue
	SubmissionIndex SubmissionIndex
}

Jump to

Keyboard shortcuts

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