{"modulePath":"github.com/go-webgpu/webgpu","version":"v0.5.5","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package wgpu\n\nPackage wgpu provides Zero-CGO WebGPU bindings for Go.\n\nThis package wraps wgpu-native (Rust WebGPU implementation) using pure Go FFI via syscall on Windows and dlopen on Unix. No CGO is required.\n\n### Thread Safety {#hdr-Thread_Safety}\n\nThe following operations are safe for concurrent use:\n\n  - [Init](#Init) and library initialization (protected by sync.Once)\n  - [Instance.RequestAdapter](#Instance.RequestAdapter) (callback registry protected by mutex)\n  - [Adapter.RequestDevice](#Adapter.RequestDevice) (callback registry protected by mutex)\n  - [Device.PopErrorScopeAsync](#Device.PopErrorScopeAsync) (callback registry protected by mutex)\n  - [Buffer.MapAsync](#Buffer.MapAsync) (callback registry protected by mutex)\n  - Read-only queries: [Adapter.Limits](#Adapter.Limits), [Adapter.Info](#Adapter.Info), [Adapter.Features](#Adapter.Features), [Adapter.HasFeature](#Adapter.HasFeature)\n  - Read-only queries: [Device.Limits](#Device.Limits), [Device.Features](#Device.Features), [Device.HasFeature](#Device.HasFeature)\n  - Read-only queries: [Surface.GetCapabilities](#Surface.GetCapabilities)\n\nThe following operations are NOT safe for concurrent use on the same object:\n\n  - [Surface.Configure](#Surface.Configure), [Surface.GetCurrentTexture](#Surface.GetCurrentTexture), [Surface.Present](#Surface.Present) (must be called from a single goroutine, typically the render loop)\n  - [CommandEncoder](#CommandEncoder) methods (single encoder should not be shared between goroutines)\n  - [RenderPassEncoder](#RenderPassEncoder) and [ComputePassEncoder](#ComputePassEncoder) methods\n  - [Buffer.GetMappedRange](#Buffer.GetMappedRange) and [Buffer.Unmap](#Buffer.Unmap)\n\nGeneral rule: different GPU objects can be used from different goroutines, but a single object should not be accessed concurrently. This matches the WebGPU spec threading model.\n\n### Quick Start {#hdr-Quick_Start}\n\n\t// Initialize the library\n\tif err := wgpu.Init(); err != nil {\n\t    log.Fatal(err)\n\t}\n\n\t// Create instance\n\tinstance, err := wgpu.CreateInstance(nil)\n\tif err != nil {\n\t    log.Fatal(err)\n\t}\n\tdefer instance.Release()\n\n\t// Request adapter (GPU)\n\tadapter, err := instance.RequestAdapter(nil)\n\tif err != nil {\n\t    log.Fatal(err)\n\t}\n\tdefer adapter.Release()\n\n\t// Request device\n\tdevice, err := adapter.RequestDevice(nil)\n\tif err != nil {\n\t    log.Fatal(err)\n\t}\n\tdefer device.Release()\n\n### Core Objects {#hdr-Core_Objects}\n\nThe WebGPU API is structured around several core object types:\n\n  - [Instance](#Instance): Entry point to the WebGPU API\n  - [Adapter](#Adapter): Represents a physical GPU\n  - [Device](#Device): Logical device for creating resources\n  - [Queue](#Queue): Command submission queue\n  - [Buffer](#Buffer): GPU memory buffer\n  - [Texture](#Texture): GPU texture resource\n  - [Sampler](#Sampler): Texture sampling configuration\n  - [ShaderModule](#ShaderModule): Compiled shader code (WGSL)\n  - [BindGroup](#BindGroup): Resource bindings for shaders\n  - [RenderPipeline](#RenderPipeline): Configuration for rendering\n  - [ComputePipeline](#ComputePipeline): Configuration for compute\n  - [CommandEncoder](#CommandEncoder): Records GPU commands\n  - [RenderPassEncoder](#RenderPassEncoder): Records render commands\n  - [ComputePassEncoder](#ComputePassEncoder): Records compute commands\n\n### Resource Management {#hdr-Resource_Management}\n\nAll WebGPU objects must be released when no longer needed:\n\n\tbuffer := device.CreateBuffer(\u0026wgpu.BufferDescriptor{...})\n\tdefer buffer.Release()\n\n### Render Pipeline {#hdr-Render_Pipeline}\n\nA typical render pipeline setup:\n\n\t// Create shader module\n\tshader := device.CreateShaderModuleWGSL(shaderCode)\n\tdefer shader.Release()\n\n\t// Create render pipeline\n\tpipeline := device.CreateRenderPipeline(\u0026wgpu.RenderPipelineDescriptor{\n\t    Vertex: wgpu.VertexState{\n\t        Module:     vsModule,\n\t        EntryPoint: \"main\",\n\t        Buffers:    []wgpu.VertexBufferLayout{vertexBufferLayout},\n\t    },\n\t    Fragment: \u0026wgpu.FragmentState{\n\t        Module:     fsModule,\n\t        EntryPoint: \"main\",\n\t        Targets:    []wgpu.ColorTargetState{{Format: format, WriteMask: gputypes.ColorWriteMaskAll}},\n\t    },\n\t    // ... other configuration\n\t})\n\tdefer pipeline.Release()\n\n### Compute Pipeline {#hdr-Compute_Pipeline}\n\nFor GPU compute operations:\n\n\tpipeline := device.CreateComputePipelineSimple(nil, shader, \"main\")\n\tdefer pipeline.Release()\n\n\t// Dispatch compute work\n\tcomputePass := encoder.BeginComputePass(nil)\n\tcomputePass.SetPipeline(pipeline)\n\tcomputePass.SetBindGroup(0, bindGroup, nil)\n\tcomputePass.DispatchWorkgroups(workgroupCount, 1, 1)\n\tcomputePass.End()\n\n### Indirect Drawing {#hdr-Indirect_Drawing}\n\nGPU-driven rendering using indirect buffers:\n\n\t// Create indirect buffer with draw args\n\targs := wgpu.DrawIndirectArgs{\n\t    VertexCount:   3,\n\t    InstanceCount: 100,\n\t}\n\t// Write to buffer...\n\n\t// Draw using GPU-specified parameters\n\trenderPass.DrawIndirect(indirectBuffer, 0)\n\n### RenderBundle {#hdr-RenderBundle}\n\nPre-record render commands for efficient replay:\n\n\tbundleEncoder := device.CreateRenderBundleEncoderSimple(\n\t    []gputypes.TextureFormat{surfaceFormat},\n\t    gputypes.TextureFormatUndefined,\n\t    1,\n\t)\n\tbundleEncoder.SetPipeline(pipeline)\n\tbundleEncoder.Draw(3, 1, 0, 0)\n\tbundle := bundleEncoder.Finish(nil)\n\tdefer bundle.Release()\n\n\t// Later, in a render pass:\n\trenderPass.ExecuteBundles([]*wgpu.RenderBundle{bundle})\n\n### Platform Support {#hdr-Platform_Support}\n\nSupported platforms:\n\n  - Windows (x64) - uses syscall.LazyDLL\n  - Linux (x64, arm64) - uses goffi/dlopen\n  - macOS (x64, arm64) - uses goffi/dlopen\n\n### Dependencies {#hdr-Dependencies}\n\nThis package requires wgpu-native library:\n\n  - Windows: wgpu\\_native.dll\n  - Linux: libwgpu\\_native.so\n  - macOS: libwgpu\\_native.dylib\n\nDownload from: [https://github.com/gfx-rs/wgpu-native/releases](https://github.com/gfx-rs/wgpu-native/releases)\n\n## Constants\n\n```go\nconst (\n\tBufferUsageNone         = gputypes.BufferUsageNone\n\tBufferUsageMapRead      = gputypes.BufferUsageMapRead\n\tBufferUsageMapWrite     = gputypes.BufferUsageMapWrite\n\tBufferUsageCopySrc      = gputypes.BufferUsageCopySrc\n\tBufferUsageCopyDst      = gputypes.BufferUsageCopyDst\n\tBufferUsageIndex        = gputypes.BufferUsageIndex\n\tBufferUsageVertex       = gputypes.BufferUsageVertex\n\tBufferUsageUniform      = gputypes.BufferUsageUniform\n\tBufferUsageStorage      = gputypes.BufferUsageStorage\n\tBufferUsageIndirect     = gputypes.BufferUsageIndirect\n\tBufferUsageQueryResolve = gputypes.BufferUsageQueryResolve\n)\n```\n\n```go\nconst (\n\tTextureUsageNone             = gputypes.TextureUsageNone\n\tTextureUsageCopySrc          = gputypes.TextureUsageCopySrc\n\tTextureUsageCopyDst          = gputypes.TextureUsageCopyDst\n\tTextureUsageTextureBinding   = gputypes.TextureUsageTextureBinding\n\tTextureUsageStorageBinding   = gputypes.TextureUsageStorageBinding\n\tTextureUsageRenderAttachment = gputypes.TextureUsageRenderAttachment\n)\n```\n\n```go\nconst (\n\tTextureFormatUndefined           = gputypes.TextureFormatUndefined\n\tTextureFormatR8Unorm             = gputypes.TextureFormatR8Unorm\n\tTextureFormatR8Snorm             = gputypes.TextureFormatR8Snorm\n\tTextureFormatR8Uint              = gputypes.TextureFormatR8Uint\n\tTextureFormatR8Sint              = gputypes.TextureFormatR8Sint\n\tTextureFormatR16Uint             = gputypes.TextureFormatR16Uint\n\tTextureFormatR16Sint             = gputypes.TextureFormatR16Sint\n\tTextureFormatR16Float            = gputypes.TextureFormatR16Float\n\tTextureFormatRG8Unorm            = gputypes.TextureFormatRG8Unorm\n\tTextureFormatRG8Snorm            = gputypes.TextureFormatRG8Snorm\n\tTextureFormatRG8Uint             = gputypes.TextureFormatRG8Uint\n\tTextureFormatRG8Sint             = gputypes.TextureFormatRG8Sint\n\tTextureFormatR32Float            = gputypes.TextureFormatR32Float\n\tTextureFormatR32Uint             = gputypes.TextureFormatR32Uint\n\tTextureFormatR32Sint             = gputypes.TextureFormatR32Sint\n\tTextureFormatRG16Uint            = gputypes.TextureFormatRG16Uint\n\tTextureFormatRG16Sint            = gputypes.TextureFormatRG16Sint\n\tTextureFormatRG16Float           = gputypes.TextureFormatRG16Float\n\tTextureFormatRGBA8Unorm          = gputypes.TextureFormatRGBA8Unorm\n\tTextureFormatRGBA8UnormSrgb      = gputypes.TextureFormatRGBA8UnormSrgb\n\tTextureFormatRGBA8Snorm          = gputypes.TextureFormatRGBA8Snorm\n\tTextureFormatRGBA8Uint           = gputypes.TextureFormatRGBA8Uint\n\tTextureFormatRGBA8Sint           = gputypes.TextureFormatRGBA8Sint\n\tTextureFormatBGRA8Unorm          = gputypes.TextureFormatBGRA8Unorm\n\tTextureFormatBGRA8UnormSrgb      = gputypes.TextureFormatBGRA8UnormSrgb\n\tTextureFormatRGB10A2Uint         = gputypes.TextureFormatRGB10A2Uint\n\tTextureFormatRGB10A2Unorm        = gputypes.TextureFormatRGB10A2Unorm\n\tTextureFormatRG11B10Ufloat       = gputypes.TextureFormatRG11B10Ufloat\n\tTextureFormatRG32Float           = gputypes.TextureFormatRG32Float\n\tTextureFormatRG32Uint            = gputypes.TextureFormatRG32Uint\n\tTextureFormatRG32Sint            = gputypes.TextureFormatRG32Sint\n\tTextureFormatRGBA16Uint          = gputypes.TextureFormatRGBA16Uint\n\tTextureFormatRGBA16Sint          = gputypes.TextureFormatRGBA16Sint\n\tTextureFormatRGBA16Float         = gputypes.TextureFormatRGBA16Float\n\tTextureFormatRGBA32Float         = gputypes.TextureFormatRGBA32Float\n\tTextureFormatRGBA32Uint          = gputypes.TextureFormatRGBA32Uint\n\tTextureFormatRGBA32Sint          = gputypes.TextureFormatRGBA32Sint\n\tTextureFormatDepth32Float        = gputypes.TextureFormatDepth32Float\n\tTextureFormatDepth24Plus         = gputypes.TextureFormatDepth24Plus\n\tTextureFormatDepth24PlusStencil8 = gputypes.TextureFormatDepth24PlusStencil8\n\tTextureFormatDepth16Unorm        = gputypes.TextureFormatDepth16Unorm\n)\n```\n\n```go\nconst (\n\tTextureDimension1D = gputypes.TextureDimension1D\n\tTextureDimension2D = gputypes.TextureDimension2D\n\tTextureDimension3D = gputypes.TextureDimension3D\n)\n```\n\n```go\nconst (\n\tShaderStageNone     = gputypes.ShaderStageNone\n\tShaderStageVertex   = gputypes.ShaderStageVertex\n\tShaderStageFragment = gputypes.ShaderStageFragment\n\tShaderStageCompute  = gputypes.ShaderStageCompute\n)\n```\n\n```go\nconst (\n\tPrimitiveTopologyPointList     = gputypes.PrimitiveTopologyPointList\n\tPrimitiveTopologyLineList      = gputypes.PrimitiveTopologyLineList\n\tPrimitiveTopologyLineStrip     = gputypes.PrimitiveTopologyLineStrip\n\tPrimitiveTopologyTriangleList  = gputypes.PrimitiveTopologyTriangleList\n\tPrimitiveTopologyTriangleStrip = gputypes.PrimitiveTopologyTriangleStrip\n)\n```\n\n```go\nconst (\n\tFrontFaceCCW = gputypes.FrontFaceCCW\n\tFrontFaceCW  = gputypes.FrontFaceCW\n)\n```\n\n```go\nconst (\n\tCullModeNone  = gputypes.CullModeNone\n\tCullModeFront = gputypes.CullModeFront\n\tCullModeBack  = gputypes.CullModeBack\n)\n```\n\n```go\nconst (\n\tIndexFormatUint16 = gputypes.IndexFormatUint16\n\tIndexFormatUint32 = gputypes.IndexFormatUint32\n)\n```\n\n```go\nconst (\n\tLoadOpLoad  = gputypes.LoadOpLoad\n\tLoadOpClear = gputypes.LoadOpClear\n)\n```\n\n```go\nconst (\n\tStoreOpStore   = gputypes.StoreOpStore\n\tStoreOpDiscard = gputypes.StoreOpDiscard\n)\n```\n\n```go\nconst (\n\tFilterModeNearest = gputypes.FilterModeNearest\n\tFilterModeLinear  = gputypes.FilterModeLinear\n)\n```\n\n```go\nconst (\n\tAddressModeRepeat       = gputypes.AddressModeRepeat\n\tAddressModeMirrorRepeat = gputypes.AddressModeMirrorRepeat\n\tAddressModeClampToEdge  = gputypes.AddressModeClampToEdge\n)\n```\n\n```go\nconst (\n\tCompareFunctionUndefined    = gputypes.CompareFunctionUndefined\n\tCompareFunctionNever        = gputypes.CompareFunctionNever\n\tCompareFunctionLess         = gputypes.CompareFunctionLess\n\tCompareFunctionEqual        = gputypes.CompareFunctionEqual\n\tCompareFunctionLessEqual    = gputypes.CompareFunctionLessEqual\n\tCompareFunctionGreater      = gputypes.CompareFunctionGreater\n\tCompareFunctionNotEqual     = gputypes.CompareFunctionNotEqual\n\tCompareFunctionGreaterEqual = gputypes.CompareFunctionGreaterEqual\n\tCompareFunctionAlways       = gputypes.CompareFunctionAlways\n)\n```\n\n```go\nconst (\n\tPresentModeImmediate   = gputypes.PresentModeImmediate\n\tPresentModeMailbox     = gputypes.PresentModeMailbox\n\tPresentModeFifo        = gputypes.PresentModeFifo\n\tPresentModeFifoRelaxed = gputypes.PresentModeFifoRelaxed\n)\n```\n\n```go\nconst (\n\tCompositeAlphaModeAuto            = gputypes.CompositeAlphaModeAuto\n\tCompositeAlphaModeOpaque          = gputypes.CompositeAlphaModeOpaque\n\tCompositeAlphaModePremultiplied   = gputypes.CompositeAlphaModePremultiplied\n\tCompositeAlphaModeUnpremultiplied = gputypes.CompositeAlphaModeUnpremultiplied\n\tCompositeAlphaModeInherit         = gputypes.CompositeAlphaModeInherit\n)\n```\n\n```go\nconst (\n\tPowerPreferenceNone            = gputypes.PowerPreferenceNone\n\tPowerPreferenceLowPower        = gputypes.PowerPreferenceLowPower\n\tPowerPreferenceHighPerformance = gputypes.PowerPreferenceHighPerformance\n)\n```\n\n```go\nconst (\n\tColorWriteMaskNone  = gputypes.ColorWriteMaskNone\n\tColorWriteMaskRed   = gputypes.ColorWriteMaskRed\n\tColorWriteMaskGreen = gputypes.ColorWriteMaskGreen\n\tColorWriteMaskBlue  = gputypes.ColorWriteMaskBlue\n\tColorWriteMaskAlpha = gputypes.ColorWriteMaskAlpha\n\tColorWriteMaskAll   = gputypes.ColorWriteMaskAll\n)\n```\n\n```go\nconst (\n\tVertexFormatUint8x2   = gputypes.VertexFormatUint8x2\n\tVertexFormatUint8x4   = gputypes.VertexFormatUint8x4\n\tVertexFormatSint8x2   = gputypes.VertexFormatSint8x2\n\tVertexFormatSint8x4   = gputypes.VertexFormatSint8x4\n\tVertexFormatFloat32   = gputypes.VertexFormatFloat32\n\tVertexFormatFloat32x2 = gputypes.VertexFormatFloat32x2\n\tVertexFormatFloat32x3 = gputypes.VertexFormatFloat32x3\n\tVertexFormatFloat32x4 = gputypes.VertexFormatFloat32x4\n\tVertexFormatUint32    = gputypes.VertexFormatUint32\n\tVertexFormatUint32x2  = gputypes.VertexFormatUint32x2\n\tVertexFormatUint32x3  = gputypes.VertexFormatUint32x3\n\tVertexFormatUint32x4  = gputypes.VertexFormatUint32x4\n\tVertexFormatSint32    = gputypes.VertexFormatSint32\n\tVertexFormatSint32x2  = gputypes.VertexFormatSint32x2\n\tVertexFormatSint32x3  = gputypes.VertexFormatSint32x3\n\tVertexFormatSint32x4  = gputypes.VertexFormatSint32x4\n)\n```\n\n```go\nconst (\n\tVertexStepModeVertex   = gputypes.VertexStepModeVertex\n\tVertexStepModeInstance = gputypes.VertexStepModeInstance\n)\n```\n\n```go\nconst (\n\tBufferBindingTypeUndefined       = gputypes.BufferBindingTypeUndefined\n\tBufferBindingTypeUniform         = gputypes.BufferBindingTypeUniform\n\tBufferBindingTypeStorage         = gputypes.BufferBindingTypeStorage\n\tBufferBindingTypeReadOnlyStorage = gputypes.BufferBindingTypeReadOnlyStorage\n)\n```\n\n```go\nconst (\n\tSamplerBindingTypeUndefined    = gputypes.SamplerBindingTypeUndefined\n\tSamplerBindingTypeFiltering    = gputypes.SamplerBindingTypeFiltering\n\tSamplerBindingTypeNonFiltering = gputypes.SamplerBindingTypeNonFiltering\n\tSamplerBindingTypeComparison   = gputypes.SamplerBindingTypeComparison\n)\n```\n\n```go\nconst (\n\tTextureSampleTypeUndefined         = gputypes.TextureSampleTypeUndefined\n\tTextureSampleTypeFloat             = gputypes.TextureSampleTypeFloat\n\tTextureSampleTypeUnfilterableFloat = gputypes.TextureSampleTypeUnfilterableFloat\n\tTextureSampleTypeDepth             = gputypes.TextureSampleTypeDepth\n\tTextureSampleTypeSint              = gputypes.TextureSampleTypeSint\n\tTextureSampleTypeUint              = gputypes.TextureSampleTypeUint\n)\n```\n\n```go\nconst (\n\tTextureViewDimensionUndefined = gputypes.TextureViewDimensionUndefined\n\tTextureViewDimension1D        = gputypes.TextureViewDimension1D\n\tTextureViewDimension2D        = gputypes.TextureViewDimension2D\n\tTextureViewDimension2DArray   = gputypes.TextureViewDimension2DArray\n\tTextureViewDimensionCube      = gputypes.TextureViewDimensionCube\n\tTextureViewDimensionCubeArray = gputypes.TextureViewDimensionCubeArray\n\tTextureViewDimension3D        = gputypes.TextureViewDimension3D\n)\n```\n\n```go\nconst (\n\tStencilOperationUndefined      = gputypes.StencilOperationUndefined\n\tStencilOperationKeep           = gputypes.StencilOperationKeep\n\tStencilOperationZero           = gputypes.StencilOperationZero\n\tStencilOperationReplace        = gputypes.StencilOperationReplace\n\tStencilOperationInvert         = gputypes.StencilOperationInvert\n\tStencilOperationIncrementClamp = gputypes.StencilOperationIncrementClamp\n\tStencilOperationDecrementClamp = gputypes.StencilOperationDecrementClamp\n\tStencilOperationIncrementWrap  = gputypes.StencilOperationIncrementWrap\n\tStencilOperationDecrementWrap  = gputypes.StencilOperationDecrementWrap\n)\n```\n\n```go\nconst DepthSliceUndefined uint32 = 0xFFFFFFFF\n```\nDepthSliceUndefined is used for 2D textures in color attachments.\n\n```go\nconst TimestampLocationUndefined uint32 = 0xFFFFFFFF\n```\nTimestampLocationUndefined indicates no timestamp write at this location.\n\n## Variables\n\n```go\nvar (\n\tErrSurfaceNeedsReconfigure = \u0026WGPUError{Op: \"Surface.GetCurrentTexture\", Message: \"surface needs reconfigure\"}\n\tErrSurfaceLost             = \u0026WGPUError{Op: \"Surface.GetCurrentTexture\", Message: \"surface lost\"}\n\tErrSurfaceTimeout          = \u0026WGPUError{Op: \"Surface.GetCurrentTexture\", Message: \"surface texture timeout\"}\n\t// ErrSurfaceOccluded is returned on macOS Metal when the window is minimized or fully covered.\n\t// Applications should skip rendering for the current frame and try again when unoccluded.\n\t// New in wgpu-native v29.\n\tErrSurfaceOccluded = \u0026WGPUError{Op: \"Surface.GetCurrentTexture\", Message: \"surface occluded (window minimized or covered)\"}\n\t// ErrSurfaceOutOfMemory is kept for backward compatibility.\n\t// Deprecated: In v29 this is reported as generic Error status.\n\tErrSurfaceOutOfMemory = \u0026WGPUError{Op: \"Surface.GetCurrentTexture\", Message: \"out of memory\"}\n\t// ErrSurfaceDeviceLost is kept for backward compatibility.\n\t// Deprecated: In v29 this is reported as generic Error status.\n\tErrSurfaceDeviceLost = \u0026WGPUError{Op: \"Surface.GetCurrentTexture\", Message: \"device lost\"}\n)\n```\nError values for surface operations. These are sentinel errors for programmatic error handling via errors.Is().\n\n```go\nvar (\n\t// ErrValidation matches any WebGPU validation error.\n\tErrValidation = \u0026WGPUError{Type: ErrorTypeValidation}\n\t// ErrOutOfMemory matches any WebGPU out-of-memory error.\n\tErrOutOfMemory = \u0026WGPUError{Type: ErrorTypeOutOfMemory}\n\t// ErrInternal matches any WebGPU internal error.\n\tErrInternal = \u0026WGPUError{Type: ErrorTypeInternal}\n\t// ErrDeviceLost matches device lost errors.\n\tErrDeviceLost = \u0026WGPUError{Type: ErrorTypeUnknown, Message: \"device lost\"}\n)\n```\nSentinel errors for programmatic error handling via errors.Is().\n\nUsage:\n\n\tif errors.Is(err, wgpu.ErrValidation) {\n\t    // handle validation error\n\t}\n\n```go\nvar ErrLibraryNotLoaded = errors.New(\"wgpu: native library not loaded or failed to initialize\")\n```\nErrLibraryNotLoaded is returned when wgpu-native library is not loaded or failed to initialize.\n\n## Functions\n\n```go\nfunc DebugMode() bool\n```\nDebugMode returns whether debug mode is currently enabled.\n\n```go\nfunc Init() error\n```\nInit initializes the wgpu library. Called automatically on first use. Can be called explicitly to check for initialization errors early.\n\nThe library is located using the following strategy (first match wins):\n\n 1. WGPU\\_NATIVE\\_PATH environment variable (explicit full path)\n 2. ./lib/\\\u003cname\u003e — default location installed by cmd/setup\n 3. ./\\\u003cname\u003e — current directory\n 4. OS default search (PATH on Windows, LD\\_LIBRARY\\_PATH/DYLD\\_LIBRARY\\_PATH on Unix)\n\n```go\nfunc ResetLeakTracker()\n```\nResetLeakTracker clears the resource tracker. Useful for test cleanup.\n\n```go\nfunc SetDebugMode(enabled bool)\n```\nSetDebugMode enables or disables resource tracking. When enabled, all GPU resource allocations and releases are tracked, and ReportLeaks() can be used to find unreleased resources. Should be called before any GPU operations.\n\n## Types\n\n```go\ntype Adapter struct {\n\t// contains filtered or unexported fields\n}\n```\nAdapter represents a physical GPU and its capabilities. Obtained via [Instance.RequestAdapter](#Instance.RequestAdapter), release with [Adapter.Release](#Adapter.Release).\n\n```go\nfunc (a *Adapter) EnumerateFeatures() []FeatureName\n```\nEnumerateFeatures is a deprecated alias for Features. Deprecated: Use Features instead. This method was renamed in wgpu-native v29.\n\n```go\nfunc (a *Adapter) Features() []FeatureName\n```\nFeatures retrieves all features supported by this adapter. v29: Uses single-call wgpuAdapterGetFeatures with SupportedFeatures struct (replaces two-call EnumerateFeatures). The returned slice is copied from C memory; the underlying C allocation is freed automatically.\n\n```go\nfunc (a *Adapter) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (a *Adapter) HasFeature(feature FeatureName) bool\n```\nHasFeature checks if the adapter supports a specific feature.\n\n```go\nfunc (a *Adapter) Info() (*AdapterInfoGo, error)\n```\nInfo retrieves information about this adapter. The returned AdapterInfoGo contains Go strings copied from C memory. Returns nil if the adapter is nil or if the operation fails.\n\n```go\nfunc (a *Adapter) Limits() Limits\n```\nLimits returns the resource limits of this adapter.\n\nLimits are cached at adapter creation time and returned by value. No FFI call is made. Returns zero-value Limits if the adapter is nil. This matches the gogpu/wgpu API signature for cross-project compatibility.\n\n```go\nfunc (a *Adapter) Release()\n```\nRelease releases the adapter resources.\n\n```go\nfunc (a *Adapter) RequestDevice(options *DeviceDescriptor) (*Device, error)\n```\nRequestDevice requests a GPU device from the adapter. This is a synchronous wrapper that blocks until the device is available.\n\n```go\ntype AdapterInfo struct {\n\tNextInChain     uintptr // *ChainedStruct (was *ChainedStructOut in v27)\n\tVendor          StringView\n\tArchitecture    StringView\n\tDevice          StringView\n\tDescription     StringView\n\tBackendType     BackendType\n\tAdapterType     AdapterType\n\tVendorID        uint32\n\tDeviceID        uint32\n\tSubgroupMinSize uint32 // NEW in v29\n\tSubgroupMaxSize uint32 // NEW in v29\n}\n```\nAdapterInfo contains information about the adapter. v29: NextInChain type changed from \\*ChainedStructOut to \\*ChainedStruct. v29: SubgroupMinSize and SubgroupMaxSize fields added.\n\n```go\ntype AdapterInfoGo struct {\n\tVendor       string\n\tArchitecture string\n\tDevice       string\n\tDescription  string\n\tBackendType  BackendType\n\tAdapterType  AdapterType\n\tVendorID     uint32\n\tDeviceID     uint32\n}\n```\nAdapterInfoGo is the Go-friendly version of AdapterInfo with actual strings.\n\n```go\ntype AdapterType uint32\n```\nAdapterType describes the type of GPU adapter.\n\n```go\nconst (\n\t// AdapterTypeDiscreteGPU indicates a dedicated/discrete GPU (best performance).\n\tAdapterTypeDiscreteGPU AdapterType = 0x00000001\n\t// AdapterTypeIntegratedGPU indicates an integrated GPU (shared with CPU).\n\tAdapterTypeIntegratedGPU AdapterType = 0x00000002\n\t// AdapterTypeCPU indicates a software/CPU-based renderer.\n\tAdapterTypeCPU AdapterType = 0x00000003\n\t// AdapterTypeUnknown indicates the adapter type could not be determined.\n\tAdapterTypeUnknown AdapterType = 0x00000004\n)\n```\n\n```go\ntype AddressMode = gputypes.AddressMode\n```\n\n```go\ntype BackendType uint32\n```\nBackendType describes the graphics backend being used.\n\n```go\nconst (\n\t// BackendTypeUndefined indicates no backend is specified.\n\tBackendTypeUndefined BackendType = 0x00000000\n\t// BackendTypeNull indicates a null/mock backend (for testing).\n\tBackendTypeNull BackendType = 0x00000001\n\t// BackendTypeWebGPU indicates the native WebGPU backend.\n\tBackendTypeWebGPU BackendType = 0x00000002\n\t// BackendTypeD3D11 indicates the Direct3D 11 backend (Windows).\n\tBackendTypeD3D11 BackendType = 0x00000003\n\t// BackendTypeD3D12 indicates the Direct3D 12 backend (Windows).\n\tBackendTypeD3D12 BackendType = 0x00000004\n\t// BackendTypeMetal indicates the Metal backend (macOS/iOS).\n\tBackendTypeMetal BackendType = 0x00000005\n\t// BackendTypeVulkan indicates the Vulkan backend (cross-platform).\n\tBackendTypeVulkan BackendType = 0x00000006\n\t// BackendTypeOpenGL indicates the OpenGL backend.\n\tBackendTypeOpenGL BackendType = 0x00000007\n\t// BackendTypeOpenGLES indicates the OpenGL ES backend (mobile/embedded).\n\tBackendTypeOpenGLES BackendType = 0x00000008\n)\n```\n\n```go\ntype BindGroup struct {\n\t// contains filtered or unexported fields\n}\n```\nBindGroup binds actual GPU resources (buffers, textures, samplers) to shader slots. Create with [Device.CreateBindGroup](#Device.CreateBindGroup), release with [BindGroup.Release](#BindGroup.Release).\n\n```go\nfunc (bg *BindGroup) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (bg *BindGroup) Release()\n```\nRelease releases the bind group.\n\n```go\ntype BindGroupDescriptor struct {\n\tLabel   string\n\tLayout  *BindGroupLayout\n\tEntries []BindGroupEntry\n}\n```\nBindGroupDescriptor describes a bind group.\n\n```go\ntype BindGroupDescriptorGo = BindGroupDescriptor\n```\nBindGroupDescriptorGo is kept for backward compatibility. Deprecated: Use BindGroupDescriptor directly (now Go-idiomatic).\n\n```go\ntype BindGroupEntry struct {\n\tBinding     uint32\n\tBuffer      *Buffer      // For buffer bindings (nil if not used)\n\tOffset      uint64       // Buffer offset (ignored for non-buffer bindings)\n\tSize        uint64       // Buffer binding size; 0 = whole buffer\n\tSampler     *Sampler     // For sampler bindings (nil if not used)\n\tTextureView *TextureView // For texture view bindings (nil if not used)\n}\n```\nBindGroupEntry describes a single binding in a bind group. Exactly one of Buffer, Sampler, or TextureView must be non-nil.\n\n```go\nfunc BufferBindingEntry(binding uint32, buffer *Buffer, offset, size uint64) BindGroupEntry\n```\nBufferBindingEntry creates a BindGroupEntry for a buffer.\n\n```go\nfunc SamplerBindingEntry(binding uint32, sampler *Sampler) BindGroupEntry\n```\nSamplerBindingEntry creates a BindGroupEntry for a sampler.\n\n```go\nfunc TextureBindingEntry(binding uint32, textureView *TextureView) BindGroupEntry\n```\nTextureBindingEntry creates a BindGroupEntry for a texture view.\n\n```go\ntype BindGroupEntryGo = BindGroupEntry\n```\nBindGroupEntryGo is kept for backward compatibility. Deprecated: Use BindGroupEntry directly (now Go-idiomatic).\n\n```go\ntype BindGroupLayout struct {\n\t// contains filtered or unexported fields\n}\n```\nBindGroupLayout defines the layout of resource bindings for a shader stage. Create with [Device.CreateBindGroupLayout](#Device.CreateBindGroupLayout), release with [BindGroupLayout.Release](#BindGroupLayout.Release).\n\n```go\nfunc (bgl *BindGroupLayout) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (bgl *BindGroupLayout) Release()\n```\nRelease releases the bind group layout.\n\n```go\ntype BindGroupLayoutDescriptor struct {\n\tLabel   string\n\tEntries []BindGroupLayoutEntry\n}\n```\nBindGroupLayoutDescriptor describes a bind group layout.\n\n```go\ntype BindGroupLayoutDescriptorGo = BindGroupLayoutDescriptor\n```\nBindGroupLayoutDescriptorGo is kept for backward compatibility. Deprecated: Use BindGroupLayoutDescriptor directly (now Go-idiomatic).\n\n```go\ntype BindGroupLayoutEntry struct {\n\t// Binding is the binding number (must match @binding in shader).\n\tBinding uint32\n\t// Visibility specifies which shader stages can access this binding.\n\tVisibility gputypes.ShaderStage\n\t// Buffer describes a buffer binding (nil if not a buffer binding).\n\tBuffer *BufferBindingLayout\n\t// Sampler describes a sampler binding (nil if not a sampler binding).\n\tSampler *SamplerBindingLayout\n\t// Texture describes a texture binding (nil if not a texture binding).\n\tTexture *TextureBindingLayout\n\t// StorageTexture describes a storage texture binding (nil if not a storage texture binding).\n\tStorageTexture *StorageTextureBindingLayout\n}\n```\nBindGroupLayoutEntry describes a single binding in a bind group layout.\n\nExactly one of Buffer, Sampler, Texture, or StorageTexture must be non-nil. This matches the gogpu/wgpu API for cross-project compatibility.\n\n```go\ntype BlendComponent struct {\n\tOperation gputypes.BlendOperation\n\tSrcFactor gputypes.BlendFactor\n\tDstFactor gputypes.BlendFactor\n}\n```\nBlendComponent describes blend state for a color component.\n\n```go\ntype BlendFactor = gputypes.BlendFactor\n```\nBlend types.\n\n```go\ntype BlendOperation = gputypes.BlendOperation\n```\n\n```go\ntype BlendState struct {\n\tColor BlendComponent\n\tAlpha BlendComponent\n}\n```\nBlendState describes how colors are blended.\n\n```go\ntype Bool uint32\n```\nBool is a WebGPU boolean (uint32).\n\n```go\nconst (\n\t// False is the WebGPU boolean false value (0).\n\tFalse Bool = 0\n\t// True is the WebGPU boolean true value (1).\n\tTrue Bool = 1\n)\n```\n\n```go\ntype Buffer struct {\n\t// contains filtered or unexported fields\n}\n```\nBuffer represents a block of GPU-accessible memory. Create with [Device.CreateBuffer](#Device.CreateBuffer), release with [Buffer.Release](#Buffer.Release).\n\n```go\nfunc (b *Buffer) Destroy()\n```\nDestroy destroys the buffer, making it invalid.\n\n```go\nfunc (b *Buffer) GetMappedRange(offset, size uint64) unsafe.Pointer\n```\nGetMappedRange returns a pointer to the mapped buffer data. The buffer must be mapped (either via MapAsync or MappedAtCreation). offset and size specify the range to access. Returns nil if the buffer is not mapped or the range is invalid.\n\n```go\nfunc (b *Buffer) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (b *Buffer) Map(ctx context.Context, mode MapMode, offset, size uint64) error\n```\nMap blocks until a CPU-visible mapping is established for the given byte range, or until ctx is canceled.\n\nThe buffer must have been created with BufferUsageMapRead or BufferUsageMapWrite matching mode. offset must be a multiple of 8 and size must be a multiple of 4 (WebGPU MAP\\_ALIGNMENT).\n\nAfter Map succeeds, call MappedRange to obtain a byte view and Unmap when finished:\n\n\tif err := buf.Map(ctx, wgpu.MapModeRead, 0, size); err != nil {\n\t    return err\n\t}\n\tdefer buf.Unmap()\n\trng, _ := buf.MappedRange(0, size)\n\tdata := rng.Bytes()\n\nMatches gogpu/wgpu Buffer.Map(ctx, mode, offset, size) error.\n\n```go\nfunc (b *Buffer) MapAsync(mode MapMode, offset, size uint64) (*MapPending, error)\n```\nMapAsync initiates an asynchronous buffer map without blocking. Returns a \\*MapPending that resolves once the GPU completes the operation.\n\nThe caller must periodically drive Device.Poll(false) so the mapping resolves. For a blocking variant use [Buffer.Map](#Buffer.Map).\n\nMatches gogpu/wgpu Buffer.MapAsync(mode, offset, size) (\\*MapPending, error).\n\n```go\nfunc (b *Buffer) MapAsyncBlocking(device *Device, mode MapMode, offset, size uint64) error\n```\nMapAsyncBlocking maps a buffer for reading or writing, blocking until complete. Deprecated: Use [Buffer.Map](#Buffer.Map) for blocking mapping or [Buffer.MapAsync](#Buffer.MapAsync) for non-blocking. This method is retained for backward compatibility.\n\n```go\nfunc (b *Buffer) MapState() BufferMapState\n```\nMapState returns the current mapping state of this buffer.\n\n```go\nfunc (b *Buffer) MappedRange(offset, size uint64) (*MappedRange, error)\n```\nMappedRange returns a safe view over the mapped region \\[offset, offset+size).\n\nThe buffer must be in the Mapped state ([Buffer.Map](#Buffer.Map) or [Buffer.MapAsync](#Buffer.MapAsync) resolved to success). The returned MappedRange.Bytes() slice is invalidated by [Buffer.Unmap](#Buffer.Unmap).\n\nMatches gogpu/wgpu Buffer.MappedRange(offset, size) (\\*MappedRange, error).\n\n```go\nfunc (b *Buffer) Release()\n```\nRelease releases the buffer reference.\n\n```go\nfunc (b *Buffer) Size() uint64\n```\nSize returns the size of the buffer in bytes.\n\n```go\nfunc (b *Buffer) Unmap() error\n```\nUnmap unmaps the buffer, making the mapped memory inaccessible. For buffers created with MappedAtCreation, this commits the data to the GPU. Returns nil on success. Matches gogpu/wgpu Buffer.Unmap() error signature.\n\n```go\nfunc (b *Buffer) Usage() gputypes.BufferUsage\n```\nUsage returns the usage flags of this buffer.\n\n```go\ntype BufferBindingLayout = gputypes.BufferBindingLayout\n```\nBufferBindingLayout describes buffer binding properties.\n\nThis type matches gputypes.BufferBindingLayout for cross-project compatibility. Used as a pointer field in BindGroupLayoutEntry; nil means \"not a buffer binding\".\n\n```go\ntype BufferBindingType = gputypes.BufferBindingType\n```\nBinding layout types.\n\n```go\ntype BufferDescriptor struct {\n\tLabel            string               // Buffer label for debugging\n\tUsage            gputypes.BufferUsage // How the buffer will be used\n\tSize             uint64               // Size in bytes\n\tMappedAtCreation bool                 // If true, buffer is mapped when created\n}\n```\nBufferDescriptor describes a GPU buffer to create.\n\n```go\ntype BufferMapCallbackInfo struct {\n\tNextInChain uintptr // *ChainedStruct\n\tMode        CallbackMode\n\tCallback    uintptr // Function pointer\n\tUserdata1   uintptr\n\tUserdata2   uintptr\n}\n```\nBufferMapCallbackInfo holds callback configuration for MapAsync.\n\n```go\ntype BufferMapState uint32\n```\nBufferMapState describes the mapping state of a buffer.\n\n```go\nconst (\n\t// BufferMapStateUnmapped indicates the buffer is not mapped.\n\tBufferMapStateUnmapped BufferMapState = 0x00000001\n\t// BufferMapStatePending indicates a map operation is in progress.\n\tBufferMapStatePending BufferMapState = 0x00000002\n\t// BufferMapStateMapped indicates the buffer is currently mapped and accessible.\n\tBufferMapStateMapped BufferMapState = 0x00000003\n)\n```\n\n```go\ntype BufferTextureCopy struct {\n\t// BufferLayout describes the memory layout of the buffer data.\n\tBufferLayout ImageDataLayout\n\t// TextureBase describes the texture subresource and origin.\n\tTextureBase ImageCopyTexture\n\t// Size is the extent of the copy operation.\n\tSize gputypes.Extent3D\n}\n```\nBufferTextureCopy defines a buffer-texture copy region. Matches gogpu/wgpu BufferTextureCopy.\n\n```go\ntype BufferUsage = gputypes.BufferUsage\n```\nBuffer types.\n\n```go\ntype CallbackMode uint32\n```\nCallbackMode controls how callbacks are fired.\n\n```go\nconst (\n\t// CallbackModeWaitAnyOnly fires callbacks only during WaitAny calls.\n\tCallbackModeWaitAnyOnly CallbackMode = 0x00000001\n\t// CallbackModeAllowProcessEvents fires callbacks during ProcessEvents calls.\n\tCallbackModeAllowProcessEvents CallbackMode = 0x00000002\n\t// CallbackModeAllowSpontaneous allows callbacks to fire at any time.\n\tCallbackModeAllowSpontaneous CallbackMode = 0x00000003\n)\n```\n\n```go\ntype ChainedStruct struct {\n\tNext  uintptr // *ChainedStruct\n\tSType uint32\n}\n```\nChainedStruct is used for struct chaining (both input and output). In v29 ChainedStructOut was unified with ChainedStruct — use ChainedStruct everywhere.\n\n```go\ntype ChainedStructOut = ChainedStruct\n```\nChainedStructOut is kept for backward compatibility. Deprecated: Use ChainedStruct. In v29 there is no separate ChainedStructOut in C header.\n\n```go\ntype Color struct {\n\tR, G, B, A float64\n}\n```\nColor represents RGBA color with double precision.\n\n```go\ntype ColorTargetState struct {\n\tFormat    gputypes.TextureFormat\n\tBlend     *BlendState // nil for no blending\n\tWriteMask gputypes.ColorWriteMask\n}\n```\nColorTargetState describes a render target in a render pipeline.\n\n```go\ntype ColorWriteMask = gputypes.ColorWriteMask\n```\n\n```go\ntype CommandBuffer struct {\n\t// contains filtered or unexported fields\n}\n```\nCommandBuffer holds encoded GPU commands ready for submission via [Queue.Submit](#Queue.Submit). Obtained from [CommandEncoder.Finish](#CommandEncoder.Finish), release with [CommandBuffer.Release](#CommandBuffer.Release).\n\n```go\nfunc (cb *CommandBuffer) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (cb *CommandBuffer) Release()\n```\nRelease releases the command buffer.\n\n```go\ntype CommandBufferDescriptor struct {\n\tNextInChain uintptr // *ChainedStruct\n\tLabel       StringView\n}\n```\nCommandBufferDescriptor describes a command buffer.\n\n```go\ntype CommandEncoder struct {\n\t// contains filtered or unexported fields\n}\n```\nCommandEncoder records GPU commands into a [CommandBuffer](#CommandBuffer). Create with [Device.CreateCommandEncoder](#Device.CreateCommandEncoder), finalize with [CommandEncoder.Finish](#CommandEncoder.Finish).\n\n```go\nfunc (enc *CommandEncoder) BeginComputePass(desc *ComputePassDescriptor) (*ComputePassEncoder, error)\n```\nBeginComputePass begins a compute pass. Returns an error if the FFI call fails or the encoder is nil.\n\n```go\nfunc (enc *CommandEncoder) BeginRenderPass(desc *RenderPassDescriptor) (*RenderPassEncoder, error)\n```\nBeginRenderPass begins a render pass. Returns an error if the FFI call fails, encoder is nil, or desc has no color attachments.\n\n```go\nfunc (enc *CommandEncoder) ClearBuffer(buffer *Buffer, offset, size uint64)\n```\nClearBuffer clears a region of a buffer to zeros. size = 0 means clear from offset to end of buffer.\n\n```go\nfunc (enc *CommandEncoder) CopyBufferToBuffer(src *Buffer, srcOffset uint64, dst *Buffer, dstOffset uint64, size uint64)\n```\nCopyBufferToBuffer copies data between buffers.\n\n```go\nfunc (enc *CommandEncoder) CopyBufferToTexture(source *TexelCopyBufferInfo, destination *TexelCopyTextureInfo, copySize *gputypes.Extent3D)\n```\nCopyBufferToTexture copies data from a buffer to a texture using low-level wire types. Errors are reported via Device error scopes, not as return values.\n\n```go\nfunc (enc *CommandEncoder) CopyTextureToBuffer(src *Texture, dst *Buffer, regions []BufferTextureCopy)\n```\nCopyTextureToBuffer copies data from a texture to a buffer. Accepts gogpu/wgpu-compatible types: src \\*Texture, dst \\*Buffer, regions \\[]BufferTextureCopy. Each region specifies the buffer layout, texture subresource origin, and copy extent. Errors are reported via Device error scopes, not as return values.\n\n```go\nfunc (enc *CommandEncoder) CopyTextureToBufferRaw(source *TexelCopyTextureInfo, destination *TexelCopyBufferInfo, copySize *gputypes.Extent3D)\n```\nCopyTextureToBufferRaw copies data from a texture to a buffer using low-level wire types. Prefer \\[CopyTextureToBuffer] for new code.\n\n```go\nfunc (enc *CommandEncoder) CopyTextureToTexture(src, dst *Texture, regions []TextureCopy)\n```\nCopyTextureToTexture copies data from one texture to another. Accepts gogpu/wgpu-compatible types: src \\*Texture, dst \\*Texture, regions \\[]TextureCopy. Each region specifies the source and destination subresource origins and copy extent. Errors are reported via Device error scopes, not as return values.\n\n```go\nfunc (enc *CommandEncoder) CopyTextureToTextureRaw(source *TexelCopyTextureInfo, destination *TexelCopyTextureInfo, copySize *gputypes.Extent3D)\n```\nCopyTextureToTextureRaw copies data from one texture to another using low-level wire types. Prefer \\[CopyTextureToTexture] for new code.\n\n```go\nfunc (enc *CommandEncoder) Finish(desc ...*CommandBufferDescriptor) (*CommandBuffer, error)\n```\nFinish finishes recording and returns a command buffer. The optional desc argument allows setting a label; pass nothing for defaults. This variadic signature matches the gogpu/wgpu API for compatibility. Returns an error if the FFI call fails or the encoder is nil.\n\n```go\nfunc (enc *CommandEncoder) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (enc *CommandEncoder) InsertDebugMarker(markerLabel string)\n```\nInsertDebugMarker inserts a single debug marker label. This is useful for GPU debugging tools to identify specific command points.\n\n```go\nfunc (enc *CommandEncoder) PopDebugGroup()\n```\nPopDebugGroup ends the current debug group. Must match a preceding PushDebugGroup call.\n\n```go\nfunc (enc *CommandEncoder) PushDebugGroup(groupLabel string)\n```\nPushDebugGroup begins a labeled debug group. Use PopDebugGroup to end the group. Groups can be nested.\n\n```go\nfunc (enc *CommandEncoder) Release()\n```\nRelease releases the command encoder.\n\n```go\nfunc (enc *CommandEncoder) ResolveQuerySet(querySet *QuerySet, firstQuery, queryCount uint32, destination *Buffer, destinationOffset uint64)\n```\nResolveQuerySet resolves query results to a buffer. The buffer must have BufferUsageQueryResolve usage.\n\n```go\nfunc (enc *CommandEncoder) WriteTimestamp(querySet *QuerySet, queryIndex uint32)\n```\nWriteTimestamp writes a timestamp to a query. Note: This is a wgpu-native extension. Prefer pass-level timestamps via RenderPassTimestampWrites or ComputePassTimestampWrites when possible.\n\n```go\ntype CommandEncoderDescriptor struct {\n\tLabel string\n}\n```\nCommandEncoderDescriptor describes a command encoder to create.\n\n```go\ntype CommandEncoderDescriptorGo = CommandEncoderDescriptor\n```\nCommandEncoderDescriptorGo is kept for backward compatibility. Deprecated: Use CommandEncoderDescriptor directly (now Go-idiomatic).\n\n```go\ntype CompareFunction = gputypes.CompareFunction\n```\nDepth/stencil types.\n\n```go\ntype ComponentSwizzle uint32\n```\nComponentSwizzle describes texture component swizzle mapping. New in v29.\n\n```go\nconst (\n\t// ComponentSwizzleUndefined indicates no value is passed.\n\tComponentSwizzleUndefined ComponentSwizzle = 0x00000000\n\t// ComponentSwizzleZero forces the component value to 0.\n\tComponentSwizzleZero ComponentSwizzle = 0x00000001\n\t// ComponentSwizzleOne forces the component value to 1.\n\tComponentSwizzleOne ComponentSwizzle = 0x00000002\n\t// ComponentSwizzleR takes from the red channel.\n\tComponentSwizzleR ComponentSwizzle = 0x00000003\n\t// ComponentSwizzleG takes from the green channel.\n\tComponentSwizzleG ComponentSwizzle = 0x00000004\n\t// ComponentSwizzleB takes from the blue channel.\n\tComponentSwizzleB ComponentSwizzle = 0x00000005\n\t// ComponentSwizzleA takes from the alpha channel.\n\tComponentSwizzleA ComponentSwizzle = 0x00000006\n)\n```\n\n```go\ntype CompositeAlphaMode = gputypes.CompositeAlphaMode\n```\n\n```go\ntype ComputePassDescriptor struct {\n\tLabel           string\n\tTimestampWrites *PassTimestampWrites // optional; use PassTimestampWrites (was ComputePassTimestampWrites)\n}\n```\nComputePassDescriptor describes a compute pass (user-facing API).\n\n```go\ntype ComputePassEncoder struct {\n\t// contains filtered or unexported fields\n}\n```\nComputePassEncoder records dispatch commands within a compute pass. Begin with [CommandEncoder.BeginComputePass](#CommandEncoder.BeginComputePass), end with [ComputePassEncoder.End](#ComputePassEncoder.End).\n\n```go\nfunc (cpe *ComputePassEncoder) DispatchWorkgroups(x, y, z uint32)\n```\nDispatchWorkgroups dispatches compute work.\n\n```go\nfunc (cpe *ComputePassEncoder) DispatchWorkgroupsIndirect(indirectBuffer *Buffer, indirectOffset uint64)\n```\nDispatchWorkgroupsIndirect dispatches compute work using parameters from a GPU buffer. indirectBuffer must contain a DispatchIndirectArgs structure:\n\n  - workgroupCountX (uint32)\n  - workgroupCountY (uint32)\n  - workgroupCountZ (uint32)\n\n```go\nfunc (cpe *ComputePassEncoder) End()\n```\nEnd ends the compute pass.\n\n```go\nfunc (cpe *ComputePassEncoder) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (cpe *ComputePassEncoder) Release()\n```\nRelease releases the compute pass encoder.\n\n```go\nfunc (cpe *ComputePassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)\n```\nSetBindGroup sets a bind group.\n\n```go\nfunc (cpe *ComputePassEncoder) SetPipeline(pipeline *ComputePipeline)\n```\nSetPipeline sets the compute pipeline.\n\n```go\ntype ComputePassTimestampWrites = PassTimestampWrites\n```\nComputePassTimestampWrites is a deprecated alias for PassTimestampWrites. Deprecated: Use PassTimestampWrites. Renamed in wgpu-native v29.\n\n```go\ntype ComputePipeline struct {\n\t// contains filtered or unexported fields\n}\n```\nComputePipeline is a compiled compute pipeline configuration. Create with [Device.CreateComputePipeline](#Device.CreateComputePipeline), release with [ComputePipeline.Release](#ComputePipeline.Release).\n\n```go\nfunc (cp *ComputePipeline) GetBindGroupLayout(groupIndex uint32) *BindGroupLayout\n```\nGetBindGroupLayout returns the bind group layout at the given index. Useful for auto-layout pipelines.\n\n```go\nfunc (cp *ComputePipeline) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (cp *ComputePipeline) Release()\n```\nRelease releases the compute pipeline.\n\n```go\ntype ComputePipelineDescriptor struct {\n\tLabel      string\n\tLayout     *PipelineLayout // nil for auto layout\n\tModule     *ShaderModule\n\tEntryPoint string\n}\n```\nComputePipelineDescriptor describes a compute pipeline to create. Layout is nil for auto layout.\n\n```go\ntype ComputePipelineDescriptorGo = ComputePipelineDescriptor\n```\nComputePipelineDescriptorGo is kept for backward compatibility. Deprecated: Use ComputePipelineDescriptor directly (now Go-idiomatic).\n\n```go\ntype CullMode = gputypes.CullMode\n```\n\n```go\ntype DepthStencilState struct {\n\tFormat              gputypes.TextureFormat\n\tDepthWriteEnabled   bool\n\tDepthCompare        gputypes.CompareFunction\n\tStencilFront        StencilFaceState\n\tStencilBack         StencilFaceState\n\tStencilReadMask     uint32\n\tStencilWriteMask    uint32\n\tDepthBias           int32\n\tDepthBiasSlopeScale float32\n\tDepthBiasClamp      float32\n}\n```\nDepthStencilState describes depth and stencil test state (user API).\n\n```go\ntype Device struct {\n\t// contains filtered or unexported fields\n}\n```\nDevice is the logical connection to a GPU, used to create all other resources. Obtained via [Adapter.RequestDevice](#Adapter.RequestDevice), release with [Device.Release](#Device.Release).\n\n```go\nfunc (d *Device) CreateBindGroup(desc *BindGroupDescriptor) (*BindGroup, error)\n```\nCreateBindGroup creates a bind group. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreateBindGroupLayout(desc *BindGroupLayoutDescriptor) (*BindGroupLayout, error)\n```\nCreateBindGroupLayout creates a bind group layout. Entries are converted from gputypes to wgpu-native enum values before FFI call. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreateBindGroupLayoutSimple(entries []BindGroupLayoutEntry) (*BindGroupLayout, error)\n```\nCreateBindGroupLayoutSimple creates a bind group layout with the given entries. Returns an error if the FFI call fails or the device is nil.\n\n```go\nfunc (d *Device) CreateBindGroupSimple(layout *BindGroupLayout, entries []BindGroupEntry) (*BindGroup, error)\n```\nCreateBindGroupSimple creates a bind group with the given entries. Returns an error if the FFI call fails or the device/layout is nil.\n\n```go\nfunc (d *Device) CreateBuffer(desc *BufferDescriptor) (*Buffer, error)\n```\nCreateBuffer creates a new GPU buffer. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreateCommandEncoder(desc *CommandEncoderDescriptor) (*CommandEncoder, error)\n```\nCreateCommandEncoder creates a command encoder. Returns an error if the FFI call fails or the device is nil.\n\n```go\nfunc (d *Device) CreateComputePipeline(desc *ComputePipelineDescriptor) (*ComputePipeline, error)\n```\nCreateComputePipeline creates a compute pipeline. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreateComputePipelineSimple(layout *PipelineLayout, shader *ShaderModule, entryPoint string) (*ComputePipeline, error)\n```\nCreateComputePipelineSimple creates a compute pipeline with the given shader and entry point. If layout is nil, auto layout is used. Returns an error if the FFI call fails or the device/shader is nil.\n\n```go\nfunc (d *Device) CreateDepthTexture(width, height uint32, format gputypes.TextureFormat) *Texture\n```\nCreateDepthTexture creates a depth texture with the specified dimensions and format. This is a convenience function for creating depth buffers for render passes. Returns nil on error (use CreateTexture directly for full error handling).\n\n```go\nfunc (d *Device) CreateLinearSampler() (*Sampler, error)\n```\nCreateLinearSampler creates a sampler with linear filtering.\n\n```go\nfunc (d *Device) CreateNearestSampler() (*Sampler, error)\n```\nCreateNearestSampler creates a sampler with nearest filtering.\n\n```go\nfunc (d *Device) CreatePipelineLayout(desc *PipelineLayoutDescriptor) (*PipelineLayout, error)\n```\nCreatePipelineLayout creates a pipeline layout. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreatePipelineLayoutSimple(layouts []*BindGroupLayout) (*PipelineLayout, error)\n```\nCreatePipelineLayoutSimple creates a pipeline layout with the given bind group layouts. Returns an error if the FFI call fails or the device is nil.\n\n```go\nfunc (d *Device) CreateQuerySet(desc *QuerySetDescriptor) (*QuerySet, error)\n```\nCreateQuerySet creates a new QuerySet for GPU profiling/timestamps.\n\n```go\nfunc (d *Device) CreateRenderBundleEncoder(desc *RenderBundleEncoderDescriptor) (*RenderBundleEncoder, error)\n```\nCreateRenderBundleEncoder creates a render bundle encoder for pre-recording render commands. Render bundles allow you to pre-record a sequence of render commands that can be replayed multiple times, which is useful for static geometry.\n\n```go\nfunc (d *Device) CreateRenderBundleEncoderSimple(colorFormats []gputypes.TextureFormat, depthFormat gputypes.TextureFormat, sampleCount uint32) *RenderBundleEncoder\n```\nCreateRenderBundleEncoderSimple creates a render bundle encoder with common settings.\n\n```go\nfunc (d *Device) CreateRenderPipeline(desc *RenderPipelineDescriptor) (*RenderPipeline, error)\n```\nCreateRenderPipeline creates a render pipeline. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreateRenderPipelineSimple(\n\tlayout *PipelineLayout,\n\tvertexShader *ShaderModule,\n\tvertexEntryPoint string,\n\tfragmentShader *ShaderModule,\n\tfragmentEntryPoint string,\n\ttargetFormat gputypes.TextureFormat,\n) (*RenderPipeline, error)\n```\nCreateRenderPipelineSimple creates a simple render pipeline with common defaults. Returns an error if the FFI call fails or the device/shaders are nil.\n\n```go\nfunc (d *Device) CreateSampler(desc *SamplerDescriptor) (*Sampler, error)\n```\nCreateSampler creates a sampler with the specified descriptor.\n\n```go\nfunc (d *Device) CreateShaderModule(desc *ShaderModuleDescriptor) (*ShaderModule, error)\n```\nCreateShaderModule creates a shader module from a descriptor. For WGSL shaders, prefer CreateShaderModuleWGSL or use ShaderDescriptor. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) CreateShaderModuleFromDesc(desc *ShaderDescriptor) (*ShaderModule, error)\n```\nCreateShaderModule creates a shader module from a Go-idiomatic ShaderDescriptor. This is the preferred method name matching the gogpu/wgpu API. If both WGSL and SPIRV are set, WGSL takes precedence. Returns an error if the FFI call fails, the device is nil, or both sources are empty.\n\nNote: there is also a lower-level CreateShaderModule(\\*ShaderModuleDescriptor) that accepts the wire-level descriptor with a chained struct for direct FFI use.\n\n```go\nfunc (d *Device) CreateShaderModuleFromDescriptor(desc *ShaderDescriptor) (*ShaderModule, error)\n```\nCreateShaderModuleFromDescriptor creates a shader module from a Go-idiomatic ShaderDescriptor. If both WGSL and SPIRV are set, WGSL takes precedence. Returns an error if the FFI call fails, the device is nil, or both sources are empty.\n\nDeprecated: use CreateShaderModule which has the same signature.\n\n```go\nfunc (d *Device) CreateShaderModuleSPIRV(label string, spirv []uint32) (*ShaderModule, error)\n```\nCreateShaderModuleSPIRV creates a shader module from SPIR-V bytecode. Returns an error if the FFI call fails, the device is nil, or the bytecode is empty.\n\n```go\nfunc (d *Device) CreateShaderModuleWGSL(code string) (*ShaderModule, error)\n```\nCreateShaderModuleWGSL creates a shader module from WGSL source code. Returns an error if the FFI call fails or the device is nil.\n\n```go\nfunc (d *Device) CreateTexture(desc *TextureDescriptor) (*Texture, error)\n```\nCreateTexture creates a texture with the specified descriptor. Enum values are converted from gputypes to wgpu-native values before FFI call. Returns an error if the FFI call fails or the device/descriptor is nil.\n\n```go\nfunc (d *Device) Features() []FeatureName\n```\nFeatures retrieves all features enabled on this device. Returns a slice of FeatureName values.\n\n```go\nfunc (d *Device) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (d *Device) HasFeature(feature FeatureName) bool\n```\nHasFeature checks if the device has a specific feature enabled.\n\n```go\nfunc (d *Device) Limits() Limits\n```\nLimits returns the resource limits of this device.\n\nLimits are cached at device creation time and returned by value. No FFI call is made. Returns zero-value Limits if the device is nil. This matches the gogpu/wgpu API signature for cross-project compatibility.\n\n```go\nfunc (d *Device) Poll(wait bool) bool\n```\nPoll polls the device for completed work. If wait is true, blocks until there is work to process. Returns true if the queue is empty. This is a wgpu-native extension.\n\n```go\nfunc (d *Device) PopErrorScope(instance *Instance) (ErrorType, string)\n```\nDeprecated: PopErrorScope panics on failure. Use PopErrorScopeAsync instead.\n\nPopErrorScope pops the current error scope and returns the first error caught. This is a synchronous wrapper that blocks until the result is available.\n\nIMPORTANT: You must have pushed an error scope before calling this. Calling PopErrorScope on an empty stack will cause a panic in wgpu-native. Use PopErrorScopeAsync if you need to handle empty stack gracefully.\n\nReturns:\n\n  - ErrorType: The type of error that occurred (ErrorTypeNoError if no error)\n  - string: Error message (empty if no error)\n\nNote: Error scopes are LIFO - the last pushed scope is popped first.\n\n```go\nfunc (d *Device) PopErrorScopeAsync(instance *Instance) (ErrorType, string, error)\n```\nPopErrorScopeAsync pops the current error scope and returns the first error caught. This version returns an error instead of panicking if the operation fails.\n\nReturns:\n\n  - ErrorType: The type of error that occurred (ErrorTypeNoError if no error)\n  - string: Error message (empty if no error)\n  - error: An error if the operation failed (e.g., empty stack)\n\nNote: Error scopes are LIFO - the last pushed scope is popped first. If the error scope stack is empty, returns an error instead of panicking.\n\n```go\nfunc (d *Device) PushErrorScope(filter ErrorFilter)\n```\nPushErrorScope pushes an error scope for catching GPU errors. Errors of the specified filter type will be caught until PopErrorScope is called. Error scopes are LIFO (stack-based) - last pushed scope is popped first.\n\nIMPORTANT: You must call PopErrorScope for each PushErrorScope. Popping an empty stack will cause a panic in wgpu-native (known limitation). Users should track push/pop calls manually to avoid stack underflow.\n\nExample usage:\n\n\tdevice.PushErrorScope(ErrorFilterValidation)\n\t// ... GPU operations that might produce validation errors\n\terrType, message := device.PopErrorScope(instance)\n\tif errType != ErrorTypeNoError {\n\t    log.Printf(\"Validation error: %s\", message)\n\t}\n\n```go\nfunc (d *Device) Queue() *Queue\n```\nQueue returns the default queue for the device.\n\n```go\nfunc (d *Device) Release()\n```\nRelease releases the device resources.\n\n```go\ntype DeviceDescriptor struct {\n\t// Label is an optional debug label for the device.\n\tLabel string\n\t// RequiredFeatures lists GPU features that the device must support.\n\tRequiredFeatures []FeatureName\n\t// RequiredLimits, if non-nil, specifies minimum resource limits the device must meet.\n\t// Pass nil to use the adapter's default limits.\n\tRequiredLimits *Limits\n}\n```\nDeviceDescriptor configures device creation. Matches the gogpu/wgpu API for cross-project compatibility.\n\n```go\ntype DeviceLostCallbackInfo struct {\n\tNextInChain uintptr // *ChainedStruct\n\tMode        CallbackMode\n\tCallback    uintptr // Function pointer\n\tUserdata1   uintptr\n\tUserdata2   uintptr\n}\n```\nDeviceLostCallbackInfo configures the device-lost callback.\n\n```go\ntype DeviceLostReason uint32\n```\nDeviceLostReason describes why a device was lost.\n\n```go\nconst (\n\t// DeviceLostReasonUnknown indicates the device was lost for an unknown reason.\n\tDeviceLostReasonUnknown DeviceLostReason = 0x00000001\n\t// DeviceLostReasonDestroyed indicates the device was explicitly destroyed.\n\tDeviceLostReasonDestroyed DeviceLostReason = 0x00000002\n\t// DeviceLostReasonCallbackCancelled indicates the operation was cancelled (e.g. instance dropped).\n\t// Renamed from InstanceDropped in v29.\n\tDeviceLostReasonCallbackCancelled DeviceLostReason = 0x00000003\n\t// DeviceLostReasonFailedCreation indicates device creation failed.\n\tDeviceLostReasonFailedCreation DeviceLostReason = 0x00000004\n\t// DeviceLostReasonInstanceDropped is a deprecated alias for CallbackCancelled.\n\t// Deprecated: Use DeviceLostReasonCallbackCancelled.\n\tDeviceLostReasonInstanceDropped = DeviceLostReasonCallbackCancelled\n)\n```\n\n```go\ntype DispatchIndirectArgs struct {\n\tWorkgroupCountX uint32 // Number of workgroups in X dimension\n\tWorkgroupCountY uint32 // Number of workgroups in Y dimension\n\tWorkgroupCountZ uint32 // Number of workgroups in Z dimension\n}\n```\nDispatchIndirectArgs contains arguments for indirect compute dispatch. This struct must be written to a Buffer for use with DispatchWorkgroupsIndirect. Size: 12 bytes, must be aligned to 4 bytes.\n\n```go\ntype DrawIndexedIndirectArgs struct {\n\tIndexCount    uint32 // Number of indices to draw\n\tInstanceCount uint32 // Number of instances to draw\n\tFirstIndex    uint32 // First index in the index buffer\n\tBaseVertex    int32  // Value added to vertex index before indexing into vertex buffer\n\tFirstInstance uint32 // First instance index\n}\n```\nDrawIndexedIndirectArgs contains arguments for indirect indexed draw calls. This struct must be written to a Buffer for use with DrawIndexedIndirect. Size: 20 bytes, must be aligned to 4 bytes.\n\n```go\ntype DrawIndirectArgs struct {\n\tVertexCount   uint32 // Number of vertices to draw\n\tInstanceCount uint32 // Number of instances to draw\n\tFirstVertex   uint32 // First vertex index\n\tFirstInstance uint32 // First instance index\n}\n```\nDrawIndirectArgs contains arguments for indirect (GPU-driven) draw calls. This struct must be written to a Buffer for use with DrawIndirect. Size: 16 bytes, must be aligned to 4 bytes.\n\n```go\ntype ErrorFilter uint32\n```\nErrorFilter filters error types in error scopes.\n\n```go\nconst (\n\t// ErrorFilterValidation catches validation errors.\n\tErrorFilterValidation ErrorFilter = 0x00000001\n\t// ErrorFilterOutOfMemory catches out-of-memory errors.\n\tErrorFilterOutOfMemory ErrorFilter = 0x00000002\n\t// ErrorFilterInternal catches internal errors.\n\tErrorFilterInternal ErrorFilter = 0x00000003\n)\n```\n\n```go\ntype ErrorType uint32\n```\nErrorType describes the type of error that occurred.\n\n```go\nconst (\n\t// ErrorTypeNoError indicates no error occurred.\n\tErrorTypeNoError ErrorType = 0x00000001\n\t// ErrorTypeValidation indicates a validation error.\n\tErrorTypeValidation ErrorType = 0x00000002\n\t// ErrorTypeOutOfMemory indicates an out-of-memory error.\n\tErrorTypeOutOfMemory ErrorType = 0x00000003\n\t// ErrorTypeInternal indicates an internal error.\n\tErrorTypeInternal ErrorType = 0x00000004\n\t// ErrorTypeUnknown indicates an unknown error.\n\tErrorTypeUnknown ErrorType = 0x00000005\n)\n```\n\n```go\ntype Extent3D = gputypes.Extent3D\n```\nExtent3D is a 3D extent (width/height/depth or array layers).\n\n```go\ntype FeatureLevel uint32\n```\nFeatureLevel indicates the WebGPU feature level.\n\n```go\nconst (\n\t// FeatureLevelUndefined indicates no value is passed. Added in v29.\n\tFeatureLevelUndefined FeatureLevel = 0x00000000\n\t// FeatureLevelCompatibility indicates the compatibility feature level (WebGPU compat).\n\tFeatureLevelCompatibility FeatureLevel = 0x00000001\n\t// FeatureLevelCore indicates the core feature level (full WebGPU).\n\tFeatureLevelCore FeatureLevel = 0x00000002\n)\n```\n\n```go\ntype FeatureName uint32\n```\nFeatureName describes a WebGPU feature that can be requested.\n\n```go\nconst (\n\t// FeatureNameCoreFeaturesAndLimits indicates core features and limits support.\n\tFeatureNameCoreFeaturesAndLimits FeatureName = 0x00000001\n\t// FeatureNameDepthClipControl enables depth clip control.\n\tFeatureNameDepthClipControl FeatureName = 0x00000002\n\t// FeatureNameDepth32FloatStencil8 enables depth32float-stencil8 texture format.\n\tFeatureNameDepth32FloatStencil8 FeatureName = 0x00000003\n\t// FeatureNameTextureCompressionBC enables BC texture compression.\n\tFeatureNameTextureCompressionBC FeatureName = 0x00000004\n\t// FeatureNameTextureCompressionBCSliced3D enables sliced 3D BC compression.\n\tFeatureNameTextureCompressionBCSliced3D FeatureName = 0x00000005\n\t// FeatureNameTextureCompressionETC2 enables ETC2 texture compression.\n\tFeatureNameTextureCompressionETC2 FeatureName = 0x00000006\n\t// FeatureNameTextureCompressionASTC enables ASTC texture compression.\n\tFeatureNameTextureCompressionASTC FeatureName = 0x00000007\n\t// FeatureNameTextureCompressionASTCSliced3D enables sliced 3D ASTC compression.\n\tFeatureNameTextureCompressionASTCSliced3D FeatureName = 0x00000008\n\t// FeatureNameTimestampQuery enables timestamp query support.\n\tFeatureNameTimestampQuery FeatureName = 0x00000009\n\t// FeatureNameIndirectFirstInstance enables indirect first instance.\n\tFeatureNameIndirectFirstInstance FeatureName = 0x0000000A\n\t// FeatureNameShaderF16 enables f16 in shaders.\n\tFeatureNameShaderF16 FeatureName = 0x0000000B\n\t// FeatureNameRG11B10UfloatRenderable enables RG11B10Ufloat as render target.\n\tFeatureNameRG11B10UfloatRenderable FeatureName = 0x0000000C\n\t// FeatureNameBGRA8UnormStorage enables BGRA8Unorm storage textures.\n\tFeatureNameBGRA8UnormStorage FeatureName = 0x0000000D\n\t// FeatureNameFloat32Filterable enables filterable float32 textures.\n\tFeatureNameFloat32Filterable FeatureName = 0x0000000E\n\t// FeatureNameFloat32Blendable enables blendable float32 textures.\n\tFeatureNameFloat32Blendable FeatureName = 0x0000000F\n\t// FeatureNameClipDistances enables clip distances in shaders.\n\tFeatureNameClipDistances FeatureName = 0x00000010\n\t// FeatureNameDualSourceBlending enables dual source blending.\n\tFeatureNameDualSourceBlending FeatureName = 0x00000011\n\t// FeatureNameSubgroups enables subgroup operations.\n\tFeatureNameSubgroups FeatureName = 0x00000012\n\t// FeatureNameTextureFormatsTier1 enables tier 1 texture formats.\n\tFeatureNameTextureFormatsTier1 FeatureName = 0x00000013\n\t// FeatureNameTextureFormatsTier2 enables tier 2 texture formats.\n\tFeatureNameTextureFormatsTier2 FeatureName = 0x00000014\n\t// FeatureNamePrimitiveIndex enables primitive index in shaders.\n\tFeatureNamePrimitiveIndex FeatureName = 0x00000015\n\t// FeatureNameTextureComponentSwizzle enables texture component swizzle.\n\tFeatureNameTextureComponentSwizzle FeatureName = 0x00000016\n)\n```\n\n```go\ntype Features = gputypes.Features\n```\nFeatures is a bitmask of enabled GPU features. Note: Limits is defined as a native FFI struct in adapter.go (matches wgpu-native ABI).\n\n```go\ntype FilterMode = gputypes.FilterMode\n```\nSampler types.\n\n```go\ntype FragmentState struct {\n\tModule     *ShaderModule\n\tEntryPoint string\n\tTargets    []ColorTargetState\n}\n```\nFragmentState describes the fragment stage of a render pipeline.\n\n```go\ntype FrontFace = gputypes.FrontFace\n```\n\n```go\ntype Future struct {\n\tID uint64\n}\n```\nFuture represents an async operation handle.\n\n```go\ntype ImageCopyTexture struct {\n\tTexture  *Texture\n\tMipLevel uint32\n\tOrigin   gputypes.Origin3D\n\tAspect   TextureAspect\n}\n```\nImageCopyTexture describes a texture subresource and origin for copy/write operations. Matches gogpu/wgpu ImageCopyTexture.\n\n```go\ntype ImageDataLayout struct {\n\tOffset       uint64\n\tBytesPerRow  uint32\n\tRowsPerImage uint32\n}\n```\nImageDataLayout describes the layout of image data in a buffer. Matches gogpu/wgpu ImageDataLayout.\n\n```go\ntype IndexFormat = gputypes.IndexFormat\n```\n\n```go\ntype Instance struct {\n\t// contains filtered or unexported fields\n}\n```\nInstance is the entry point to the WebGPU API. Create with [CreateInstance](#CreateInstance), release with [Instance.Release](#Instance.Release).\n\n```go\nfunc CreateInstance(desc *InstanceDescriptor) (*Instance, error)\n```\nCreateInstance creates a new WebGPU instance. Pass nil for default configuration (all primary backends enabled).\n\n```go\nfunc (inst *Instance) CreateSurfaceFromWaylandSurface(display, surface uintptr) (*Surface, error)\n```\nCreateSurfaceFromWaylandSurface creates a surface from a Wayland surface. display is the wl\\_display pointer. surface is the wl\\_surface pointer.\n\n```go\nfunc (inst *Instance) CreateSurfaceFromXlibWindow(display uintptr, window uint64) (*Surface, error)\n```\nCreateSurfaceFromXlibWindow creates a surface from an X11 Xlib window. display is the X11 Display pointer. window is the X11 Window ID (XID).\n\n```go\nfunc (i *Instance) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (i *Instance) ProcessEvents()\n```\nProcessEvents processes pending async events.\n\n```go\nfunc (i *Instance) Release()\n```\nRelease releases the instance resources.\n\n```go\nfunc (i *Instance) RequestAdapter(options *RequestAdapterOptions) (*Adapter, error)\n```\nRequestAdapter requests a GPU adapter from the instance. This is a synchronous wrapper that blocks until the adapter is available.\n\n```go\ntype InstanceBackend uint64\n```\nInstanceBackend is a bitflag selecting which graphics backends to enable. Used in InstanceExtras.Backends.\n\n```go\nconst (\n\t// InstanceBackendAll enables all available backends (default when zero).\n\tInstanceBackendAll InstanceBackend = 0x00000000\n\t// InstanceBackendVulkan enables the Vulkan backend.\n\tInstanceBackendVulkan InstanceBackend = 1 \u003c\u003c 0\n\t// InstanceBackendGL enables the OpenGL/OpenGL ES backend.\n\tInstanceBackendGL InstanceBackend = 1 \u003c\u003c 1\n\t// InstanceBackendMetal enables the Metal backend (macOS/iOS).\n\tInstanceBackendMetal InstanceBackend = 1 \u003c\u003c 2\n\t// InstanceBackendDX12 enables the Direct3D 12 backend (Windows).\n\tInstanceBackendDX12 InstanceBackend = 1 \u003c\u003c 3\n\t// InstanceBackendBrowserWebGPU enables the browser WebGPU backend (WASM).\n\tInstanceBackendBrowserWebGPU InstanceBackend = 1 \u003c\u003c 5\n\t// InstanceBackendPrimary enables primary tier backends: Vulkan, Metal, DX12, BrowserWebGPU.\n\tInstanceBackendPrimary InstanceBackend = (1 \u003c\u003c 0) | (1 \u003c\u003c 2) | (1 \u003c\u003c 3) | (1 \u003c\u003c 5)\n\t// InstanceBackendSecondary enables secondary tier backends: GL only.\n\t// BREAKING: v27 had Secondary = GL | DX11; DX11 was removed in v29.\n\tInstanceBackendSecondary InstanceBackend = (1 \u003c\u003c 1)\n)\n```\n\n```go\ntype InstanceDescriptor struct {\n\t// Backends selects which GPU backends to enable.\n\t// Use gputypes.BackendsPrimary (default) or specific backends.\n\tBackends gputypes.Backends\n\t// Flags controls instance features like debug layers and validation.\n\t// Use gputypes.InstanceFlagsDebug to enable GPU debug layer.\n\tFlags gputypes.InstanceFlags\n}\n```\nInstanceDescriptor configures instance creation. Matches the gogpu/wgpu API for cross-project compatibility.\n\nPass nil to CreateInstance for default configuration (all primary backends enabled).\n\n```go\ntype InstanceFeatureName uint32\n```\nInstanceFeatureName describes features that can be required at instance creation. New in v29.\n\n```go\nconst (\n\t// InstanceFeatureNameTimedWaitAny enables wgpuInstanceWaitAny with timeoutNS \u003e 0.\n\tInstanceFeatureNameTimedWaitAny InstanceFeatureName = 0x00000001\n\t// InstanceFeatureNameShaderSourceSPIRV enables SPIR-V shader sources.\n\tInstanceFeatureNameShaderSourceSPIRV InstanceFeatureName = 0x00000002\n\t// InstanceFeatureNameMultipleDevicesPerAdapter allows multiple devices per adapter.\n\tInstanceFeatureNameMultipleDevicesPerAdapter InstanceFeatureName = 0x00000003\n)\n```\n\n```go\ntype InstanceFlag uint64\n```\nInstanceFlag is a bitflag controlling instance debugging and validation behavior. Used in InstanceExtras.Flags.\n\n```go\nconst (\n\t// InstanceFlagEmpty has no flags set. Zero-initialization default.\n\t// BREAKING: v27 had Default=0; v29 renamed to Empty=0, Default moved to 1\u003c\u003c24.\n\tInstanceFlagEmpty InstanceFlag = 0x00000000\n\t// InstanceFlagDebug generates debug information in shaders and objects.\n\tInstanceFlagDebug InstanceFlag = 1 \u003c\u003c 0\n\t// InstanceFlagValidation enables validation in the backend API.\n\tInstanceFlagValidation InstanceFlag = 1 \u003c\u003c 1\n\t// InstanceFlagDiscardHalLabels suppresses label passing to backend HAL.\n\tInstanceFlagDiscardHalLabels InstanceFlag = 1 \u003c\u003c 2\n\t// InstanceFlagAllowUnderlyingNoncompliantAdapter exposes adapters on non-compliant drivers.\n\tInstanceFlagAllowUnderlyingNoncompliantAdapter InstanceFlag = 1 \u003c\u003c 3\n\t// InstanceFlagGPUBasedValidation enables GPU-based validation (implies Validation).\n\tInstanceFlagGPUBasedValidation InstanceFlag = 1 \u003c\u003c 4\n\t// InstanceFlagValidationIndirectCall validates indirect buffer content before indirect draws.\n\tInstanceFlagValidationIndirectCall InstanceFlag = 1 \u003c\u003c 5\n\t// InstanceFlagAutomaticTimestampNormalization normalizes timestamps to nanoseconds.\n\tInstanceFlagAutomaticTimestampNormalization InstanceFlag = 1 \u003c\u003c 6\n\t// InstanceFlagDefault uses the default flags for the current build configuration.\n\t// BREAKING: v27 had Default=0; v29 Default=1\u003c\u003c24 (debug builds enable Debug+Validation).\n\tInstanceFlagDefault InstanceFlag = 1 \u003c\u003c 24\n\t// InstanceFlagDebugging enables Debug and Validation.\n\tInstanceFlagDebugging InstanceFlag = 1 \u003c\u003c 25\n\t// InstanceFlagAdvancedDebugging enables Debug, Validation, and GPUBasedValidation.\n\tInstanceFlagAdvancedDebugging InstanceFlag = 1 \u003c\u003c 26\n\t// InstanceFlagWithEnv reads flag overrides from environment variables.\n\tInstanceFlagWithEnv InstanceFlag = 1 \u003c\u003c 27\n)\n```\n\n```go\ntype InstanceLimits struct {\n\tNextInChain          uintptr // *ChainedStruct (nullable)\n\tTimedWaitAnyMaxCount uint64\n}\n```\nInstanceLimits describes the limits required at instance creation. New in v29 — passed as RequiredLimits in instanceDescriptorWire.\n\n```go\ntype LeakReport struct {\n\t// Count is the total number of unreleased resources.\n\tCount int\n\t// Types maps resource type names to their counts.\n\tTypes map[string]int\n}\n```\nLeakReport contains information about unreleased GPU resources.\n\n```go\nfunc ReportLeaks() *LeakReport\n```\nReportLeaks returns information about unreleased GPU resources. Only meaningful when debug mode is enabled via SetDebugMode(true). Returns nil if no leaks are detected.\n\n```go\nfunc (r *LeakReport) String() string\n```\nString returns a human-readable summary of the leak report.\n\n```go\ntype Library interface {\n\t// NewProc retrieves a procedure (function) from the library.\n\t// Returns a Proc interface that can be used to call the function.\n\tNewProc(name string) Proc\n}\n```\nLibrary represents a dynamically loaded library (DLL/SO/DYLIB). Platform-specific implementations handle the actual loading mechanism.\n\n```go\ntype Limits struct {\n\t// MaxTextureDimension1D is the maximum 1D texture dimension.\n\tMaxTextureDimension1D uint32\n\t// MaxTextureDimension2D is the maximum 2D texture dimension.\n\tMaxTextureDimension2D uint32\n\t// MaxTextureDimension3D is the maximum 3D texture dimension.\n\tMaxTextureDimension3D uint32\n\t// MaxTextureArrayLayers is the maximum texture array layer count.\n\tMaxTextureArrayLayers uint32\n\t// MaxBindGroups is the maximum number of bind groups.\n\tMaxBindGroups uint32\n\t// MaxBindGroupsPlusVertexBuffers is the max bind groups + vertex buffers.\n\tMaxBindGroupsPlusVertexBuffers uint32\n\t// MaxBindingsPerBindGroup is the max bindings per bind group.\n\tMaxBindingsPerBindGroup uint32\n\t// MaxDynamicUniformBuffersPerPipelineLayout is the max dynamic uniform buffers.\n\tMaxDynamicUniformBuffersPerPipelineLayout uint32\n\t// MaxDynamicStorageBuffersPerPipelineLayout is the max dynamic storage buffers.\n\tMaxDynamicStorageBuffersPerPipelineLayout uint32\n\t// MaxSampledTexturesPerShaderStage is the max sampled textures per shader stage.\n\tMaxSampledTexturesPerShaderStage uint32\n\t// MaxSamplersPerShaderStage is the max samplers per shader stage.\n\tMaxSamplersPerShaderStage uint32\n\t// MaxStorageBuffersPerShaderStage is the max storage buffers per shader stage.\n\tMaxStorageBuffersPerShaderStage uint32\n\t// MaxStorageTexturesPerShaderStage is the max storage textures per shader stage.\n\tMaxStorageTexturesPerShaderStage uint32\n\t// MaxUniformBuffersPerShaderStage is the max uniform buffers per shader stage.\n\tMaxUniformBuffersPerShaderStage uint32\n\t// MaxUniformBufferBindingSize is the max uniform buffer binding size in bytes.\n\tMaxUniformBufferBindingSize uint64\n\t// MaxStorageBufferBindingSize is the max storage buffer binding size in bytes.\n\tMaxStorageBufferBindingSize uint64\n\t// MinUniformBufferOffsetAlignment is the minimum uniform buffer offset alignment.\n\tMinUniformBufferOffsetAlignment uint32\n\t// MinStorageBufferOffsetAlignment is the minimum storage buffer offset alignment.\n\tMinStorageBufferOffsetAlignment uint32\n\t// MaxVertexBuffers is the max vertex buffers in a pipeline.\n\tMaxVertexBuffers uint32\n\t// MaxBufferSize is the max buffer size in bytes.\n\tMaxBufferSize uint64\n\t// MaxVertexAttributes is the max vertex attributes in a pipeline.\n\tMaxVertexAttributes uint32\n\t// MaxVertexBufferArrayStride is the max vertex buffer array stride.\n\tMaxVertexBufferArrayStride uint32\n\t// MaxInterStageShaderVariables is the max inter-stage shader variables.\n\tMaxInterStageShaderVariables uint32\n\t// MaxColorAttachments is the max color attachments in a render pass.\n\tMaxColorAttachments uint32\n\t// MaxColorAttachmentBytesPerSample is the max bytes per sample for color attachments.\n\tMaxColorAttachmentBytesPerSample uint32\n\t// MaxComputeWorkgroupStorageSize is the max compute workgroup storage in bytes.\n\tMaxComputeWorkgroupStorageSize uint32\n\t// MaxComputeInvocationsPerWorkgroup is the max compute invocations per workgroup.\n\tMaxComputeInvocationsPerWorkgroup uint32\n\t// MaxComputeWorkgroupSizeX is the max compute workgroup size in X dimension.\n\tMaxComputeWorkgroupSizeX uint32\n\t// MaxComputeWorkgroupSizeY is the max compute workgroup size in Y dimension.\n\tMaxComputeWorkgroupSizeY uint32\n\t// MaxComputeWorkgroupSizeZ is the max compute workgroup size in Z dimension.\n\tMaxComputeWorkgroupSizeZ uint32\n\t// MaxComputeWorkgroupsPerDimension is the max compute workgroups per dimension.\n\tMaxComputeWorkgroupsPerDimension uint32\n}\n```\nLimits describes GPU resource limits for an adapter or device.\n\nThis type matches the gogpu/wgpu API for cross-project compatibility. Limits are cached at creation time (RequestAdapter/RequestDevice) and returned by value — no FFI call is made on each access.\n\nNote: wgpu-native-specific fields (MaxImmediateSize, MaxNonSamplerBindings) are not exposed here. Use NativeLimits for native extensions.\n\n```go\ntype LoadOp = gputypes.LoadOp\n```\nRender pass types.\n\n```go\ntype MapAsyncStatus uint32\n```\nMapAsyncStatus is the status returned by MapAsync callback.\n\n```go\nconst (\n\t// MapAsyncStatusSuccess indicates the buffer was successfully mapped.\n\tMapAsyncStatusSuccess MapAsyncStatus = 0x00000001\n\t// MapAsyncStatusCallbackCancelled indicates the callback was cancelled.\n\tMapAsyncStatusCallbackCancelled MapAsyncStatus = 0x00000002\n\t// MapAsyncStatusError indicates a mapping error occurred.\n\tMapAsyncStatusError MapAsyncStatus = 0x00000003\n\t// MapAsyncStatusAborted indicates the mapping was aborted (e.g., buffer destroyed).\n\tMapAsyncStatusAborted MapAsyncStatus = 0x00000004\n\n\t// Deprecated: use MapAsyncStatusCallbackCancelled.\n\tMapAsyncStatusInstanceDropped = MapAsyncStatusCallbackCancelled\n)\n```\n\n```go\ntype MapMode uint64\n```\nMapMode specifies the mapping mode for MapAsync.\n\n```go\nconst (\n\t// MapModeNone indicates no mapping mode (default).\n\tMapModeNone MapMode = 0x0000000000000000\n\t// MapModeRead maps the buffer for reading via GetMappedRange.\n\tMapModeRead MapMode = 0x0000000000000001\n\t// MapModeWrite maps the buffer for writing via GetMappedRange.\n\tMapModeWrite MapMode = 0x0000000000000002\n)\n```\n\n```go\ntype MapPending struct {\n\t// contains filtered or unexported fields\n}\n```\nMapPending represents an in-flight buffer map request. Created by [Buffer.MapAsync](#Buffer.MapAsync); poll Status() or call Wait() to resolve.\n\nThe caller must not access the mapped buffer data until Status() returns ready=true with err=nil, or Wait() returns nil.\n\n```go\nfunc (p *MapPending) Release()\n```\nRelease discards the pending handle. Safe to call after Wait/Status resolved.\n\n```go\nfunc (p *MapPending) Status() (ready bool, err error)\n```\nStatus reports whether the map request has completed. Non-blocking — returns (false, nil) if still pending. Once it returns (true, ...), subsequent calls return the same value.\n\n```go\nfunc (p *MapPending) Wait(ctx context.Context) error\n```\nWait blocks until the map request completes or ctx is canceled. Returns nil on success, ctx.Err() if context was canceled before completion.\n\n```go\ntype MappedRange struct {\n\t// contains filtered or unexported fields\n}\n```\nMappedRange provides safe access to a mapped buffer region. Obtained via [Buffer.MappedRange](#Buffer.MappedRange) after a successful [Buffer.Map](#Buffer.Map) or [Buffer.MapAsync](#Buffer.MapAsync). The data slice is invalidated by [Buffer.Unmap](#Buffer.Unmap).\n\nMatches gogpu/wgpu MappedRange.\n\n```go\nfunc (m *MappedRange) Bytes() []byte\n```\nBytes returns the mapped memory as a byte slice. Returns nil if the buffer is not mapped or the range has been invalidated.\n\nThe slice is valid only while the buffer remains mapped. Calling [Buffer.Unmap](#Buffer.Unmap) or [Buffer.Release](#Buffer.Release) after this will cause undefined behavior if the slice is still accessed.\n\n```go\nfunc (m *MappedRange) Len() int\n```\nLen returns the size of the mapped range in bytes.\n\n```go\nfunc (m *MappedRange) Offset() uint64\n```\nOffset returns the byte offset of this range within the buffer.\n\n```go\ntype Mat4 [16]float32\n```\nMat4 represents a 4x4 matrix in column-major order, compatible with WGSL mat4x4\\\u003cf32\u003e. Layout: \\[col0, col1, col2, col3] where each column is \\[x, y, z, w]. Element at column c, row r is at index c\\*4+r. This matches WebGPU/WGSL/OpenGL convention (column-major).\n\n```go\nfunc Mat4Identity() Mat4\n```\nMat4Identity returns a 4x4 identity matrix. The identity matrix has 1s on the diagonal and 0s elsewhere.\n\n```go\nfunc Mat4LookAt(eye, center, up Vec3) Mat4\n```\nMat4LookAt returns a view matrix that looks from eye position towards center. eye: camera position center: point the camera is looking at up: up direction vector (typically (0, 1, 0))\n\nThis creates a right-handed coordinate system view matrix.\n\n```go\nfunc Mat4Perspective(fovY, aspect, near, far float32) Mat4\n```\nMat4Perspective returns a perspective projection matrix. fovY: vertical field of view in radians aspect: aspect ratio (width/height) near: near clipping plane distance (must be \u003e 0) far: far clipping plane distance (must be \u003e near)\n\nThis uses right-handed coordinate system with Z in \\[-1, 1] (OpenGL/Vulkan style). For WebGPU with Z in \\[0, 1], post-multiply with depth range transform.\n\n```go\nfunc Mat4RotateX(radians float32) Mat4\n```\nMat4RotateX returns a rotation matrix around the X axis. Angle is in radians. Positive rotation follows right-hand rule.\n\n```go\nfunc Mat4RotateY(radians float32) Mat4\n```\nMat4RotateY returns a rotation matrix around the Y axis. Angle is in radians. Positive rotation follows right-hand rule.\n\n```go\nfunc Mat4RotateZ(radians float32) Mat4\n```\nMat4RotateZ returns a rotation matrix around the Z axis. Angle is in radians. Positive rotation follows right-hand rule.\n\n```go\nfunc Mat4Scale(x, y, z float32) Mat4\n```\nMat4Scale returns a scaling matrix for the given factors. Scales objects by (x, y, z) along each axis.\n\n```go\nfunc Mat4Translate(x, y, z float32) Mat4\n```\nMat4Translate returns a translation matrix for the given offset. Translates points by (x, y, z) in 3D space.\n\n```go\nfunc (m Mat4) Mul(other Mat4) Mat4\n```\nMul multiplies this matrix by another matrix (column-major order). Returns result = m \\* other (apply m first, then other).\n\n```go\nfunc (m Mat4) MulVec4(v Vec4) Vec4\n```\nMulVec4 multiplies this matrix by a 4D vector. Returns result = m \\* v (transforms vector by matrix).\n\n```go\ntype MipmapFilterMode = gputypes.MipmapFilterMode\n```\n\n```go\ntype MultisampleState struct {\n\tCount                  uint32\n\tMask                   uint32\n\tAlphaToCoverageEnabled bool\n}\n```\nMultisampleState describes multisampling.\n\n```go\ntype NativeDisplayHandleType uint32\n```\nNativeDisplayHandleType identifies the platform display connection type. Used in NativeDisplayHandle.Type. New in v29.\n\n```go\nconst (\n\t// NativeDisplayHandleTypeNone indicates no display handle. Default (zero-init).\n\tNativeDisplayHandleTypeNone NativeDisplayHandleType = 0x00000000\n\t// NativeDisplayHandleTypeXlib is an X11 display via Xlib.\n\tNativeDisplayHandleTypeXlib NativeDisplayHandleType = 0x00000001\n\t// NativeDisplayHandleTypeXcb is an X11 display via XCB.\n\tNativeDisplayHandleTypeXcb NativeDisplayHandleType = 0x00000002\n\t// NativeDisplayHandleTypeWayland is a Wayland display connection.\n\tNativeDisplayHandleTypeWayland NativeDisplayHandleType = 0x00000003\n)\n```\n\n```go\ntype NativeFeature uint32\n```\nNativeFeature describes a wgpu-native extension feature.\n\n```go\nconst (\n\t// NativeFeatureImmediates enables immediate data (push constants replacement).\n\t// Renamed from PushConstants in v29.\n\tNativeFeatureImmediates NativeFeature = 0x00030001\n\t// NativeFeaturePushConstants is a deprecated alias for Immediates.\n\t// Deprecated: Use NativeFeatureImmediates.\n\tNativeFeaturePushConstants = NativeFeatureImmediates\n\t// NativeFeatureTextureAdapterSpecificFormatFeatures enables device-specific texture format features.\n\tNativeFeatureTextureAdapterSpecificFormatFeatures NativeFeature = 0x00030002\n\t// NativeFeatureMultiDrawIndirectCount enables indirect draw count.\n\tNativeFeatureMultiDrawIndirectCount NativeFeature = 0x00030004\n\t// NativeFeatureVertexWritableStorage enables vertex shader writable storage.\n\tNativeFeatureVertexWritableStorage NativeFeature = 0x00030005\n\t// NativeFeatureTextureBindingArray enables texture binding arrays.\n\tNativeFeatureTextureBindingArray NativeFeature = 0x00030006\n\t// NativeFeatureSampledTextureAndStorageBufferArrayNonUniformIndexing enables non-uniform indexing.\n\tNativeFeatureSampledTextureAndStorageBufferArrayNonUniformIndexing NativeFeature = 0x00030007\n\t// NativeFeaturePipelineStatisticsQuery enables pipeline statistics queries.\n\tNativeFeaturePipelineStatisticsQuery NativeFeature = 0x00030008\n\t// NativeFeatureStorageResourceBindingArray enables storage resource binding arrays.\n\tNativeFeatureStorageResourceBindingArray NativeFeature = 0x00030009\n\t// NativeFeaturePartiallyBoundBindingArray enables partially bound binding arrays.\n\tNativeFeaturePartiallyBoundBindingArray NativeFeature = 0x0003000A\n\t// NativeFeatureTextureFormat16bitNorm enables normalized 16-bit texture formats.\n\tNativeFeatureTextureFormat16bitNorm NativeFeature = 0x0003000B\n\t// NativeFeatureTextureCompressionAstcHdr enables ASTC HDR compression.\n\tNativeFeatureTextureCompressionAstcHdr NativeFeature = 0x0003000C\n\t// NativeFeatureMappablePrimaryBuffers enables mappable primary buffers.\n\tNativeFeatureMappablePrimaryBuffers NativeFeature = 0x0003000E\n\t// NativeFeatureBufferBindingArray enables buffer binding arrays.\n\tNativeFeatureBufferBindingArray NativeFeature = 0x0003000F\n\t// NativeFeatureUniformBufferAndStorageTextureArrayNonUniformIndexing enables non-uniform indexing for these types.\n\tNativeFeatureUniformBufferAndStorageTextureArrayNonUniformIndexing NativeFeature = 0x00030010\n\t// NativeFeaturePolygonModeLine enables polygon line mode.\n\tNativeFeaturePolygonModeLine NativeFeature = 0x00030013\n\t// NativeFeaturePolygonModePoint enables polygon point mode.\n\tNativeFeaturePolygonModePoint NativeFeature = 0x00030014\n\t// NativeFeatureConservativeRasterization enables conservative rasterization.\n\tNativeFeatureConservativeRasterization NativeFeature = 0x00030015\n\t// NativeFeatureSpirvShaderPassthrough enables SPIR-V shader passthrough.\n\tNativeFeatureSpirvShaderPassthrough NativeFeature = 0x00030017\n\t// NativeFeatureVertexAttribute64bit enables 64-bit vertex attributes.\n\tNativeFeatureVertexAttribute64bit NativeFeature = 0x00030019\n\t// NativeFeatureTextureFormatNv12 enables NV12 texture format.\n\tNativeFeatureTextureFormatNv12 NativeFeature = 0x0003001A\n\t// NativeFeatureRayQuery enables ray query in shaders.\n\tNativeFeatureRayQuery NativeFeature = 0x0003001C\n\t// NativeFeatureShaderF64 enables f64 in shaders.\n\tNativeFeatureShaderF64 NativeFeature = 0x0003001D\n\t// NativeFeatureShaderI16 enables i16 in shaders.\n\tNativeFeatureShaderI16 NativeFeature = 0x0003001E\n\t// NativeFeatureShaderEarlyDepthTest enables early depth test attribute in shaders.\n\tNativeFeatureShaderEarlyDepthTest NativeFeature = 0x00030020\n\t// NativeFeatureSubgroup enables subgroup operations in compute/fragment shaders.\n\tNativeFeatureSubgroup NativeFeature = 0x00030021\n\t// NativeFeatureSubgroupVertex enables subgroup operations in vertex shaders.\n\tNativeFeatureSubgroupVertex NativeFeature = 0x00030022\n\t// NativeFeatureSubgroupBarrier enables subgroup barrier in compute shaders.\n\tNativeFeatureSubgroupBarrier NativeFeature = 0x00030023\n\t// NativeFeatureTimestampQueryInsideEncoders enables timestamp queries on command encoders.\n\tNativeFeatureTimestampQueryInsideEncoders NativeFeature = 0x00030024\n\t// NativeFeatureTimestampQueryInsidePasses enables timestamp queries inside render/compute passes.\n\tNativeFeatureTimestampQueryInsidePasses NativeFeature = 0x00030025\n\t// NativeFeatureShaderInt64 enables i64/u64 in shaders.\n\tNativeFeatureShaderInt64 NativeFeature = 0x00030026\n)\n```\n\n```go\ntype NativeLimits struct {\n\tChain                                 ChainedStruct // chain.SType must be STypeNativeLimits\n\tMaxImmediateSize                      uint32        // was maxPushConstantSize in v27\n\tMaxNonSamplerBindings                 uint32        // max live non-sampler bindings (DX12 only)\n\tMaxBindingArrayElementsPerShaderStage uint32        // max resources in binding arrays per shader stage\n}\n```\nNativeLimits extends WGPULimits with wgpu-native specific limits. Chain via NextInChain in Limits with SType = STypeNativeLimits. v29 BREAKING: maxPushConstantSize renamed to maxImmediateSize; maxNonSamplerBindings and maxBindingArrayElementsPerShaderStage added.\n\n```go\ntype OptionalBool uint32\n```\nOptionalBool is a tri-state boolean for WebGPU.\n\n```go\nconst (\n\t// OptionalBoolFalse represents an explicit false value.\n\tOptionalBoolFalse OptionalBool = 0x00000000\n\t// OptionalBoolTrue represents an explicit true value.\n\tOptionalBoolTrue OptionalBool = 0x00000001\n\t// OptionalBoolUndefined represents an unset/default value.\n\tOptionalBoolUndefined OptionalBool = 0x00000002\n)\n```\n\n```go\ntype Origin3D = gputypes.Origin3D\n```\nOrigin3D is a 3D origin (x/y/z or array layer offset).\n\n```go\ntype PassTimestampWrites struct {\n\tQuerySet                  *QuerySet\n\tBeginningOfPassWriteIndex uint32 // Use TimestampLocationUndefined to disable\n\tEndOfPassWriteIndex       uint32 // Use TimestampLocationUndefined to disable\n}\n```\nPassTimestampWrites describes timestamp writes for a render or compute pass. v29: Unified struct — replaces separate RenderPassTimestampWrites and ComputePassTimestampWrites.\n\n```go\ntype PipelineLayout struct {\n\t// contains filtered or unexported fields\n}\n```\nPipelineLayout defines the bind group layouts used by a pipeline. Create with [Device.CreatePipelineLayout](#Device.CreatePipelineLayout), release with [PipelineLayout.Release](#PipelineLayout.Release).\n\n```go\nfunc (pl *PipelineLayout) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (pl *PipelineLayout) Release()\n```\nRelease releases the pipeline layout.\n\n```go\ntype PipelineLayoutDescriptor struct {\n\tLabel            string\n\tBindGroupLayouts []*BindGroupLayout\n}\n```\nPipelineLayoutDescriptor describes a pipeline layout to create. BindGroupLayouts is a slice of \\*BindGroupLayout; nil for auto layout.\n\n```go\ntype PipelineLayoutDescriptorGo = PipelineLayoutDescriptor\n```\nPipelineLayoutDescriptorGo is kept for backward compatibility. Deprecated: Use PipelineLayoutDescriptor directly (now Go-idiomatic).\n\n```go\ntype PipelineLayoutExtras struct {\n\tChain             ChainedStruct // chain.SType must be STypePipelineLayoutExtras\n\tImmediateDataSize uint32        // bytes of immediate data for shaders (requires NativeFeatureImmediates)\n}\n```\nPipelineLayoutExtras provides wgpu-native specific pipeline layout extensions. Chain via NextInChain in PipelineLayoutDescriptor with SType = STypePipelineLayoutExtras. v29 BREAKING: pushConstantRangeCount/pushConstantRanges replaced by immediateDataSize.\n\n```go\ntype PopErrorScopeStatus uint32\n```\nPopErrorScopeStatus describes the result of PopErrorScope operation.\n\n```go\nconst (\n\t// PopErrorScopeStatusSuccess indicates the error scope was successfully popped.\n\tPopErrorScopeStatusSuccess PopErrorScopeStatus = 0x00000001\n\t// PopErrorScopeStatusCallbackCancelled indicates the operation was cancelled (e.g. instance dropped).\n\t// Renamed from InstanceDropped in v29.\n\tPopErrorScopeStatusCallbackCancelled PopErrorScopeStatus = 0x00000002\n\t// PopErrorScopeStatusError indicates the error scope stack was empty or another error occurred.\n\t// Renamed from EmptyStack in v29.\n\tPopErrorScopeStatusError PopErrorScopeStatus = 0x00000003\n\t// PopErrorScopeStatusInstanceDropped is a deprecated alias for CallbackCancelled.\n\t// Deprecated: Use PopErrorScopeStatusCallbackCancelled.\n\tPopErrorScopeStatusInstanceDropped = PopErrorScopeStatusCallbackCancelled\n\t// PopErrorScopeStatusEmptyStack is a deprecated alias for Error.\n\t// Deprecated: Use PopErrorScopeStatusError.\n\tPopErrorScopeStatusEmptyStack = PopErrorScopeStatusError\n)\n```\n\n```go\ntype PowerPreference = gputypes.PowerPreference\n```\nAdapter types.\n\n```go\ntype PredefinedColorSpace uint32\n```\nPredefinedColorSpace describes a color space for surface color management. New in v29.\n\n```go\nconst (\n\t// PredefinedColorSpaceSRGB is the standard sRGB color space.\n\tPredefinedColorSpaceSRGB PredefinedColorSpace = 0x00000001\n\t// PredefinedColorSpaceDisplayP3 is the Display P3 wide-gamut color space.\n\tPredefinedColorSpaceDisplayP3 PredefinedColorSpace = 0x00000002\n)\n```\n\n```go\ntype PresentMode = gputypes.PresentMode\n```\nSurface/presentation types.\n\n```go\ntype PrimitiveState struct {\n\tTopology         gputypes.PrimitiveTopology\n\tStripIndexFormat gputypes.IndexFormat\n\tFrontFace        gputypes.FrontFace\n\tCullMode         gputypes.CullMode\n}\n```\nPrimitiveState describes how primitives are assembled.\n\n```go\ntype PrimitiveTopology = gputypes.PrimitiveTopology\n```\nPrimitive assembly types.\n\n```go\ntype Proc interface {\n\t// Call invokes the procedure with the given arguments.\n\t// Returns the result value and error (if any).\n\t// Arguments are passed as uintptr to match C ABI.\n\tCall(args ...uintptr) (uintptr, uintptr, error)\n}\n```\nProc represents a procedure (function pointer) from a dynamically loaded library. It abstracts platform-specific function calling mechanisms.\n\n```go\ntype ProgrammableStageDescriptor struct {\n\tNextInChain   uintptr    // *ChainedStruct\n\tModule        uintptr    // WGPUShaderModule\n\tEntryPoint    StringView // Entry point function name\n\tConstantCount uintptr    // size_t\n\tConstants     uintptr    // *ConstantEntry\n}\n```\nProgrammableStageDescriptor describes a programmable shader stage.\n\n```go\ntype QuerySet struct {\n\t// contains filtered or unexported fields\n}\n```\nQuerySet holds a set of GPU queries (occlusion or timestamp). Create with [Device.CreateQuerySet](#Device.CreateQuerySet), release with [QuerySet.Release](#QuerySet.Release).\n\n```go\nfunc (qs *QuerySet) Destroy()\n```\nDestroy destroys the QuerySet, making it invalid.\n\n```go\nfunc (qs *QuerySet) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (qs *QuerySet) Release()\n```\nRelease releases the QuerySet reference.\n\n```go\ntype QuerySetDescriptor struct {\n\tLabel string\n\tType  QueryType\n\tCount uint32\n}\n```\nQuerySetDescriptor describes a QuerySet to create.\n\n```go\ntype QueryType uint32\n```\nQueryType describes the type of queries in a QuerySet.\n\n```go\nconst (\n\t// QueryTypeOcclusion specifies occlusion queries.\n\tQueryTypeOcclusion QueryType = 0x00000001\n\t// QueryTypeTimestamp specifies timestamp queries for GPU profiling.\n\tQueryTypeTimestamp QueryType = 0x00000002\n)\n```\n\n```go\ntype Queue struct {\n\t// contains filtered or unexported fields\n}\n```\nQueue is used to submit command buffers and write data to buffers/textures. Obtained via [Device.Queue](#Device.Queue), release with [Queue.Release](#Queue.Release).\n\n```go\nfunc (q *Queue) GetTimestampPeriod() float32\n```\nGetTimestampPeriod returns the duration of one GPU timestamp tick in nanoseconds, as reported by wgpu-native. It returns zero for a nil or released queue, or when the native call is unavailable.\n\n```go\nfunc (q *Queue) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (q *Queue) Release()\n```\nRelease releases the queue resources.\n\n```go\nfunc (q *Queue) Submit(commands ...*CommandBuffer) (uint64, error)\n```\nSubmit submits command buffers for execution. Returns the submission index (uint64) and nil on success. The submission index can be used with Device.Poll to track when work completes. Matches gogpu/wgpu Queue.Submit(commands ...\\*CommandBuffer) (uint64, error).\n\n```go\nfunc (q *Queue) WriteBuffer(buffer *Buffer, offset uint64, data []byte) error\n```\nWriteBuffer writes data to a buffer. Returns nil on success. In this FFI implementation errors are surfaced through the Device uncaptured-error callback; the signature matches gogpu/wgpu for API compatibility.\n\n```go\nfunc (q *Queue) WriteBufferRaw(buffer *Buffer, offset uint64, data unsafe.Pointer, size uint64)\n```\nWriteBufferTyped writes typed data to a buffer. The data pointer should point to the first element, size is total byte size.\n\n```go\nfunc (q *Queue) WriteTexture(dest *ImageCopyTexture, data []byte, layout *ImageDataLayout, size *gputypes.Extent3D) error\n```\nWriteTexture writes data to a texture. Returns nil on success. In this FFI implementation errors are surfaced through the Device uncaptured-error callback; the signature matches gogpu/wgpu for API compatibility.\n\nAccepts either [ImageCopyTexture](#ImageCopyTexture) or [TexelCopyTextureInfo](#TexelCopyTextureInfo) as dest (via overloads below). This overload takes the high-level [ImageCopyTexture](#ImageCopyTexture) type.\n\n```go\nfunc (q *Queue) WriteTextureRaw(dest *TexelCopyTextureInfo, data []byte, layout *TexelCopyBufferLayout, size *gputypes.Extent3D) error\n```\nWriteTextureRaw writes data to a texture using the low-level wire types. Prefer \\[WriteTexture] for new code.\n\n```go\ntype QueueDescriptor struct {\n\tNextInChain uintptr // *ChainedStruct\n\tLabel       StringView\n}\n```\nQueueDescriptor configures queue creation.\n\n```go\ntype RenderBundle struct {\n\t// contains filtered or unexported fields\n}\n```\nRenderBundle is a pre-recorded set of render commands for efficient replay. Obtained from [RenderBundleEncoder.Finish](#RenderBundleEncoder.Finish), release with [RenderBundle.Release](#RenderBundle.Release).\n\n```go\nfunc (rb *RenderBundle) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (rb *RenderBundle) Release()\n```\nRelease releases the render bundle.\n\n```go\ntype RenderBundleDescriptor struct {\n\tNextInChain uintptr // *ChainedStruct\n\tLabel       StringView\n}\n```\nRenderBundleDescriptor describes a render bundle.\n\n```go\ntype RenderBundleEncoder struct {\n\t// contains filtered or unexported fields\n}\n```\nRenderBundleEncoder records render commands into a [RenderBundle](#RenderBundle). Create with [Device.CreateRenderBundleEncoder](#Device.CreateRenderBundleEncoder), finalize with [RenderBundleEncoder.Finish](#RenderBundleEncoder.Finish).\n\n```go\nfunc (rbe *RenderBundleEncoder) Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)\n```\nDraw records a non-indexed draw call.\n\n```go\nfunc (rbe *RenderBundleEncoder) DrawIndexed(indexCount, instanceCount, firstIndex uint32, baseVertex int32, firstInstance uint32)\n```\nDrawIndexed records an indexed draw call.\n\n```go\nfunc (rbe *RenderBundleEncoder) DrawIndexedIndirect(indirectBuffer *Buffer, indirectOffset uint64)\n```\nDrawIndexedIndirect records an indirect indexed draw call.\n\n```go\nfunc (rbe *RenderBundleEncoder) DrawIndirect(indirectBuffer *Buffer, indirectOffset uint64)\n```\nDrawIndirect records an indirect draw call.\n\n```go\nfunc (rbe *RenderBundleEncoder) Finish(desc ...*RenderBundleDescriptor) *RenderBundle\n```\nFinish completes recording and returns the render bundle. The optional desc parameter allows specifying a label; if omitted, nil is used.\n\n```go\nfunc (rbe *RenderBundleEncoder) Handle() uintptr\n```\nHandle returns the underlying handle.\n\n```go\nfunc (rbe *RenderBundleEncoder) Release()\n```\nRelease releases the render bundle encoder.\n\n```go\nfunc (rbe *RenderBundleEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)\n```\nSetBindGroup sets a bind group at the given index.\n\n```go\nfunc (rbe *RenderBundleEncoder) SetIndexBuffer(buffer *Buffer, format gputypes.IndexFormat, offset, size uint64)\n```\nSetIndexBuffer sets the index buffer.\n\n```go\nfunc (rbe *RenderBundleEncoder) SetPipeline(pipeline *RenderPipeline)\n```\nSetPipeline sets the render pipeline for subsequent draw calls.\n\n```go\nfunc (rbe *RenderBundleEncoder) SetVertexBuffer(slot uint32, buffer *Buffer, offset, size uint64)\n```\nSetVertexBuffer sets a vertex buffer at the given slot.\n\n```go\ntype RenderBundleEncoderDescriptor struct {\n\tLabel              string\n\tColorFormats       []gputypes.TextureFormat\n\tDepthStencilFormat gputypes.TextureFormat\n\tSampleCount        uint32\n\tDepthReadOnly      bool\n\tStencilReadOnly    bool\n}\n```\nRenderBundleEncoderDescriptor describes a render bundle encoder to create.\n\n```go\ntype RenderBundleEncoderDescriptorGo = RenderBundleEncoderDescriptor\n```\nRenderBundleEncoderDescriptorGo is kept for backward compatibility. Deprecated: Use RenderBundleEncoderDescriptor directly (now Go-idiomatic).\n\n```go\ntype RenderPassColorAttachment struct {\n\tView          *TextureView\n\tResolveTarget *TextureView // For MSAA, nil otherwise\n\tLoadOp        gputypes.LoadOp\n\tStoreOp       gputypes.StoreOp\n\tClearValue    Color\n}\n```\nRenderPassColorAttachment describes a color attachment for a render pass.\n\n```go\ntype RenderPassDepthStencilAttachment struct {\n\tView              *TextureView\n\tDepthLoadOp       gputypes.LoadOp\n\tDepthStoreOp      gputypes.StoreOp\n\tDepthClearValue   float32\n\tDepthReadOnly     bool\n\tStencilLoadOp     gputypes.LoadOp\n\tStencilStoreOp    gputypes.StoreOp\n\tStencilClearValue uint32\n\tStencilReadOnly   bool\n}\n```\nRenderPassDepthStencilAttachment describes a depth/stencil attachment (user API).\n\n```go\ntype RenderPassDescriptor struct {\n\tLabel                  string\n\tColorAttachments       []RenderPassColorAttachment\n\tDepthStencilAttachment *RenderPassDepthStencilAttachment\n\tTimestampWrites        *RenderPassTimestampWrites\n}\n```\nRenderPassDescriptor describes a render pass.\n\n```go\ntype RenderPassEncoder struct {\n\t// contains filtered or unexported fields\n}\n```\nRenderPassEncoder records draw commands within a render pass. Begin with [CommandEncoder.BeginRenderPass](#CommandEncoder.BeginRenderPass), end with [RenderPassEncoder.End](#RenderPassEncoder.End).\n\n```go\nfunc (rpe *RenderPassEncoder) Draw(vertexCount, instanceCount, firstVertex, firstInstance uint32)\n```\nDraw draws primitives.\n\n```go\nfunc (rpe *RenderPassEncoder) DrawIndexed(indexCount, instanceCount, firstIndex uint32, baseVertex int32, firstInstance uint32)\n```\nDrawIndexed draws indexed primitives.\n\n```go\nfunc (rpe *RenderPassEncoder) DrawIndexedIndirect(indirectBuffer *Buffer, indirectOffset uint64)\n```\nDrawIndexedIndirect draws indexed primitives using parameters from a GPU buffer. indirectBuffer must contain a DrawIndexedIndirectArgs structure:\n\n  - indexCount (uint32)\n  - instanceCount (uint32)\n  - firstIndex (uint32)\n  - baseVertex (int32)\n  - firstInstance (uint32)\n\n```go\nfunc (rpe *RenderPassEncoder) DrawIndirect(indirectBuffer *Buffer, indirectOffset uint64)\n```\nDrawIndirect draws primitives using parameters from a GPU buffer. indirectBuffer must contain a DrawIndirectArgs structure:\n\n  - vertexCount (uint32)\n  - instanceCount (uint32)\n  - firstVertex (uint32)\n  - firstInstance (uint32)\n\n```go\nfunc (rpe *RenderPassEncoder) End()\n```\nEnd ends the render pass.\n\n```go\nfunc (rpe *RenderPassEncoder) ExecuteBundles(bundles []*RenderBundle)\n```\nExecuteBundles executes pre-recorded render bundles in the render pass. This is useful for replaying static geometry without re-recording commands.\n\n```go\nfunc (rpe *RenderPassEncoder) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (rpe *RenderPassEncoder) InsertDebugMarker(markerLabel string)\n```\nInsertDebugMarker inserts a single debug marker label into the render pass. This is useful for GPU debugging tools to identify specific command points.\n\n```go\nfunc (rpe *RenderPassEncoder) PopDebugGroup()\n```\nPopDebugGroup ends the current debug group in the render pass. Must match a preceding PushDebugGroup call.\n\n```go\nfunc (rpe *RenderPassEncoder) PushDebugGroup(groupLabel string)\n```\nPushDebugGroup begins a labeled debug group in the render pass. Use PopDebugGroup to end the group. Groups can be nested.\n\n```go\nfunc (rpe *RenderPassEncoder) Release()\n```\nRelease releases the render pass encoder.\n\n```go\nfunc (rpe *RenderPassEncoder) SetBindGroup(groupIndex uint32, group *BindGroup, dynamicOffsets []uint32)\n```\nSetBindGroup sets a bind group for this pass.\n\n```go\nfunc (rpe *RenderPassEncoder) SetBlendConstant(color *Color)\n```\nSetBlendConstant sets the blend constant color used by blend operations. Errors are reported via Device error scopes.\n\n```go\nfunc (rpe *RenderPassEncoder) SetIndexBuffer(buffer *Buffer, format gputypes.IndexFormat, offset, size uint64)\n```\nSetIndexBuffer sets the index buffer for this pass.\n\n```go\nfunc (rpe *RenderPassEncoder) SetPipeline(pipeline *RenderPipeline)\n```\nSetPipeline sets the render pipeline for this pass.\n\n```go\nfunc (rpe *RenderPassEncoder) SetScissorRect(x, y, width, height uint32)\n```\nSetScissorRect sets the scissor rectangle used during the rasterization stage. Pixels outside the scissor rectangle will be discarded. x, y: top-left corner of the scissor rectangle in pixels width, height: dimensions of the scissor rectangle in pixels\n\n```go\nfunc (rpe *RenderPassEncoder) SetStencilReference(reference uint32)\n```\nSetStencilReference sets the stencil reference value used by stencil operations.\n\n```go\nfunc (rpe *RenderPassEncoder) SetVertexBuffer(slot uint32, buffer *Buffer, offset, size uint64)\n```\nSetVertexBuffer sets a vertex buffer for this pass.\n\n```go\nfunc (rpe *RenderPassEncoder) SetViewport(x, y, width, height, minDepth, maxDepth float32)\n```\nSetViewport sets the viewport used during the rasterization stage. x, y: top-left corner of the viewport in pixels width, height: dimensions of the viewport in pixels minDepth, maxDepth: depth range for the viewport (typically 0.0 to 1.0)\n\n```go\ntype RenderPassTimestampWrites = PassTimestampWrites\n```\nRenderPassTimestampWrites is a deprecated alias for PassTimestampWrites. Deprecated: Use PassTimestampWrites. Renamed in wgpu-native v29.\n\n```go\ntype RenderPipeline struct {\n\t// contains filtered or unexported fields\n}\n```\nRenderPipeline is a compiled render pipeline configuration (shaders, vertex layout, blend state). Create with [Device.CreateRenderPipeline](#Device.CreateRenderPipeline), release with [RenderPipeline.Release](#RenderPipeline.Release).\n\n```go\nfunc (rp *RenderPipeline) GetBindGroupLayout(groupIndex uint32) *BindGroupLayout\n```\nGetBindGroupLayout returns the bind group layout for the given index.\n\n```go\nfunc (rp *RenderPipeline) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (rp *RenderPipeline) Release()\n```\nRelease releases the render pipeline.\n\n```go\ntype RenderPipelineDescriptor struct {\n\tLabel        string\n\tLayout       *PipelineLayout // nil for auto layout\n\tVertex       VertexState\n\tPrimitive    PrimitiveState\n\tDepthStencil *DepthStencilState // nil for no depth/stencil\n\tMultisample  MultisampleState\n\tFragment     *FragmentState // nil for no fragment stage (depth-only)\n}\n```\nRenderPipelineDescriptor describes a render pipeline to create.\n\n```go\ntype RequestAdapterCallbackInfo struct {\n\tNextInChain uintptr // *ChainedStruct\n\tMode        CallbackMode\n\tCallback    uintptr // Function pointer\n\tUserdata1   uintptr\n\tUserdata2   uintptr\n}\n```\nRequestAdapterCallbackInfo holds callback configuration.\n\n```go\ntype RequestAdapterOptions struct {\n\t// PowerPreference indicates power consumption preference.\n\tPowerPreference gputypes.PowerPreference\n\t// ForceFallbackAdapter forces the use of a software adapter.\n\tForceFallbackAdapter bool\n\t// CompatibleSurface, if non-nil, restricts adapter selection to those\n\t// compatible with rendering to the given surface.\n\tCompatibleSurface *Surface\n}\n```\nRequestAdapterOptions configures adapter selection. Matches the gogpu/wgpu API for cross-project compatibility.\n\n```go\ntype RequestAdapterStatus uint32\n```\nRequestAdapterStatus is the status returned by RequestAdapter callback.\n\n```go\nconst (\n\t// RequestAdapterStatusSuccess indicates the adapter was successfully obtained.\n\tRequestAdapterStatusSuccess RequestAdapterStatus = 0x00000001\n\t// RequestAdapterStatusCallbackCancelled indicates the operation was cancelled (e.g. instance dropped).\n\t// Renamed from InstanceDropped in v29.\n\tRequestAdapterStatusCallbackCancelled RequestAdapterStatus = 0x00000002\n\t// RequestAdapterStatusUnavailable indicates no suitable adapter is available.\n\tRequestAdapterStatusUnavailable RequestAdapterStatus = 0x00000003\n\t// RequestAdapterStatusError indicates an error occurred during adapter request.\n\tRequestAdapterStatusError RequestAdapterStatus = 0x00000004\n\t// RequestAdapterStatusInstanceDropped is a deprecated alias for CallbackCancelled.\n\t// Deprecated: Use RequestAdapterStatusCallbackCancelled.\n\tRequestAdapterStatusInstanceDropped = RequestAdapterStatusCallbackCancelled\n)\n```\n\n```go\ntype RequestDeviceCallbackInfo struct {\n\tNextInChain uintptr // *ChainedStruct\n\tMode        CallbackMode\n\tCallback    uintptr // Function pointer\n\tUserdata1   uintptr\n\tUserdata2   uintptr\n}\n```\nRequestDeviceCallbackInfo holds callback configuration for RequestDevice.\n\n```go\ntype RequestDeviceStatus uint32\n```\nRequestDeviceStatus is the status returned by RequestDevice callback.\n\n```go\nconst (\n\t// RequestDeviceStatusSuccess indicates the device was successfully obtained.\n\tRequestDeviceStatusSuccess RequestDeviceStatus = 0x00000001\n\t// RequestDeviceStatusCallbackCancelled indicates the operation was cancelled (e.g. instance dropped).\n\t// Renamed from InstanceDropped in v29.\n\tRequestDeviceStatusCallbackCancelled RequestDeviceStatus = 0x00000002\n\t// RequestDeviceStatusError indicates an error occurred during device request.\n\tRequestDeviceStatusError RequestDeviceStatus = 0x00000003\n\t// RequestDeviceStatusInstanceDropped is a deprecated alias for CallbackCancelled.\n\t// Deprecated: Use RequestDeviceStatusCallbackCancelled.\n\tRequestDeviceStatusInstanceDropped = RequestDeviceStatusCallbackCancelled\n)\n```\n\n```go\ntype SType uint32\n```\nSType identifies chained struct types.\n\n```go\nconst (\n\t// STypeShaderSourceSPIRV identifies a SPIR-V shader source chained struct.\n\tSTypeShaderSourceSPIRV SType = 0x00000001\n\t// STypeShaderSourceWGSL identifies a WGSL shader source chained struct.\n\tSTypeShaderSourceWGSL SType = 0x00000002\n\t// STypeRenderPassMaxDrawCount identifies the max draw count chained struct.\n\tSTypeRenderPassMaxDrawCount SType = 0x00000003\n\n\t// STypeSurfaceSourceMetalLayer identifies a Metal layer surface source (macOS/iOS).\n\tSTypeSurfaceSourceMetalLayer SType = 0x00000004\n\t// STypeSurfaceSourceWindowsHWND identifies a Windows HWND surface source.\n\tSTypeSurfaceSourceWindowsHWND SType = 0x00000005\n\t// STypeSurfaceSourceXlibWindow identifies an Xlib window surface source (Linux).\n\tSTypeSurfaceSourceXlibWindow SType = 0x00000006\n\t// STypeSurfaceSourceWaylandSurface identifies a Wayland surface source (Linux).\n\tSTypeSurfaceSourceWaylandSurface SType = 0x00000007\n\t// STypeSurfaceSourceAndroidNativeWindow identifies an Android native window surface source.\n\tSTypeSurfaceSourceAndroidNativeWindow SType = 0x00000008\n\t// STypeSurfaceSourceXCBWindow identifies an XCB window surface source (Linux).\n\tSTypeSurfaceSourceXCBWindow SType = 0x00000009\n\t// STypeSurfaceColorManagement identifies a surface color management chained struct. New in v29.\n\tSTypeSurfaceColorManagement SType = 0x0000000A\n\t// STypeRequestAdapterWebXROptions identifies WebXR adapter options. New in v29.\n\tSTypeRequestAdapterWebXROptions SType = 0x0000000B\n\t// STypeTextureComponentSwizzleDescriptor identifies a texture component swizzle descriptor. New in v29.\n\tSTypeTextureComponentSwizzleDescriptor SType = 0x0000000C\n\t// STypeExternalTextureBindingLayout identifies an external texture binding layout. New in v29.\n\tSTypeExternalTextureBindingLayout SType = 0x0000000D\n\t// STypeExternalTextureBindingEntry identifies an external texture binding entry. New in v29.\n\tSTypeExternalTextureBindingEntry SType = 0x0000000E\n\t// STypeCompatibilityModeLimits identifies compat-mode limits. New in v29.\n\tSTypeCompatibilityModeLimits SType = 0x0000000F\n\t// STypeTextureBindingViewDimension identifies a texture binding view dimension. New in v29.\n\tSTypeTextureBindingViewDimension SType = 0x00000010\n\n\t// STypeDeviceExtras identifies wgpu-native device extras chained struct.\n\tSTypeDeviceExtras SType = 0x00030001\n\t// STypeNativeLimits identifies wgpu-native native limits chained struct.\n\tSTypeNativeLimits SType = 0x00030002\n\t// STypePipelineLayoutExtras identifies wgpu-native pipeline layout extras chained struct.\n\tSTypePipelineLayoutExtras SType = 0x00030003\n\t// STypeShaderSourceGLSL identifies a GLSL shader source chained struct (wgpu-native extension).\n\tSTypeShaderSourceGLSL SType = 0x00030004\n\t// STypeInstanceExtras identifies wgpu-native instance extras chained struct.\n\tSTypeInstanceExtras SType = 0x00030006\n\t// STypeBindGroupEntryExtras identifies wgpu-native bind group entry extras.\n\tSTypeBindGroupEntryExtras SType = 0x00030007\n\t// STypeBindGroupLayoutEntryExtras identifies wgpu-native bind group layout entry extras.\n\tSTypeBindGroupLayoutEntryExtras SType = 0x00030008\n\t// STypeQuerySetDescriptorExtras identifies wgpu-native query set descriptor extras.\n\tSTypeQuerySetDescriptorExtras SType = 0x00030009\n\t// STypeSurfaceConfigurationExtras identifies wgpu-native surface configuration extras.\n\tSTypeSurfaceConfigurationExtras SType = 0x0003000A\n\t// STypeSurfaceSourceSwapChainPanel identifies a WinUI SwapChainPanel surface source.\n\tSTypeSurfaceSourceSwapChainPanel SType = 0x0003000B\n\t// STypePrimitiveStateExtras identifies wgpu-native primitive state extras.\n\tSTypePrimitiveStateExtras SType = 0x0003000C\n)\n```\n\n```go\ntype Sampler struct {\n\t// contains filtered or unexported fields\n}\n```\nSampler defines how a shader samples a [Texture](#Texture). Create with [Device.CreateSampler](#Device.CreateSampler), release with [Sampler.Release](#Sampler.Release).\n\n```go\nfunc (s *Sampler) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (s *Sampler) Release()\n```\nRelease releases the sampler reference.\n\n```go\ntype SamplerBindingLayout = gputypes.SamplerBindingLayout\n```\nSamplerBindingLayout describes sampler binding properties.\n\nThis type matches gputypes.SamplerBindingLayout for cross-project compatibility. Used as a pointer field in BindGroupLayoutEntry; nil means \"not a sampler binding\".\n\n```go\ntype SamplerBindingType = gputypes.SamplerBindingType\n```\n\n```go\ntype SamplerDescriptor struct {\n\tLabel        string\n\tAddressModeU gputypes.AddressMode\n\tAddressModeV gputypes.AddressMode\n\tAddressModeW gputypes.AddressMode\n\tMagFilter    gputypes.FilterMode\n\tMinFilter    gputypes.FilterMode\n\tMipmapFilter gputypes.MipmapFilterMode\n\tLodMinClamp  float32\n\tLodMaxClamp  float32\n\tCompare      gputypes.CompareFunction\n\t// Anisotropy is the maximum anisotropy level for anisotropic filtering.\n\t// wgpu-native requires a value \u003e= 1; 0 is automatically clamped to 1.\n\tAnisotropy uint16\n}\n```\nSamplerDescriptor describes a sampler to create.\n\n```go\ntype ShaderDescriptor struct {\n\tLabel string\n\tWGSL  string   // WGSL source code\n\tSPIRV []uint32 // SPIR-V bytecode (alternative to WGSL)\n}\n```\nShaderDescriptor is the Go-idiomatic descriptor for creating a shader module. Use WGSL to specify WGSL source, or SPIRV for SPIR-V bytecode. If both are set, WGSL takes precedence. Use Device.CreateShaderModule or Device.CreateShaderModuleFromDescriptor to create from this.\n\n```go\ntype ShaderModule struct {\n\t// contains filtered or unexported fields\n}\n```\nShaderModule holds compiled shader code (WGSL or SPIR-V). Create with [Device.CreateShaderModuleWGSL](#Device.CreateShaderModuleWGSL), release with [ShaderModule.Release](#ShaderModule.Release).\n\n```go\nfunc (s *ShaderModule) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (s *ShaderModule) Release()\n```\nRelease releases the shader module resources.\n\n```go\ntype ShaderModuleDescriptor struct {\n\tNextInChain uintptr    // *ChainedStruct\n\tLabel       StringView // Shader module label for debugging\n}\n```\nShaderModuleDescriptor describes a shader module to create.\n\n```go\ntype ShaderModuleDescriptorGo = ShaderDescriptor\n```\nShaderModuleDescriptorGo is an alias for ShaderDescriptor. Use this name when matching the gogpu/wgpu naming convention.\n\n```go\ntype ShaderSourceWGSL struct {\n\tChain ChainedStruct\n\tCode  StringView\n}\n```\nShaderSourceWGSL provides WGSL source code for shader creation.\n\n```go\ntype ShaderStage = gputypes.ShaderStage\n```\nShader stage type. ShaderStage is the uint32 bitflag for individual stages (vertex/fragment/compute). ShaderStages is an alias for the same type for use in pipeline descriptors.\n\n```go\ntype ShaderStages = gputypes.ShaderStages\n```\n\n```go\ntype StencilFaceState struct {\n\tCompare     gputypes.CompareFunction\n\tFailOp      gputypes.StencilOperation\n\tDepthFailOp gputypes.StencilOperation\n\tPassOp      gputypes.StencilOperation\n}\n```\nStencilFaceState describes stencil operations for a face.\n\n```go\ntype StencilOperation = gputypes.StencilOperation\n```\n\n```go\ntype StorageTextureBindingLayout = gputypes.StorageTextureBindingLayout\n```\nStorageTextureBindingLayout describes storage texture binding properties.\n\nThis type matches gputypes.StorageTextureBindingLayout for cross-project compatibility. Used as a pointer field in BindGroupLayoutEntry; nil means \"not a storage texture binding\".\n\n```go\ntype StoreOp = gputypes.StoreOp\n```\n\n```go\ntype StringView struct {\n\tData   uintptr // *char\n\tLength uintptr // size_t, use SIZE_MAX for null-terminated\n}\n```\nStringView represents a WebGPU string view (pointer + length).\n\n```go\nfunc EmptyStringView() StringView\n```\nEmptyStringView returns an empty string view (null label).\n\n```go\ntype SupportedFeatures struct {\n\tFeatureCount uintptr // size_t\n\tFeatures     uintptr // *FeatureName (C-allocated, must free with SupportedFeaturesFreeMembers)\n}\n```\nSupportedFeatures contains features supported by adapter or device. This is the wire format for wgpuAdapterGetFeatures/wgpuDeviceGetFeatures (v29 single-call API). Call SupportedFeaturesFreeMembers after use to release C-allocated memory.\n\n```go\ntype Surface struct {\n\t// contains filtered or unexported fields\n}\n```\nSurface represents a platform window surface for presenting rendered frames. Create with platform-specific CreateSurface, release with [Surface.Release](#Surface.Release).\n\n```go\nfunc (s *Surface) Configure(device *Device, config *SurfaceConfiguration) error\n```\nConfigure configures the surface for rendering. The device argument specifies which logical device to use for the surface. If config.Device is also set (deprecated usage), it takes precedence over the device arg. Returns nil on success. Errors are surfaced through the Device uncaptured-error callback in this FFI implementation; the error return matches the gogpu/wgpu API signature. This replaces the deprecated SwapChain API. Enum values are converted from gputypes to wgpu-native values before FFI call.\n\n```go\nfunc (s *Surface) ConfigureLegacy(config *SurfaceConfiguration)\n```\nConfigureLegacy configures the surface using only the config struct (legacy API). Deprecated: use Configure(device, config) instead.\n\n```go\nfunc (s *Surface) GetCapabilities(adapter *Adapter) (*SurfaceCapabilities, error)\n```\nGetCapabilities queries the surface capabilities for the given adapter. This determines which texture formats, present modes, and alpha modes are supported. The caller must provide a valid adapter that will be used with this surface.\n\n```go\nfunc (s *Surface) GetCurrentTexture() (*SurfaceTexture, bool, error)\n```\nGetCurrentTexture gets the current texture to render to. Returns the texture, a suboptimal flag (true if the surface needs reconfiguration but is still usable this frame), and any error. This matches the gogpu/wgpu API.\n\n```go\nfunc (s *Surface) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (s *Surface) Present(texture ...*SurfaceTexture) error\n```\nPresent presents the current frame to the surface. The texture argument is accepted for API compatibility with gogpu/wgpu but is unused in the FFI implementation (wgpuSurfacePresent takes no texture arg). Returns nil on success.\n\n```go\nfunc (s *Surface) Release()\n```\nRelease releases the surface.\n\n```go\nfunc (s *Surface) Unconfigure()\n```\nUnconfigure removes the surface configuration.\n\n```go\ntype SurfaceCapabilities struct {\n\tUsages       gputypes.TextureUsage\n\tFormats      []gputypes.TextureFormat\n\tPresentModes []gputypes.PresentMode\n\tAlphaModes   []gputypes.CompositeAlphaMode\n}\n```\nSurfaceCapabilities describes the capabilities of a surface for presentation. Returned by Surface.GetCapabilities() to query supported formats, present modes, etc.\n\n```go\ntype SurfaceConfiguration struct {\n\t// Device is deprecated: pass the device to Configure() directly instead.\n\t// Kept for backward compatibility. If non-nil, overrides the explicit device argument.\n\tDevice      *Device\n\tFormat      gputypes.TextureFormat\n\tUsage       gputypes.TextureUsage\n\tWidth       uint32\n\tHeight      uint32\n\tAlphaMode   gputypes.CompositeAlphaMode\n\tPresentMode gputypes.PresentMode\n}\n```\nSurfaceConfiguration describes how to configure a surface. Note: the Device field is deprecated — pass the device as a separate argument to Configure. It remains here for backward compatibility; if non-nil it takes precedence over the explicit arg.\n\n```go\ntype SurfaceGetCurrentTextureStatus uint32\n```\nSurfaceGetCurrentTextureStatus describes the result of GetCurrentTexture.\n\n```go\nconst (\n\t// SurfaceGetCurrentTextureStatusSuccessOptimal indicates the texture was obtained optimally.\n\tSurfaceGetCurrentTextureStatusSuccessOptimal SurfaceGetCurrentTextureStatus = 0x00000001\n\t// SurfaceGetCurrentTextureStatusSuccessSuboptimal indicates the texture was obtained but may not be optimal.\n\tSurfaceGetCurrentTextureStatusSuccessSuboptimal SurfaceGetCurrentTextureStatus = 0x00000002\n\t// SurfaceGetCurrentTextureStatusTimeout indicates the operation timed out.\n\tSurfaceGetCurrentTextureStatusTimeout SurfaceGetCurrentTextureStatus = 0x00000003\n\t// SurfaceGetCurrentTextureStatusOutdated indicates the surface needs reconfiguration.\n\tSurfaceGetCurrentTextureStatusOutdated SurfaceGetCurrentTextureStatus = 0x00000004\n\t// SurfaceGetCurrentTextureStatusLost indicates the surface was lost and must be recreated.\n\tSurfaceGetCurrentTextureStatusLost SurfaceGetCurrentTextureStatus = 0x00000005\n\t// SurfaceGetCurrentTextureStatusError indicates a deterministic error (e.g. surface not configured).\n\t// BREAKING: v27 had OutOfMemory=0x06, DeviceLost=0x07, Error=0x08; v29 collapsed to Error=0x06.\n\tSurfaceGetCurrentTextureStatusError SurfaceGetCurrentTextureStatus = 0x00000006\n\n\t// NativeSurfaceGetCurrentTextureStatusOccluded is a wgpu-native extension status.\n\t// Returned on macOS Metal when the window is occluded/minimized.\n\tNativeSurfaceGetCurrentTextureStatusOccluded SurfaceGetCurrentTextureStatus = 0x00030001\n)\n```\n\n```go\ntype SurfaceTexture struct {\n\tTexture *Texture\n\tStatus  SurfaceGetCurrentTextureStatus\n}\n```\nSurfaceTexture holds the result of GetCurrentTexture.\n\n```go\ntype TexelCopyBufferInfo struct {\n\tLayout TexelCopyBufferLayout\n\tBuffer uintptr // Buffer handle\n}\n```\nTexelCopyBufferInfo describes a buffer source/destination for copy operations.\n\n```go\ntype TexelCopyBufferLayout struct {\n\tOffset       uint64\n\tBytesPerRow  uint32\n\tRowsPerImage uint32\n}\n```\nTexelCopyBufferLayout describes buffer layout for WriteTexture (low-level wire type). Prefer [ImageDataLayout](#ImageDataLayout) for new code.\n\n```go\ntype TexelCopyTextureInfo struct {\n\tTexture  uintptr\n\tMipLevel uint32\n\tOrigin   gputypes.Origin3D\n\tAspect   TextureAspect\n}\n```\nTexelCopyTextureInfo describes a texture for WriteTexture (low-level wire type). Prefer [ImageCopyTexture](#ImageCopyTexture) for new code — it holds a \\*Texture handle.\n\n```go\ntype Texture struct {\n\t// contains filtered or unexported fields\n}\n```\nTexture represents a GPU texture resource (1D, 2D, or 3D). Create with [Device.CreateTexture](#Device.CreateTexture), release with [Texture.Release](#Texture.Release).\n\n```go\nfunc (t *Texture) CreateView(desc *TextureViewDescriptor) (*TextureView, error)\n```\nCreateView creates a view into this texture. Pass nil for default view parameters. Enum values are converted from gputypes to wgpu-native values before FFI call. Returns an error if the FFI call fails or the texture is nil.\n\n```go\nfunc (t *Texture) DepthOrArrayLayers() uint32\n```\nDepthOrArrayLayers returns the depth (for 3D textures) or array layer count.\n\n```go\nfunc (t *Texture) Destroy()\n```\nDestroy destroys the texture.\n\n```go\nfunc (t *Texture) Format() gputypes.TextureFormat\n```\nFormat returns the texture format. TextureFormat values match between gputypes v0.3.0 and wgpu-native v29 exactly.\n\n```go\nfunc (t *Texture) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (t *Texture) Height() uint32\n```\nHeight returns the height of the texture in texels.\n\n```go\nfunc (t *Texture) MipLevelCount() uint32\n```\nMipLevelCount returns the number of mip levels.\n\n```go\nfunc (t *Texture) Release()\n```\nRelease releases the texture reference.\n\n```go\nfunc (t *Texture) Width() uint32\n```\nWidth returns the width of the texture in texels.\n\n```go\ntype TextureAspect uint32\n```\nTextureAspect describes which aspect of a texture to access.\n\n```go\nconst (\n\t// TextureAspectUndefined leaves the texture aspect unspecified.\n\tTextureAspectUndefined TextureAspect = 0x00\n\t// TextureAspectAll accesses all aspects of the texture.\n\tTextureAspectAll TextureAspect = 0x01\n\t// TextureAspectStencilOnly accesses only the stencil aspect of a depth-stencil texture.\n\tTextureAspectStencilOnly TextureAspect = 0x02\n\t// TextureAspectDepthOnly accesses only the depth aspect of a depth-stencil texture.\n\tTextureAspectDepthOnly TextureAspect = 0x03\n)\n```\n\n```go\ntype TextureBindingLayout = gputypes.TextureBindingLayout\n```\nTextureBindingLayout describes texture binding properties.\n\nThis type matches gputypes.TextureBindingLayout for cross-project compatibility. Used as a pointer field in BindGroupLayoutEntry; nil means \"not a texture binding\".\n\n```go\ntype TextureCopy struct {\n\t// Source describes the source texture subresource and origin.\n\tSource ImageCopyTexture\n\t// Destination describes the destination texture subresource and origin.\n\tDestination ImageCopyTexture\n\t// Size is the extent of the copy operation.\n\tSize gputypes.Extent3D\n}\n```\nTextureCopy describes a texture-to-texture copy region. Matches gogpu/wgpu TextureCopy.\n\n```go\ntype TextureDescriptor struct {\n\tLabel         string\n\tUsage         gputypes.TextureUsage\n\tDimension     gputypes.TextureDimension\n\tSize          gputypes.Extent3D\n\tFormat        gputypes.TextureFormat\n\tMipLevelCount uint32\n\tSampleCount   uint32\n\tViewFormats   []gputypes.TextureFormat\n}\n```\nTextureDescriptor describes a texture to create.\n\n```go\ntype TextureDimension = gputypes.TextureDimension\n```\n\n```go\ntype TextureFormat = gputypes.TextureFormat\n```\nTexture types. TextureAspect is defined as a native enum in enums.go.\n\n```go\ntype TextureSampleType = gputypes.TextureSampleType\n```\n\n```go\ntype TextureUsage = gputypes.TextureUsage\n```\nTexture usage type.\n\n```go\ntype TextureView struct {\n\t// contains filtered or unexported fields\n}\n```\nTextureView is a view into a subset of a [Texture](#Texture), used in bind groups and render passes. Create with [Texture.CreateView](#Texture.CreateView), release with [TextureView.Release](#TextureView.Release).\n\n```go\nfunc (tv *TextureView) Handle() uintptr\n```\nHandle returns the underlying handle. For advanced use only.\n\n```go\nfunc (tv *TextureView) Release()\n```\nRelease releases the texture view reference.\n\n```go\ntype TextureViewDescriptor struct {\n\tLabel           string\n\tFormat          gputypes.TextureFormat\n\tDimension       gputypes.TextureViewDimension\n\tBaseMipLevel    uint32\n\tMipLevelCount   uint32\n\tBaseArrayLayer  uint32\n\tArrayLayerCount uint32\n\tAspect          TextureAspect\n\tUsage           gputypes.TextureUsage\n}\n```\nTextureViewDescriptor describes a texture view to create.\n\n```go\ntype TextureViewDimension = gputypes.TextureViewDimension\n```\n\n```go\ntype ToneMappingMode uint32\n```\nToneMappingMode describes tone mapping for HDR surfaces. New in v29.\n\n```go\nconst (\n\t// ToneMappingModeStandard is standard tone mapping (sRGB).\n\tToneMappingModeStandard ToneMappingMode = 0x00000001\n\t// ToneMappingModeExtended is extended (HDR) tone mapping.\n\tToneMappingModeExtended ToneMappingMode = 0x00000002\n)\n```\n\n```go\ntype UncapturedErrorCallbackInfo struct {\n\tNextInChain uintptr // *ChainedStruct\n\tCallback    uintptr // Function pointer\n\tUserdata1   uintptr\n\tUserdata2   uintptr\n}\n```\nUncapturedErrorCallbackInfo configures the uncaptured-error callback.\n\n```go\ntype Vec3 struct {\n\tX, Y, Z float32\n}\n```\nVec3 represents a 3D vector with X, Y, Z components.\n\n```go\nfunc (v Vec3) Cross(other Vec3) Vec3\n```\nCross computes the cross product of this vector with another. Returns v × other (perpendicular to both vectors). Result follows right-hand rule.\n\n```go\nfunc (v Vec3) Dot(other Vec3) float32\n```\nDot computes the dot product of this vector with another. Returns v · other (scalar projection).\n\n```go\nfunc (v Vec3) Normalize() Vec3\n```\nNormalize returns a unit vector in the same direction as v. If v has zero length, returns zero vector.\n\n```go\nfunc (v Vec3) Sub(other Vec3) Vec3\n```\nSub subtracts another vector from this vector. Returns v - other.\n\n```go\ntype Vec4 struct {\n\tX, Y, Z, W float32\n}\n```\nVec4 represents a 4D vector with X, Y, Z, W components. Compatible with WGSL vec4\\\u003cf32\u003e.\n\n```go\ntype VertexAttribute struct {\n\tFormat         gputypes.VertexFormat\n\tOffset         uint64\n\tShaderLocation uint32\n\t// contains filtered or unexported fields\n}\n```\nVertexAttribute describes a vertex attribute.\n\n```go\ntype VertexBufferLayout struct {\n\tArrayStride uint64\n\tStepMode    gputypes.VertexStepMode\n\n\tAttributeCount uintptr\n\tAttributes     *VertexAttribute\n\t// contains filtered or unexported fields\n}\n```\nVertexBufferLayout describes how vertex data is laid out in a buffer.\n\n```go\ntype VertexFormat = gputypes.VertexFormat\n```\nVertex types.\n\n```go\ntype VertexState struct {\n\tModule     *ShaderModule\n\tEntryPoint string\n\tBuffers    []VertexBufferLayout\n}\n```\nVertexState describes the vertex stage of a render pipeline.\n\n```go\ntype VertexStepMode = gputypes.VertexStepMode\n```\n\n```go\ntype WGPUError struct {\n\t// Op is the operation that failed (e.g., \"CreateBuffer\", \"RequestAdapter\").\n\tOp string\n\t// Type is the WebGPU error type (Validation, OutOfMemory, Internal).\n\tType ErrorType\n\t// Message is the error message from wgpu-native.\n\tMessage string\n}\n```\nWGPUError represents a WebGPU operation error with context. Supports errors.Is() and errors.As() for programmatic handling.\n\n```go\nfunc (e *WGPUError) Error() string\n```\nError returns a formatted error string including the operation name and message.\n\n```go\nfunc (e *WGPUError) Is(target error) bool\n```\nIs supports errors.Is() matching by error Type. This allows: errors.Is(err, wgpu.ErrValidation)\n\n```go\ntype WGPUStatus uint32\n```\nWGPUStatus describes the status returned from certain WebGPU operations. Note: v29 changed Success from 0x00 to 0x01 and Error from 0x01 to 0x02.\n\n```go\nconst (\n\t// WGPUStatusSuccess indicates the operation completed successfully.\n\tWGPUStatusSuccess WGPUStatus = 0x00000001\n\t// WGPUStatusError indicates the operation failed.\n\tWGPUStatusError WGPUStatus = 0x00000002\n)\n```\n\n","path":"github.com/go-webgpu/webgpu/wgpu","name":"wgpu","synopsis":"Package wgpu provides Zero-CGO WebGPU bindings for Go.","isRedistributable":true}
