Class Device

An open connection to a graphics and/or compute device.

class Device ;

The Device is the responsible for the creation of most rendering and compute resources, as well as exposing Queue objects.

Fields

NameTypeDescription
label stringLabel for this Device.
status RequestDeviceStatus

Properties

NameTypeDescription
ready[get] boolWhether this Device handle is valid and ready for use.

Methods

NameDescription
createBindGroup (layout, entries, label) Creates a new bind group.
createBindGroupLayout (entries, label) Creates a bind group layout.
createBuffer (usage, size, label) Creates a new buffer.
createBuffer (usage, size, mappedAtCreation, label) Creates a new buffer.
createBuffer (descriptor) Creates a new buffer.
createCommandEncoder (label) Creates an empty CommandEncoder.
createCommandEncoder (descriptor) Creates an empty CommandEncoder.
createComputePipeline (descriptor) Creates a compute pipeline.
createPipelineLayout (bindGroups, label) Creates a bind group PipelineLayout.
createRenderPipeline (layout, vertexState, primitiveState, multisampleState, fragmentState, label) Creates a render pipeline.
createRenderPipeline (layout, vertexState, primitiveState, depthStencilState, multisampleState, fragmentState, label) Creates a render pipeline.
createSampler (descriptor) Creates a new Sampler.
createSampler (addressMode, magFilter, minFilter, mipmapFilter) Creates a new Sampler.
createShaderModule (spv) Creates a shader module from SPIR-V source code.
createShaderModule (wgsl) Creates a shader module from WGSL source code.
createSwapChain (surface, width, height, format, usage, presentMode, label) Create a new SwapChain which targets surface.
createTexture (width, height, format, usage, dimension, mipLevelCount, sampleCount, depthOrArrayLayers, label) Creates a new Texture.
createTexture (extent, format, usage, dimension, mipLevelCount, sampleCount, label) Creates a new Texture.
createTexture (descriptor) Creates a new Texture.
destroy () Release the given handle.
emptyPipelineLayout (label) Creates an empty PipelineLayout that has no bindings.
limits () List all limits that were requested of this device.
poll (forceWait) Check for resource cleanups and mapping callbacks.
poll (queue, submissionIndex, forceWait) Check for resource cleanups and mapping callbacks.
queue () Obtains a queue which can accept CommandBuffer submissions.
setUncapturedErrorCallback (callback, userData)

See Also

wgpu::Device