Structs
These structs are defined in wgpu.structs.
The structs in wgpu-py are represented as Python dictionaries. Fields that have default values (as indicated below) may be omitted.
- wgpu.structs.BindGroupDescriptor
label :: str = “”
layout ::
GPUBindGroupLayoutentries :: List[
structs.BindGroupEntry]
- wgpu.structs.BindGroupEntry
binding :: int
resource :: Union[
GPUSampler,GPUTextureView, object,structs.BufferBinding]
- wgpu.structs.BindGroupLayoutDescriptor
label :: str = “”
entries :: List[
structs.BindGroupLayoutEntry]
- wgpu.structs.BindGroupLayoutEntry
binding :: int
visibility ::
flags.ShaderStagebuffer ::
structs.BufferBindingLayoutsampler ::
structs.SamplerBindingLayouttexture ::
structs.TextureBindingLayoutstorageTexture ::
structs.StorageTextureBindingLayoutexternalTexture ::
structs.ExternalTextureBindingLayout
- wgpu.structs.BlendComponent
operation ::
enums.BlendOperation= “add”srcFactor ::
enums.BlendFactor= “one”dstFactor ::
enums.BlendFactor= “zero”
- wgpu.structs.BlendState
color ::
structs.BlendComponentalpha ::
structs.BlendComponent
- wgpu.structs.BufferBindingLayout
type ::
enums.BufferBindingType= “uniform”hasDynamicOffset :: bool = false
minBindingSize :: int = 0
- wgpu.structs.BufferDescriptor
label :: str = “”
size :: int
usage ::
flags.BufferUsagemappedAtCreation :: bool = false
- wgpu.structs.CanvasConfiguration
device ::
GPUDeviceformat ::
enums.TextureFormatusage ::
flags.TextureUsage= 0x10viewFormats :: List[
enums.TextureFormat] = []colorSpace :: str = “srgb”
toneMapping ::
structs.CanvasToneMapping= {}alphaMode ::
enums.CanvasAlphaMode= “opaque”
- wgpu.structs.CanvasToneMapping
mode ::
enums.CanvasToneMappingMode= “standard”
- wgpu.structs.Color
r :: float
g :: float
b :: float
a :: float
- wgpu.structs.ColorTargetState
format ::
enums.TextureFormatblend ::
structs.BlendStatewriteMask ::
flags.ColorWrite= 0xF
- wgpu.structs.CommandBufferDescriptor
label :: str = “”
- wgpu.structs.CommandEncoderDescriptor
label :: str = “”
- wgpu.structs.ComputePassDescriptor
label :: str = “”
timestampWrites ::
structs.ComputePassTimestampWrites
- wgpu.structs.ComputePassTimestampWrites
querySet ::
GPUQuerySetbeginningOfPassWriteIndex :: int
endOfPassWriteIndex :: int
- wgpu.structs.ComputePipelineDescriptor
label :: str = “”
layout :: Union[
GPUPipelineLayout,enums.AutoLayoutMode]compute ::
structs.ProgrammableStage
- wgpu.structs.CopyExternalImageDestInfo
texture ::
GPUTexturemipLevel :: int = 0
origin :: Union[List[int],
structs.Origin3D] = {}aspect ::
enums.TextureAspect= “all”colorSpace :: str = “srgb”
premultipliedAlpha :: bool = false
- wgpu.structs.CopyExternalImageSourceInfo
source :: Union[memoryview, object]
origin :: Union[List[int],
structs.Origin2D] = {}flipY :: bool = false
- wgpu.structs.DepthStencilState
format ::
enums.TextureFormatdepthWriteEnabled :: bool
depthCompare ::
enums.CompareFunctionstencilFront ::
structs.StencilFaceState= {}stencilBack ::
structs.StencilFaceState= {}stencilReadMask :: int = 0xFFFFFFFF
stencilWriteMask :: int = 0xFFFFFFFF
depthBias :: int = 0
depthBiasSlopeScale :: float = 0
depthBiasClamp :: float = 0
- wgpu.structs.DeviceDescriptor
label :: str = “”
requiredFeatures :: List[
enums.FeatureName] = []requiredLimits :: Dict[str, Union[None, int]] = {}
defaultQueue ::
structs.QueueDescriptor= {}
- wgpu.structs.Extent3D
width :: int
height :: int = 1
depthOrArrayLayers :: int = 1
- wgpu.structs.ExternalTextureDescriptor
label :: str = “”
source :: Union[memoryview, object]
colorSpace :: str = “srgb”
- wgpu.structs.FragmentState
module ::
GPUShaderModuleentryPoint :: str
constants :: Dict[str, float] = {}
targets :: List[
structs.ColorTargetState]
- wgpu.structs.MultisampleState
count :: int = 1
mask :: int = 0xFFFFFFFF
alphaToCoverageEnabled :: bool = false
- wgpu.structs.Origin2D
x :: int = 0
y :: int = 0
- wgpu.structs.Origin3D
x :: int = 0
y :: int = 0
z :: int = 0
- wgpu.structs.PipelineErrorInit
reason ::
enums.PipelineErrorReason
- wgpu.structs.PipelineLayoutDescriptor
label :: str = “”
bindGroupLayouts :: List[
GPUBindGroupLayout]
- wgpu.structs.PrimitiveState
topology ::
enums.PrimitiveTopology= “triangle-list”stripIndexFormat ::
enums.IndexFormatfrontFace ::
enums.FrontFace= “ccw”cullMode ::
enums.CullMode= “none”unclippedDepth :: bool = false
- wgpu.structs.ProgrammableStage
module ::
GPUShaderModuleentryPoint :: str
constants :: Dict[str, float] = {}
- wgpu.structs.QuerySetDescriptor
label :: str = “”
type ::
enums.QueryTypecount :: int
- wgpu.structs.QueueDescriptor
label :: str = “”
- wgpu.structs.RenderBundleDescriptor
label :: str = “”
- wgpu.structs.RenderBundleEncoderDescriptor
label :: str = “”
colorFormats :: List[
enums.TextureFormat]depthStencilFormat ::
enums.TextureFormatsampleCount :: int = 1
depthReadOnly :: bool = false
stencilReadOnly :: bool = false
- wgpu.structs.RenderPassColorAttachment
view ::
GPUTextureViewdepthSlice :: int
resolveTarget ::
GPUTextureViewclearValue :: Union[List[float],
structs.Color]loadOp ::
enums.LoadOpstoreOp ::
enums.StoreOp
- wgpu.structs.RenderPassDepthStencilAttachment
view ::
GPUTextureViewdepthClearValue :: float
depthLoadOp ::
enums.LoadOpdepthStoreOp ::
enums.StoreOpdepthReadOnly :: bool = false
stencilClearValue :: int = 0
stencilLoadOp ::
enums.LoadOpstencilStoreOp ::
enums.StoreOpstencilReadOnly :: bool = false
- wgpu.structs.RenderPassDescriptor
label :: str = “”
colorAttachments :: List[
structs.RenderPassColorAttachment]depthStencilAttachment ::
structs.RenderPassDepthStencilAttachmentocclusionQuerySet ::
GPUQuerySettimestampWrites ::
structs.RenderPassTimestampWritesmaxDrawCount :: int = 50000000
- wgpu.structs.RenderPassLayout
label :: str = “”
colorFormats :: List[
enums.TextureFormat]depthStencilFormat ::
enums.TextureFormatsampleCount :: int = 1
- wgpu.structs.RenderPassTimestampWrites
querySet ::
GPUQuerySetbeginningOfPassWriteIndex :: int
endOfPassWriteIndex :: int
- wgpu.structs.RenderPipelineDescriptor
label :: str = “”
layout :: Union[
GPUPipelineLayout,enums.AutoLayoutMode]vertex ::
structs.VertexStateprimitive ::
structs.PrimitiveState= {}depthStencil ::
structs.DepthStencilStatemultisample ::
structs.MultisampleState= {}fragment ::
structs.FragmentState
- wgpu.structs.RequestAdapterOptions
featureLevel :: str = “core”
powerPreference ::
enums.PowerPreferenceforceFallbackAdapter :: bool = false
xrCompatible :: bool = false
- wgpu.structs.SamplerBindingLayout
type ::
enums.SamplerBindingType= “filtering”
- wgpu.structs.SamplerDescriptor
label :: str = “”
addressModeU ::
enums.AddressMode= “clamp-to-edge”addressModeV ::
enums.AddressMode= “clamp-to-edge”addressModeW ::
enums.AddressMode= “clamp-to-edge”magFilter ::
enums.FilterMode= “nearest”minFilter ::
enums.FilterMode= “nearest”mipmapFilter ::
enums.MipmapFilterMode= “nearest”lodMinClamp :: float = 0
lodMaxClamp :: float = 32
compare ::
enums.CompareFunctionmaxAnisotropy :: int = 1
- wgpu.structs.ShaderModuleCompilationHint
entryPoint :: str
layout :: Union[
GPUPipelineLayout,enums.AutoLayoutMode]
- wgpu.structs.ShaderModuleDescriptor
label :: str = “”
code :: str
compilationHints :: List[
structs.ShaderModuleCompilationHint] = []
- wgpu.structs.StencilFaceState
compare ::
enums.CompareFunction= “always”failOp ::
enums.StencilOperation= “keep”depthFailOp ::
enums.StencilOperation= “keep”passOp ::
enums.StencilOperation= “keep”
- wgpu.structs.StorageTextureBindingLayout
access ::
enums.StorageTextureAccess= “write-only”format ::
enums.TextureFormatviewDimension ::
enums.TextureViewDimension= “2d”
- wgpu.structs.TexelCopyBufferInfo
offset :: int = 0
bytesPerRow :: int
rowsPerImage :: int
buffer ::
GPUBuffer
- wgpu.structs.TexelCopyBufferLayout
offset :: int = 0
bytesPerRow :: int
rowsPerImage :: int
- wgpu.structs.TexelCopyTextureInfo
texture ::
GPUTexturemipLevel :: int = 0
origin :: Union[List[int],
structs.Origin3D] = {}aspect ::
enums.TextureAspect= “all”
- wgpu.structs.TextureBindingLayout
sampleType ::
enums.TextureSampleType= “float”viewDimension ::
enums.TextureViewDimension= “2d”multisampled :: bool = false
- wgpu.structs.TextureDescriptor
label :: str = “”
size :: Union[List[int],
structs.Extent3D]mipLevelCount :: int = 1
sampleCount :: int = 1
dimension ::
enums.TextureDimension= “2d”format ::
enums.TextureFormatusage ::
flags.TextureUsageviewFormats :: List[
enums.TextureFormat] = []
- wgpu.structs.TextureViewDescriptor
label :: str = “”
format ::
enums.TextureFormatdimension ::
enums.TextureViewDimensionusage ::
flags.TextureUsage= 0aspect ::
enums.TextureAspect= “all”baseMipLevel :: int = 0
mipLevelCount :: int
baseArrayLayer :: int = 0
arrayLayerCount :: int
- wgpu.structs.VertexAttribute
format ::
enums.VertexFormatoffset :: int
shaderLocation :: int
- wgpu.structs.VertexBufferLayout
arrayStride :: int
stepMode ::
enums.VertexStepMode= “vertex”attributes :: List[
structs.VertexAttribute]
- wgpu.structs.VertexState
module ::
GPUShaderModuleentryPoint :: str
constants :: Dict[str, float] = {}
buffers :: List[
structs.VertexBufferLayout] = []