414 lines
101 KiB
HTML
414 lines
101 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A connection to a GPU and a pool of resources to use with it."><title>Device in wgpu_hal - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="wgpu_hal" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../wgpu_hal/index.html">wgpu_<wbr>hal</a><span class="version">23.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Device</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#safety" title="Safety">Safety</a></li></ul><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.A" title="A">A</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.add_raw_buffer" title="add_raw_buffer">add_raw_buffer</a></li><li><a href="#tymethod.add_raw_texture" title="add_raw_texture">add_raw_texture</a></li><li><a href="#tymethod.create_acceleration_structure" title="create_acceleration_structure">create_acceleration_structure</a></li><li><a href="#tymethod.create_bind_group" title="create_bind_group">create_bind_group</a></li><li><a href="#tymethod.create_bind_group_layout" title="create_bind_group_layout">create_bind_group_layout</a></li><li><a href="#tymethod.create_buffer" title="create_buffer">create_buffer</a></li><li><a href="#tymethod.create_command_encoder" title="create_command_encoder">create_command_encoder</a></li><li><a href="#tymethod.create_compute_pipeline" title="create_compute_pipeline">create_compute_pipeline</a></li><li><a href="#tymethod.create_fence" title="create_fence">create_fence</a></li><li><a href="#tymethod.create_pipeline_cache" title="create_pipeline_cache">create_pipeline_cache</a></li><li><a href="#tymethod.create_pipeline_layout" title="create_pipeline_layout">create_pipeline_layout</a></li><li><a href="#tymethod.create_query_set" title="create_query_set">create_query_set</a></li><li><a href="#tymethod.create_render_pipeline" title="create_render_pipeline">create_render_pipeline</a></li><li><a href="#tymethod.create_sampler" title="create_sampler">create_sampler</a></li><li><a href="#tymethod.create_shader_module" title="create_shader_module">create_shader_module</a></li><li><a href="#tymethod.create_texture" title="create_texture">create_texture</a></li><li><a href="#tymethod.create_texture_view" title="create_texture_view">create_texture_view</a></li><li><a href="#tymethod.destroy_acceleration_structure" title="destroy_acceleration_structure">destroy_acceleration_structure</a></li><li><a href="#tymethod.destroy_bind_group" title="destroy_bind_group">destroy_bind_group</a></li><li><a href="#tymethod.destroy_bind_group_layout" title="destroy_bind_group_layout">destroy_bind_group_layout</a></li><li><a href="#tymethod.destroy_buffer" title="destroy_buffer">destroy_buffer</a></li><li><a href="#tymethod.destroy_command_encoder" title="destroy_command_encoder">destroy_command_encoder</a></li><li><a href="#tymethod.destroy_compute_pipeline" title="destroy_compute_pipeline">destroy_compute_pipeline</a></li><li><a href="#tymethod.destroy_fence" title="destroy_fence">destroy_fence</a></li><li><a href="#tymethod.destroy_pipeline_cache" title="destroy_pipeline_cache">destroy_pipeline_cache</a></li><li><a href="#tymethod.destroy_pipeline_layout" title="destroy_pipeline_layout">destroy_pipeline_layout</a></li><li><a href="#tymethod.destroy_query_set" title="destroy_query_set">destroy_query_set</a></li><li><a href="#tymethod.destroy_render_pipeline" title="destroy_render_pipeline">destroy_render_pipeline</a></li><li><a href="#tymethod.destroy_sampler" title="destroy_sampler">destroy_sampler</a></li><li><a href="#tymethod.destroy_shader_module" title="destroy_shader_module">destroy_shader_module</a></li><li><a href="#tymethod.destroy_texture" title="destroy_texture">destroy_texture</a></li><li><a href="#tymethod.destroy_texture_view" title="destroy_texture_view">destroy_texture_view</a></li><li><a href="#tymethod.exit" title="exit">exit</a></li><li><a href="#tymethod.flush_mapped_ranges" title="flush_mapped_ranges">flush_mapped_ranges</a></li><li><a href="#tymethod.get_acceleration_structure_build_sizes" title="get_acceleration_structure_build_sizes">get_acceleration_structure_build_sizes</a></li><li><a href="#tymethod.get_acceleration_structure_device_address" title="get_acceleration_structure_device_address">get_acceleration_structure_device_address</a></li><li><a href="#tymethod.get_fence_value" title="get_fence_value">get_fence_value</a></li><li><a href="#tymethod.get_internal_counters" title="get_internal_counters">get_internal_counters</a></li><li><a href="#tymethod.invalidate_mapped_ranges" title="invalidate_mapped_ranges">invalidate_mapped_ranges</a></li><li><a href="#tymethod.map_buffer" title="map_buffer">map_buffer</a></li><li><a href="#tymethod.start_capture" title="start_capture">start_capture</a></li><li><a href="#tymethod.stop_capture" title="stop_capture">stop_capture</a></li><li><a href="#tymethod.unmap_buffer" title="unmap_buffer">unmap_buffer</a></li><li><a href="#tymethod.wait" title="wait">wait</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.generate_allocator_report" title="generate_allocator_report">generate_allocator_report</a></li><li><a href="#method.pipeline_cache_get_data" title="pipeline_cache_get_data">pipeline_cache_get_data</a></li><li><a href="#method.pipeline_cache_validation_key" title="pipeline_cache_validation_key">pipeline_cache_validation_key</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate wgpu_<wbr>hal</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">wgpu_hal</a></span><h1>Trait <span class="trait">Device</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/wgpu_hal/lib.rs.html#702-978">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Device: <a class="trait" href="../wgpu_types/send_sync/trait.WasmNotSendSync.html" title="trait wgpu_types::send_sync::WasmNotSendSync">WasmNotSendSync</a> {
|
||
type <a href="#associatedtype.A" class="associatedtype">A</a>: <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>;
|
||
|
||
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 47 methods</span></summary> // Required methods
|
||
unsafe fn <a href="#tymethod.exit" class="fn">exit</a>(self, queue: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Queue" title="type wgpu_hal::Api::Queue">Queue</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_buffer" class="fn">create_buffer</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.BufferDescriptor.html" title="struct wgpu_hal::BufferDescriptor">BufferDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_buffer" class="fn">destroy_buffer</a>(&self, buffer: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.add_raw_buffer" class="fn">add_raw_buffer</a>(&self, buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.map_buffer" class="fn">map_buffer</a>(
|
||
&self,
|
||
buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>,
|
||
range: <a class="type" href="type.MemoryRange.html" title="type wgpu_hal::MemoryRange">MemoryRange</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.BufferMapping.html" title="struct wgpu_hal::BufferMapping">BufferMapping</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.unmap_buffer" class="fn">unmap_buffer</a>(&self, buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.flush_mapped_ranges" class="fn">flush_mapped_ranges</a><I>(
|
||
&self,
|
||
buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>,
|
||
ranges: I,
|
||
)
|
||
<span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="type" href="type.MemoryRange.html" title="type wgpu_hal::MemoryRange">MemoryRange</a>></span>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.invalidate_mapped_ranges" class="fn">invalidate_mapped_ranges</a><I>(
|
||
&self,
|
||
buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>,
|
||
ranges: I,
|
||
)
|
||
<span class="where">where I: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="type" href="type.MemoryRange.html" title="type wgpu_hal::MemoryRange">MemoryRange</a>></span>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_texture" class="fn">create_texture</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.TextureDescriptor.html" title="struct wgpu_hal::TextureDescriptor">TextureDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_texture" class="fn">destroy_texture</a>(&self, texture: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.add_raw_texture" class="fn">add_raw_texture</a>(&self, texture: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_texture_view" class="fn">create_texture_view</a>(
|
||
&self,
|
||
texture: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>,
|
||
desc: &<a class="struct" href="struct.TextureViewDescriptor.html" title="struct wgpu_hal::TextureViewDescriptor">TextureViewDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.TextureView" title="type wgpu_hal::Api::TextureView">TextureView</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_texture_view" class="fn">destroy_texture_view</a>(&self, view: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.TextureView" title="type wgpu_hal::Api::TextureView">TextureView</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_sampler" class="fn">create_sampler</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.SamplerDescriptor.html" title="struct wgpu_hal::SamplerDescriptor">SamplerDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Sampler" title="type wgpu_hal::Api::Sampler">Sampler</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_sampler" class="fn">destroy_sampler</a>(&self, sampler: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Sampler" title="type wgpu_hal::Api::Sampler">Sampler</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_command_encoder" class="fn">create_command_encoder</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.CommandEncoderDescriptor.html" title="struct wgpu_hal::CommandEncoderDescriptor">CommandEncoderDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Queue" title="type wgpu_hal::Api::Queue">Queue</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.CommandEncoder" title="type wgpu_hal::Api::CommandEncoder">CommandEncoder</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_command_encoder" class="fn">destroy_command_encoder</a>(
|
||
&self,
|
||
pool: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.CommandEncoder" title="type wgpu_hal::Api::CommandEncoder">CommandEncoder</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_bind_group_layout" class="fn">create_bind_group_layout</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.BindGroupLayoutDescriptor.html" title="struct wgpu_hal::BindGroupLayoutDescriptor">BindGroupLayoutDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_bind_group_layout" class="fn">destroy_bind_group_layout</a>(
|
||
&self,
|
||
bg_layout: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_pipeline_layout" class="fn">create_pipeline_layout</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.PipelineLayoutDescriptor.html" title="struct wgpu_hal::PipelineLayoutDescriptor">PipelineLayoutDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_pipeline_layout" class="fn">destroy_pipeline_layout</a>(
|
||
&self,
|
||
pipeline_layout: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_bind_group" class="fn">create_bind_group</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.BindGroupDescriptor.html" title="struct wgpu_hal::BindGroupDescriptor">BindGroupDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Sampler" title="type wgpu_hal::Api::Sampler">Sampler</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.TextureView" title="type wgpu_hal::Api::TextureView">TextureView</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroup" title="type wgpu_hal::Api::BindGroup">BindGroup</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_bind_group" class="fn">destroy_bind_group</a>(&self, group: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroup" title="type wgpu_hal::Api::BindGroup">BindGroup</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_shader_module" class="fn">create_shader_module</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.ShaderModuleDescriptor.html" title="struct wgpu_hal::ShaderModuleDescriptor">ShaderModuleDescriptor</a><'_>,
|
||
shader: <a class="enum" href="enum.ShaderInput.html" title="enum wgpu_hal::ShaderInput">ShaderInput</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>, <a class="enum" href="enum.ShaderError.html" title="enum wgpu_hal::ShaderError">ShaderError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_shader_module" class="fn">destroy_shader_module</a>(
|
||
&self,
|
||
module: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_render_pipeline" class="fn">create_render_pipeline</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.RenderPipelineDescriptor.html" title="struct wgpu_hal::RenderPipelineDescriptor">RenderPipelineDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.RenderPipeline" title="type wgpu_hal::Api::RenderPipeline">RenderPipeline</a>, <a class="enum" href="enum.PipelineError.html" title="enum wgpu_hal::PipelineError">PipelineError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_render_pipeline" class="fn">destroy_render_pipeline</a>(
|
||
&self,
|
||
pipeline: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.RenderPipeline" title="type wgpu_hal::Api::RenderPipeline">RenderPipeline</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_compute_pipeline" class="fn">create_compute_pipeline</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.ComputePipelineDescriptor.html" title="struct wgpu_hal::ComputePipelineDescriptor">ComputePipelineDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ComputePipeline" title="type wgpu_hal::Api::ComputePipeline">ComputePipeline</a>, <a class="enum" href="enum.PipelineError.html" title="enum wgpu_hal::PipelineError">PipelineError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_compute_pipeline" class="fn">destroy_compute_pipeline</a>(
|
||
&self,
|
||
pipeline: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ComputePipeline" title="type wgpu_hal::Api::ComputePipeline">ComputePipeline</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_pipeline_cache" class="fn">create_pipeline_cache</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.PipelineCacheDescriptor.html" title="struct wgpu_hal::PipelineCacheDescriptor">PipelineCacheDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>, <a class="enum" href="enum.PipelineCacheError.html" title="enum wgpu_hal::PipelineCacheError">PipelineCacheError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_pipeline_cache" class="fn">destroy_pipeline_cache</a>(
|
||
&self,
|
||
cache: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>,
|
||
);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_query_set" class="fn">create_query_set</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="../wgpu_types/struct.QuerySetDescriptor.html" title="struct wgpu_types::QuerySetDescriptor">QuerySetDescriptor</a><<a class="type" href="type.Label.html" title="type wgpu_hal::Label">Label</a><'_>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.QuerySet" title="type wgpu_hal::Api::QuerySet">QuerySet</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_query_set" class="fn">destroy_query_set</a>(&self, set: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.QuerySet" title="type wgpu_hal::Api::QuerySet">QuerySet</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_fence" class="fn">create_fence</a>(
|
||
&self,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_fence" class="fn">destroy_fence</a>(&self, fence: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.get_fence_value" class="fn">get_fence_value</a>(
|
||
&self,
|
||
fence: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.FenceValue.html" title="type wgpu_hal::FenceValue">FenceValue</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.wait" class="fn">wait</a>(
|
||
&self,
|
||
fence: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>,
|
||
value: <a class="type" href="type.FenceValue.html" title="type wgpu_hal::FenceValue">FenceValue</a>,
|
||
timeout_ms: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.start_capture" class="fn">start_capture</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.stop_capture" class="fn">stop_capture</a>(&self);
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.create_acceleration_structure" class="fn">create_acceleration_structure</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.AccelerationStructureDescriptor.html" title="struct wgpu_hal::AccelerationStructureDescriptor">AccelerationStructureDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.get_acceleration_structure_build_sizes" class="fn">get_acceleration_structure_build_sizes</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.GetAccelerationStructureBuildSizesDescriptor.html" title="struct wgpu_hal::GetAccelerationStructureBuildSizesDescriptor">GetAccelerationStructureBuildSizesDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>>,
|
||
) -> <a class="struct" href="struct.AccelerationStructureBuildSizes.html" title="struct wgpu_hal::AccelerationStructureBuildSizes">AccelerationStructureBuildSizes</a>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.get_acceleration_structure_device_address" class="fn">get_acceleration_structure_device_address</a>(
|
||
&self,
|
||
acceleration_structure: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>,
|
||
) -> <a class="type" href="../wgpu_types/type.BufferAddress.html" title="type wgpu_types::BufferAddress">BufferAddress</a>;
|
||
<span class="item-spacer"></span> unsafe fn <a href="#tymethod.destroy_acceleration_structure" class="fn">destroy_acceleration_structure</a>(
|
||
&self,
|
||
acceleration_structure: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>,
|
||
);
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.get_internal_counters" class="fn">get_internal_counters</a>(&self) -> <a class="struct" href="../wgpu_types/counters/struct.HalCounters.html" title="struct wgpu_types::counters::HalCounters">HalCounters</a>;
|
||
|
||
// Provided methods
|
||
fn <a href="#method.pipeline_cache_validation_key" class="fn">pipeline_cache_validation_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><[<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.array.html">16</a>]> { ... }
|
||
<span class="item-spacer"></span> unsafe fn <a href="#method.pipeline_cache_get_data" class="fn">pipeline_cache_get_data</a>(
|
||
&self,
|
||
cache: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>>> { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.generate_allocator_report" class="fn">generate_allocator_report</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../wgpu_types/counters/struct.AllocatorReport.html" title="struct wgpu_types::counters::AllocatorReport">AllocatorReport</a>> { ... }
|
||
</details>}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A connection to a GPU and a pool of resources to use with it.</p>
|
||
<p>A <code>wgpu-hal</code> <code>Device</code> represents an open connection to a specific graphics
|
||
processor, controlled via the backend <a href="trait.Device.html#associatedtype.A" title="associated type wgpu_hal::Device::A"><code>Device::A</code></a>. A <code>Device</code> is mostly
|
||
used for creating resources. Each <code>Device</code> has an associated <a href="trait.Queue.html" title="trait wgpu_hal::Queue"><code>Queue</code></a> used
|
||
for command submission.</p>
|
||
<p>On Vulkan a <code>Device</code> corresponds to a logical device (<a href="https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VkDevice"><code>VkDevice</code></a>). Other
|
||
backends don’t have an exact analog: for example, <a href="https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nn-d3d12-id3d12device"><code>ID3D12Device</code></a>s and
|
||
<a href="https://developer.apple.com/documentation/metal/mtldevice"><code>MTLDevice</code></a>s are owned by the backends’ <a href="trait.Adapter.html" title="trait wgpu_hal::Adapter"><code>wgpu_hal::Adapter</code></a>
|
||
implementations, and shared by all <a href="trait.Device.html" title="trait wgpu_hal::Device"><code>wgpu_hal::Device</code></a>s created from that
|
||
<code>Adapter</code>.</p>
|
||
<p>A <code>Device</code>’s life cycle is generally:</p>
|
||
<ol>
|
||
<li>
|
||
<p>Obtain a <code>Device</code> and its associated <a href="trait.Queue.html" title="trait wgpu_hal::Queue"><code>Queue</code></a> by calling
|
||
<a href="trait.Adapter.html#tymethod.open" title="method wgpu_hal::Adapter::open"><code>Adapter::open</code></a>.</p>
|
||
<p>Alternatively, the backend-specific types that implement <a href="trait.Adapter.html" title="trait wgpu_hal::Adapter"><code>Adapter</code></a> often
|
||
have methods for creating a <code>wgpu-hal</code> <code>Device</code> from a platform-specific
|
||
handle. For example, <a href="vulkan/struct.Adapter.html#method.device_from_raw"><code>vulkan::Adapter::device_from_raw</code></a> can create a
|
||
<a href="vulkan/struct.Device.html"><code>vulkan::Device</code></a> from an <a href="https://docs.rs/ash/latest/ash/struct.Device.html"><code>ash::Device</code></a>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Create resources to use on the device by calling methods like
|
||
<a href="trait.Device.html#tymethod.create_texture" title="method wgpu_hal::Device::create_texture"><code>Device::create_texture</code></a> or <a href="trait.Device.html#tymethod.create_shader_module" title="method wgpu_hal::Device::create_shader_module"><code>Device::create_shader_module</code></a>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Call <a href="trait.Device.html#tymethod.create_command_encoder" title="method wgpu_hal::Device::create_command_encoder"><code>Device::create_command_encoder</code></a> to obtain a <a href="trait.CommandEncoder.html" title="trait wgpu_hal::CommandEncoder"><code>CommandEncoder</code></a>,
|
||
which you can use to build <a href="trait.Api.html#associatedtype.CommandBuffer" title="associated type wgpu_hal::Api::CommandBuffer"><code>CommandBuffer</code></a>s holding commands to be
|
||
executed on the GPU.</p>
|
||
</li>
|
||
<li>
|
||
<p>Call <a href="trait.Queue.html#tymethod.submit" title="method wgpu_hal::Queue::submit"><code>Queue::submit</code></a> on the <code>Device</code>’s associated <a href="trait.Queue.html" title="trait wgpu_hal::Queue"><code>Queue</code></a> to submit
|
||
<a href="trait.Api.html#associatedtype.CommandBuffer" title="associated type wgpu_hal::Api::CommandBuffer"><code>CommandBuffer</code></a>s for execution on the GPU. If needed, call
|
||
<a href="trait.Device.html#tymethod.wait" title="method wgpu_hal::Device::wait"><code>Device::wait</code></a> to wait for them to finish execution.</p>
|
||
</li>
|
||
<li>
|
||
<p>Free resources with methods like <a href="trait.Device.html#tymethod.destroy_texture" title="method wgpu_hal::Device::destroy_texture"><code>Device::destroy_texture</code></a> or
|
||
<a href="trait.Device.html#tymethod.destroy_shader_module" title="method wgpu_hal::Device::destroy_shader_module"><code>Device::destroy_shader_module</code></a>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Shut down the device by calling <a href="trait.Device.html#tymethod.exit" title="method wgpu_hal::Device::exit"><code>Device::exit</code></a>.</p>
|
||
</li>
|
||
</ol>
|
||
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
|
||
<p>As with other <code>wgpu-hal</code> APIs, <a href="index.html#validation-is-the-calling-codes-responsibility-not-wgpu-hals">validation</a> is the caller’s
|
||
responsibility. Here are the general requirements for all <code>Device</code>
|
||
methods:</p>
|
||
<ul>
|
||
<li>
|
||
<p>Any resource passed to a <code>Device</code> method must have been created by that
|
||
<code>Device</code>. For example, a <a href="trait.Api.html#associatedtype.Texture" title="associated type wgpu_hal::Api::Texture"><code>Texture</code></a> passed to <a href="trait.Device.html#tymethod.destroy_texture" title="method wgpu_hal::Device::destroy_texture"><code>Device::destroy_texture</code></a> must
|
||
have been created with the <code>Device</code> passed as <code>self</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Resources may not be destroyed if they are used by any submitted command
|
||
buffers that have not yet finished execution.</p>
|
||
</li>
|
||
</ul>
|
||
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><section id="associatedtype.A" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#703">Source</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a>: <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a></h4></section></div><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.exit" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#706">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.exit" class="fn">exit</a>(self, queue: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Queue" title="type wgpu_hal::Api::Queue">Queue</a>)</h4></section></summary><div class="docblock"><p>Exit connection to this logical device.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.create_buffer" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#710-713">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_buffer" class="fn">create_buffer</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.BufferDescriptor.html" title="struct wgpu_hal::BufferDescriptor">BufferDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section></summary><div class="docblock"><p>Creates a new buffer.</p>
|
||
<p>The initial usage is <code>BufferUses::empty()</code>.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.destroy_buffer" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#724">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_buffer" class="fn">destroy_buffer</a>(&self, buffer: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>)</h4></section></summary><div class="docblock"><p>Free <code>buffer</code> and any GPU resources it owns.</p>
|
||
<p>Note that backends are allowed to allocate GPU memory for buffers from
|
||
allocation pools, and this call is permitted to simply return <code>buffer</code>’s
|
||
storage to that pool, without making it available to other applications.</p>
|
||
<h5 id="safety-1"><a class="doc-anchor" href="#safety-1">§</a>Safety</h5>
|
||
<ul>
|
||
<li>The given <code>buffer</code> must not currently be mapped.</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.add_raw_buffer" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#727">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.add_raw_buffer" class="fn">add_raw_buffer</a>(&self, buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>)</h4></section></summary><div class="docblock"><p>A hook for when a wgpu-core buffer is created from a raw wgpu-hal buffer.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.map_buffer" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#777-781">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.map_buffer" class="fn">map_buffer</a>(
|
||
&self,
|
||
buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>,
|
||
range: <a class="type" href="type.MemoryRange.html" title="type wgpu_hal::MemoryRange">MemoryRange</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="struct.BufferMapping.html" title="struct wgpu_hal::BufferMapping">BufferMapping</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section></summary><div class="docblock"><p>Return a pointer to CPU memory mapping the contents of <code>buffer</code>.</p>
|
||
<p>Buffer mappings are persistent: the buffer may remain mapped on the CPU
|
||
while the GPU reads or writes to it. (Note that <code>wgpu_core</code> does not use
|
||
this feature: when a <code>wgpu_core::Buffer</code> is unmapped, the underlying
|
||
<code>wgpu_hal</code> buffer is also unmapped.)</p>
|
||
<p>If this function returns <code>Ok(mapping)</code>, then:</p>
|
||
<ul>
|
||
<li>
|
||
<p><code>mapping.ptr</code> is the CPU address of the start of the mapped memory.</p>
|
||
</li>
|
||
<li>
|
||
<p>If <code>mapping.is_coherent</code> is <code>true</code>, then CPU writes to the mapped
|
||
memory are immediately visible on the GPU, and vice versa.</p>
|
||
</li>
|
||
</ul>
|
||
<h5 id="safety-2"><a class="doc-anchor" href="#safety-2">§</a>Safety</h5>
|
||
<ul>
|
||
<li>
|
||
<p>The given <code>buffer</code> must have been created with the <a href="struct.BufferUses.html#associatedconstant.MAP_READ" title="associated constant wgpu_hal::BufferUses::MAP_READ"><code>MAP_READ</code></a> or
|
||
<a href="struct.BufferUses.html#associatedconstant.MAP_WRITE" title="associated constant wgpu_hal::BufferUses::MAP_WRITE"><code>MAP_WRITE</code></a> flags set in <a href="struct.BufferDescriptor.html#structfield.usage" title="field wgpu_hal::BufferDescriptor::usage"><code>BufferDescriptor::usage</code></a>.</p>
|
||
</li>
|
||
<li>
|
||
<p>The given <code>range</code> must fall within the size of <code>buffer</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>The caller must avoid data races between the CPU and the GPU. A data
|
||
race is any pair of accesses to a particular byte, one of which is a
|
||
write, that are not ordered with respect to each other by some sort of
|
||
synchronization operation.</p>
|
||
</li>
|
||
<li>
|
||
<p>If this function returns <code>Ok(mapping)</code> and <code>mapping.is_coherent</code> is
|
||
<code>false</code>, then:</p>
|
||
<ul>
|
||
<li>
|
||
<p>Every CPU write to a mapped byte followed by a GPU read of that byte
|
||
must have at least one call to <a href="trait.Device.html#tymethod.flush_mapped_ranges" title="method wgpu_hal::Device::flush_mapped_ranges"><code>Device::flush_mapped_ranges</code></a>
|
||
covering that byte that occurs between those two accesses.</p>
|
||
</li>
|
||
<li>
|
||
<p>Every GPU write to a mapped byte followed by a CPU read of that byte
|
||
must have at least one call to <a href="trait.Device.html#tymethod.invalidate_mapped_ranges" title="method wgpu_hal::Device::invalidate_mapped_ranges"><code>Device::invalidate_mapped_ranges</code></a>
|
||
covering that byte that occurs between those two accesses.</p>
|
||
</li>
|
||
</ul>
|
||
<p>Note that the data race rule above requires that all such access pairs
|
||
be ordered, so it is meaningful to talk about what must occur
|
||
“between” them.</p>
|
||
</li>
|
||
<li>
|
||
<p>Zero-sized mappings are not allowed.</p>
|
||
</li>
|
||
<li>
|
||
<p>The returned <a href="struct.BufferMapping.html#structfield.ptr" title="field wgpu_hal::BufferMapping::ptr"><code>BufferMapping::ptr</code></a> must not be used after a call to
|
||
<a href="trait.Device.html#tymethod.unmap_buffer" title="method wgpu_hal::Device::unmap_buffer"><code>Device::unmap_buffer</code></a>.</p>
|
||
</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.unmap_buffer" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#788">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.unmap_buffer" class="fn">unmap_buffer</a>(&self, buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>)</h4></section></summary><div class="docblock"><p>Remove the mapping established by the last call to <a href="trait.Device.html#tymethod.map_buffer" title="method wgpu_hal::Device::map_buffer"><code>Device::map_buffer</code></a>.</p>
|
||
<h5 id="safety-3"><a class="doc-anchor" href="#safety-3">§</a>Safety</h5>
|
||
<ul>
|
||
<li>The given <code>buffer</code> must be currently mapped.</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.flush_mapped_ranges" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#797-799">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.flush_mapped_ranges" class="fn">flush_mapped_ranges</a><I>(
|
||
&self,
|
||
buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>,
|
||
ranges: I,
|
||
)<div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="type" href="type.MemoryRange.html" title="type wgpu_hal::MemoryRange">MemoryRange</a>>,</div></h4></section></summary><div class="docblock"><p>Indicate that CPU writes to mapped buffer memory should be made visible to the GPU.</p>
|
||
<h5 id="safety-4"><a class="doc-anchor" href="#safety-4">§</a>Safety</h5>
|
||
<ul>
|
||
<li>
|
||
<p>The given <code>buffer</code> must be currently mapped.</p>
|
||
</li>
|
||
<li>
|
||
<p>All ranges produced by <code>ranges</code> must fall within <code>buffer</code>’s size.</p>
|
||
</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.invalidate_mapped_ranges" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#808-810">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.invalidate_mapped_ranges" class="fn">invalidate_mapped_ranges</a><I>(
|
||
&self,
|
||
buffer: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>,
|
||
ranges: I,
|
||
)<div class="where">where
|
||
I: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/iter/traits/iterator/trait.Iterator.html" title="trait core::iter::traits::iterator::Iterator">Iterator</a><Item = <a class="type" href="type.MemoryRange.html" title="type wgpu_hal::MemoryRange">MemoryRange</a>>,</div></h4></section></summary><div class="docblock"><p>Indicate that GPU writes to mapped buffer memory should be made visible to the CPU.</p>
|
||
<h5 id="safety-5"><a class="doc-anchor" href="#safety-5">§</a>Safety</h5>
|
||
<ul>
|
||
<li>
|
||
<p>The given <code>buffer</code> must be currently mapped.</p>
|
||
</li>
|
||
<li>
|
||
<p>All ranges produced by <code>ranges</code> must fall within <code>buffer</code>’s size.</p>
|
||
</li>
|
||
</ul>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.create_texture" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#815-818">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_texture" class="fn">create_texture</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.TextureDescriptor.html" title="struct wgpu_hal::TextureDescriptor">TextureDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section></summary><div class="docblock"><p>Creates a new texture.</p>
|
||
<p>The initial usage for all subresources is <code>TextureUses::UNINITIALIZED</code>.</p>
|
||
</div></details><section id="tymethod.destroy_texture" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#819">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_texture" class="fn">destroy_texture</a>(&self, texture: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>)</h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.add_raw_texture" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#822">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.add_raw_texture" class="fn">add_raw_texture</a>(&self, texture: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>)</h4></section></summary><div class="docblock"><p>A hook for when a wgpu-core texture is created from a raw wgpu-hal texture.</p>
|
||
</div></details><section id="tymethod.create_texture_view" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#824-828">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_texture_view" class="fn">create_texture_view</a>(
|
||
&self,
|
||
texture: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Texture" title="type wgpu_hal::Api::Texture">Texture</a>,
|
||
desc: &<a class="struct" href="struct.TextureViewDescriptor.html" title="struct wgpu_hal::TextureViewDescriptor">TextureViewDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.TextureView" title="type wgpu_hal::Api::TextureView">TextureView</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.destroy_texture_view" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#829">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_texture_view" class="fn">destroy_texture_view</a>(&self, view: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.TextureView" title="type wgpu_hal::Api::TextureView">TextureView</a>)</h4></section><section id="tymethod.create_sampler" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#830-833">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_sampler" class="fn">create_sampler</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.SamplerDescriptor.html" title="struct wgpu_hal::SamplerDescriptor">SamplerDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Sampler" title="type wgpu_hal::Api::Sampler">Sampler</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.destroy_sampler" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#834">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_sampler" class="fn">destroy_sampler</a>(&self, sampler: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Sampler" title="type wgpu_hal::Api::Sampler">Sampler</a>)</h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.create_command_encoder" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#839-842">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_command_encoder" class="fn">create_command_encoder</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.CommandEncoderDescriptor.html" title="struct wgpu_hal::CommandEncoderDescriptor">CommandEncoderDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Queue" title="type wgpu_hal::Api::Queue">Queue</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.CommandEncoder" title="type wgpu_hal::Api::CommandEncoder">CommandEncoder</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section></summary><div class="docblock"><p>Create a fresh <a href="trait.CommandEncoder.html" title="trait wgpu_hal::CommandEncoder"><code>CommandEncoder</code></a>.</p>
|
||
<p>The new <code>CommandEncoder</code> is in the “closed” state.</p>
|
||
</div></details><section id="tymethod.destroy_command_encoder" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#843">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_command_encoder" class="fn">destroy_command_encoder</a>(&self, pool: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.CommandEncoder" title="type wgpu_hal::Api::CommandEncoder">CommandEncoder</a>)</h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.create_bind_group_layout" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#846-849">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_bind_group_layout" class="fn">create_bind_group_layout</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.BindGroupLayoutDescriptor.html" title="struct wgpu_hal::BindGroupLayoutDescriptor">BindGroupLayoutDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section></summary><div class="docblock"><p>Creates a bind group layout.</p>
|
||
</div></details><section id="tymethod.destroy_bind_group_layout" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#850">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_bind_group_layout" class="fn">destroy_bind_group_layout</a>(
|
||
&self,
|
||
bg_layout: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>,
|
||
)</h4></section><section id="tymethod.create_pipeline_layout" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#851-854">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_pipeline_layout" class="fn">create_pipeline_layout</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.PipelineLayoutDescriptor.html" title="struct wgpu_hal::PipelineLayoutDescriptor">PipelineLayoutDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.destroy_pipeline_layout" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#855">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_pipeline_layout" class="fn">destroy_pipeline_layout</a>(
|
||
&self,
|
||
pipeline_layout: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>,
|
||
)</h4></section><section id="tymethod.create_bind_group" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#858-867">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_bind_group" class="fn">create_bind_group</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.BindGroupDescriptor.html" title="struct wgpu_hal::BindGroupDescriptor">BindGroupDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroupLayout" title="type wgpu_hal::Api::BindGroupLayout">BindGroupLayout</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Sampler" title="type wgpu_hal::Api::Sampler">Sampler</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.TextureView" title="type wgpu_hal::Api::TextureView">TextureView</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroup" title="type wgpu_hal::Api::BindGroup">BindGroup</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.destroy_bind_group" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#868">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_bind_group" class="fn">destroy_bind_group</a>(&self, group: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.BindGroup" title="type wgpu_hal::Api::BindGroup">BindGroup</a>)</h4></section><section id="tymethod.create_shader_module" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#870-874">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_shader_module" class="fn">create_shader_module</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.ShaderModuleDescriptor.html" title="struct wgpu_hal::ShaderModuleDescriptor">ShaderModuleDescriptor</a><'_>,
|
||
shader: <a class="enum" href="enum.ShaderInput.html" title="enum wgpu_hal::ShaderInput">ShaderInput</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>, <a class="enum" href="enum.ShaderError.html" title="enum wgpu_hal::ShaderError">ShaderError</a>></h4></section><section id="tymethod.destroy_shader_module" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#875">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_shader_module" class="fn">destroy_shader_module</a>(&self, module: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>)</h4></section><section id="tymethod.create_render_pipeline" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#878-885">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_render_pipeline" class="fn">create_render_pipeline</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.RenderPipelineDescriptor.html" title="struct wgpu_hal::RenderPipelineDescriptor">RenderPipelineDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.RenderPipeline" title="type wgpu_hal::Api::RenderPipeline">RenderPipeline</a>, <a class="enum" href="enum.PipelineError.html" title="enum wgpu_hal::PipelineError">PipelineError</a>></h4></section><section id="tymethod.destroy_render_pipeline" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#886">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_render_pipeline" class="fn">destroy_render_pipeline</a>(
|
||
&self,
|
||
pipeline: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.RenderPipeline" title="type wgpu_hal::Api::RenderPipeline">RenderPipeline</a>,
|
||
)</h4></section><section id="tymethod.create_compute_pipeline" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#889-896">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_compute_pipeline" class="fn">create_compute_pipeline</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.ComputePipelineDescriptor.html" title="struct wgpu_hal::ComputePipelineDescriptor">ComputePipelineDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineLayout" title="type wgpu_hal::Api::PipelineLayout">PipelineLayout</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ShaderModule" title="type wgpu_hal::Api::ShaderModule">ShaderModule</a>, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ComputePipeline" title="type wgpu_hal::Api::ComputePipeline">ComputePipeline</a>, <a class="enum" href="enum.PipelineError.html" title="enum wgpu_hal::PipelineError">PipelineError</a>></h4></section><section id="tymethod.destroy_compute_pipeline" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#897">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_compute_pipeline" class="fn">destroy_compute_pipeline</a>(
|
||
&self,
|
||
pipeline: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.ComputePipeline" title="type wgpu_hal::Api::ComputePipeline">ComputePipeline</a>,
|
||
)</h4></section><section id="tymethod.create_pipeline_cache" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#899-902">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_pipeline_cache" class="fn">create_pipeline_cache</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.PipelineCacheDescriptor.html" title="struct wgpu_hal::PipelineCacheDescriptor">PipelineCacheDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>, <a class="enum" href="enum.PipelineCacheError.html" title="enum wgpu_hal::PipelineCacheError">PipelineCacheError</a>></h4></section><section id="tymethod.destroy_pipeline_cache" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#906">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_pipeline_cache" class="fn">destroy_pipeline_cache</a>(&self, cache: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>)</h4></section><section id="tymethod.create_query_set" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#908-911">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_query_set" class="fn">create_query_set</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="../wgpu_types/struct.QuerySetDescriptor.html" title="struct wgpu_types::QuerySetDescriptor">QuerySetDescriptor</a><<a class="type" href="type.Label.html" title="type wgpu_hal::Label">Label</a><'_>>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.QuerySet" title="type wgpu_hal::Api::QuerySet">QuerySet</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.destroy_query_set" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#912">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_query_set" class="fn">destroy_query_set</a>(&self, set: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.QuerySet" title="type wgpu_hal::Api::QuerySet">QuerySet</a>)</h4></section><section id="tymethod.create_fence" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#913">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_fence" class="fn">create_fence</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.destroy_fence" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#914">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_fence" class="fn">destroy_fence</a>(&self, fence: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>)</h4></section><section id="tymethod.get_fence_value" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#915-918">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.get_fence_value" class="fn">get_fence_value</a>(
|
||
&self,
|
||
fence: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="type.FenceValue.html" title="type wgpu_hal::FenceValue">FenceValue</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><details class="toggle method-toggle" open><summary><section id="tymethod.wait" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#938-943">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.wait" class="fn">wait</a>(
|
||
&self,
|
||
fence: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Fence" title="type wgpu_hal::Api::Fence">Fence</a>,
|
||
value: <a class="type" href="type.FenceValue.html" title="type wgpu_hal::FenceValue">FenceValue</a>,
|
||
timeout_ms: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u32.html">u32</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section></summary><div class="docblock"><p>Wait for <code>fence</code> to reach <code>value</code>.</p>
|
||
<p>Operations like <a href="trait.Queue.html#tymethod.submit" title="method wgpu_hal::Queue::submit"><code>Queue::submit</code></a> can accept a <a href="trait.Api.html#associatedtype.Fence" title="associated type wgpu_hal::Api::Fence"><code>Fence</code></a> and a
|
||
<a href="type.FenceValue.html" title="type wgpu_hal::FenceValue"><code>FenceValue</code></a> to store in it, so you can use this <code>wait</code> function
|
||
to wait for a given queue submission to finish execution.</p>
|
||
<p>The <code>value</code> argument must be a value that some actual operation you have
|
||
already presented to the device is going to store in <code>fence</code>. You cannot
|
||
wait for values yet to be submitted. (This restriction accommodates
|
||
implementations like the <code>vulkan</code> backend’s <a href="vulkan/enum.Fence.html#variant.FencePool"><code>FencePool</code></a> that must
|
||
allocate a distinct synchronization object for each fence value one is
|
||
able to wait for.)</p>
|
||
<p>Calling <code>wait</code> with a lower <a href="type.FenceValue.html" title="type wgpu_hal::FenceValue"><code>FenceValue</code></a> than <code>fence</code>’s current value
|
||
returns immediately.</p>
|
||
</div></details><section id="tymethod.start_capture" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#945">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.start_capture" class="fn">start_capture</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.bool.html">bool</a></h4></section><section id="tymethod.stop_capture" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#946">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.stop_capture" class="fn">stop_capture</a>(&self)</h4></section><section id="tymethod.create_acceleration_structure" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#956-959">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.create_acceleration_structure" class="fn">create_acceleration_structure</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.AccelerationStructureDescriptor.html" title="struct wgpu_hal::AccelerationStructureDescriptor">AccelerationStructureDescriptor</a><'_>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>, <a class="enum" href="enum.DeviceError.html" title="enum wgpu_hal::DeviceError">DeviceError</a>></h4></section><section id="tymethod.get_acceleration_structure_build_sizes" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#960-963">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.get_acceleration_structure_build_sizes" class="fn">get_acceleration_structure_build_sizes</a>(
|
||
&self,
|
||
desc: &<a class="struct" href="struct.GetAccelerationStructureBuildSizesDescriptor.html" title="struct wgpu_hal::GetAccelerationStructureBuildSizesDescriptor">GetAccelerationStructureBuildSizesDescriptor</a><'_, <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.Buffer" title="type wgpu_hal::Api::Buffer">Buffer</a>>,
|
||
) -> <a class="struct" href="struct.AccelerationStructureBuildSizes.html" title="struct wgpu_hal::AccelerationStructureBuildSizes">AccelerationStructureBuildSizes</a></h4></section><section id="tymethod.get_acceleration_structure_device_address" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#964-967">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.get_acceleration_structure_device_address" class="fn">get_acceleration_structure_device_address</a>(
|
||
&self,
|
||
acceleration_structure: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>,
|
||
) -> <a class="type" href="../wgpu_types/type.BufferAddress.html" title="type wgpu_types::BufferAddress">BufferAddress</a></h4></section><section id="tymethod.destroy_acceleration_structure" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#968-971">Source</a><h4 class="code-header">unsafe fn <a href="#tymethod.destroy_acceleration_structure" class="fn">destroy_acceleration_structure</a>(
|
||
&self,
|
||
acceleration_structure: <Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.AccelerationStructure" title="type wgpu_hal::Api::AccelerationStructure">AccelerationStructure</a>,
|
||
)</h4></section><section id="tymethod.get_internal_counters" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#973">Source</a><h4 class="code-header">fn <a href="#tymethod.get_internal_counters" class="fn">get_internal_counters</a>(&self) -> <a class="struct" href="../wgpu_types/counters/struct.HalCounters.html" title="struct wgpu_types::counters::HalCounters">HalCounters</a></h4></section></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><section id="method.pipeline_cache_validation_key" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#903-905">Source</a><h4 class="code-header">fn <a href="#method.pipeline_cache_validation_key" class="fn">pipeline_cache_validation_key</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><[<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.array.html">16</a>]></h4></section><section id="method.pipeline_cache_get_data" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#949-954">Source</a><h4 class="code-header">unsafe fn <a href="#method.pipeline_cache_get_data" class="fn">pipeline_cache_get_data</a>(
|
||
&self,
|
||
cache: &<Self::<a class="associatedtype" href="trait.Device.html#associatedtype.A" title="type wgpu_hal::Device::A">A</a> as <a class="trait" href="trait.Api.html" title="trait wgpu_hal::Api">Api</a>>::<a class="associatedtype" href="trait.Api.html#associatedtype.PipelineCache" title="type wgpu_hal::Api::PipelineCache">PipelineCache</a>,
|
||
) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>>></h4></section><section id="method.generate_allocator_report" class="method"><a class="src rightside" href="../src/wgpu_hal/lib.rs.html#975-977">Source</a><h4 class="code-header">fn <a href="#method.generate_allocator_report" class="fn">generate_allocator_report</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="../wgpu_types/counters/struct.AllocatorReport.html" title="struct wgpu_types::counters::AllocatorReport">AllocatorReport</a>></h4></section></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.0/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Device-for-Context" class="impl"><a class="src rightside" href="../src/wgpu_hal/empty.rs.html#163-313">Source</a><a href="#impl-Device-for-Context" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Device.html" title="trait wgpu_hal::Device">Device</a> for <a class="struct" href="empty/struct.Context.html" title="struct wgpu_hal::empty::Context">Context</a></h3></section></summary><div class="impl-items"><section id="associatedtype.A-1" class="associatedtype trait-impl"><a class="src rightside" href="../src/wgpu_hal/empty.rs.html#164">Source</a><a href="#associatedtype.A-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a> = <a class="struct" href="empty/struct.Api.html" title="struct wgpu_hal::empty::Api">Api</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Device-for-Device" class="impl"><a class="src rightside" href="../src/wgpu_hal/gles/device.rs.html#501-1643">Source</a><a href="#impl-Device-for-Device" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Device.html" title="trait wgpu_hal::Device">Device</a> for wgpu_hal::gles::<a class="struct" href="gles/struct.Device.html" title="struct wgpu_hal::gles::Device">Device</a></h3></section></summary><div class="impl-items"><section id="associatedtype.A-2" class="associatedtype trait-impl"><a class="src rightside" href="../src/wgpu_hal/gles/device.rs.html#502">Source</a><a href="#associatedtype.A-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a> = <a class="struct" href="gles/struct.Api.html" title="struct wgpu_hal::gles::Api">Api</a></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Device-for-Device-1" class="impl"><a class="src rightside" href="../src/wgpu_hal/vulkan/device.rs.html#1023-2591">Source</a><a href="#impl-Device-for-Device-1" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Device.html" title="trait wgpu_hal::Device">Device</a> for wgpu_hal::vulkan::<a class="struct" href="vulkan/struct.Device.html" title="struct wgpu_hal::vulkan::Device">Device</a></h3></section></summary><div class="impl-items"><section id="associatedtype.A-3" class="associatedtype trait-impl"><a class="src rightside" href="../src/wgpu_hal/vulkan/device.rs.html#1024">Source</a><a href="#associatedtype.A-3" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.A" class="associatedtype">A</a> = <a class="struct" href="vulkan/struct.Api.html" title="struct wgpu_hal::vulkan::Api">Api</a></h4></section></div></details></div><script src="../trait.impl/wgpu_hal/trait.Device.js" async></script></section></div></main></body></html> |