diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index 09ba742c2b7..554900ada38 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -40,14 +40,14 @@ therefore immediate data must be set again. To create a render bundle: 1) Create a [`RenderBundleEncoder`] by calling - [`Global::device_create_render_bundle_encoder`][Gdcrbe]. + [`Device::create_render_bundle_encoder`][Dcrbe]. 2) Record commands in the `RenderBundleEncoder` using methods on [`RenderBundleEncoder`]. 3) Call [`RenderBundleEncoder::finish`], which analyzes and cleans up the command stream and returns a [`RenderBundle`]. -4) Then, any number of times, call [`render_pass_execute_bundles`][wrpeb] to +4) Then, any number of times, call [`RenderPass::execute_bundles`][rpeb] to execute the bundle as part of some render pass. ## Implementation @@ -70,8 +70,8 @@ called. It goes through the commands and issues them into the native command buffer. Thanks to isolation, it doesn't track any bind group invalidations or index format changes. -[Gdcrbe]: crate::global::Global::device_create_render_bundle_encoder -[wrpeb]: crate::global::Global::render_pass_execute_bundles +[Dcrbe]: crate::device::Device::create_render_bundle_encoder +[rpeb]: crate::command::RenderPass::execute_bundles !*/ #![allow(clippy::reversed_empty_ranges)] diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 6421ad9db44..3513c03205b 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -146,15 +146,12 @@ fn make_error_state>(error: E) -> CommandEncoderSta pub(crate) enum CommandEncoderStatus { /// Ready to record commands. An encoder's initial state. /// - /// Command building methods like [`command_encoder_clear_buffer`] and - /// [`compute_pass_end`] require the encoder to be in this + /// Command building methods like [`CommandEncoder::clear_buffer`] and + /// [`ComputePass::end`] require the encoder to be in this /// state. /// /// This corresponds to WebGPU's "open" state. /// See - /// - /// [`command_encoder_clear_buffer`]: Global::command_encoder_clear_buffer - /// [`compute_pass_end`]: Global::compute_pass_end Recording(CommandBufferMutable), /// Locked by a render or compute pass. @@ -171,14 +168,16 @@ pub(crate) enum CommandEncoderStatus { /// Command recording is complete, and the buffer is ready for submission. /// - /// [`Global::command_encoder_finish`] transitions a + /// [`CommandEncoder::finish`] transitions a /// `CommandBuffer` from the `Recording` state into this state. /// - /// [`Global::queue_submit`] requires that command buffers are + /// [`Queue::submit`] requires that command buffers are /// in this state. /// /// This corresponds to WebGPU's "ended" state. /// See + /// + /// [`Queue::submit`]: crate::device::queue::Queue::submit Finished(CommandBufferMutable), /// The command encoder is invalid. diff --git a/wgpu-core/src/command/transition_resources.rs b/wgpu-core/src/command/transition_resources.rs index 5f01054a8e6..18247d851e2 100644 --- a/wgpu-core/src/command/transition_resources.rs +++ b/wgpu-core/src/command/transition_resources.rs @@ -126,7 +126,7 @@ pub(crate) fn transition_resources( Ok(()) } -/// Error encountered while attempting to perform [`Global::command_encoder_transition_resources`]. +/// Error encountered while attempting to perform [`CommandEncoder::transition_resources`]. #[derive(Clone, Debug, Error)] #[non_exhaustive] pub enum TransitionResourcesError { diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 400c79ea72e..2cc4ed1c68a 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -126,14 +126,14 @@ impl Global { /// which requires [`GPUBufferDescriptor`] validation to be generated on the /// Device timeline and leave the newly created [`GPUBuffer`] invalid. /// - /// Ideally, we would simply let [`device_create_buffer`] take care of all + /// Ideally, we would simply let [`Device::create_buffer`] take care of all /// of this, but some errors must be detected before we can even construct a /// [`wgpu_types::BufferDescriptor`] to give it. For example, the WebGPU API /// allows a `GPUBufferDescriptor`'s [`usage`] property to be any WebIDL /// `unsigned long` value, but we can't construct a /// [`wgpu_types::BufferUsages`] value from values with unassigned bits /// set. This means we must validate `usage` before we can call - /// `device_create_buffer`. + /// `Device::create_buffer`. /// /// When that validation fails, we must arrange for the buffer id to be /// considered invalid. This method provides the means to do so. @@ -142,7 +142,7 @@ impl Global { /// [`GPUBufferDescriptor`]: https://www.w3.org/TR/webgpu/#dictdef-gpubufferdescriptor /// [`GPUBuffer`]: https://www.w3.org/TR/webgpu/#gpubuffer /// [`wgpu_types::BufferDescriptor`]: wgt::BufferDescriptor - /// [`device_create_buffer`]: Global::device_create_buffer + /// [`Device::create_buffer`]: crate::device::Device::create_buffer /// [`usage`]: https://www.w3.org/TR/webgpu/#dom-gputexturedescriptor-usage /// [`wgpu_types::BufferUsages`]: wgt::BufferUsages pub fn create_buffer_error( @@ -269,8 +269,6 @@ impl Global { initial_state: wgt::TextureUses, id_in: Option, ) -> (id::TextureId, Option) { - profiling::scope!("Device::create_texture_from_hal"); - let hub = &self.hub; let fid = hub.textures.prepare(id_in); @@ -297,8 +295,6 @@ impl Global { desc: &resource::BufferDescriptor, id_in: Option, ) -> (id::BufferId, Option) { - profiling::scope!("Device::create_buffer"); - let hub = &self.hub; let fid = hub.buffers.prepare(id_in); @@ -669,8 +665,6 @@ impl Global { desc: &wgt::CommandEncoderDescriptor