Skip to content

Commit

Permalink
Apply elided_lifetimes_in_paths
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Oct 27, 2023
1 parent de22168 commit f748b77
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 220 deletions.
64 changes: 32 additions & 32 deletions wgpu/src/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Context {
&self,
adapter: &wgc::id::AdapterId,
hal_device: hal::OpenDevice<A>,
desc: &crate::DeviceDescriptor,
desc: &crate::DeviceDescriptor<'_>,
trace_dir: Option<&std::path::Path>,
) -> Result<(Device, Queue), crate::RequestDeviceError> {
let global = &self.0;
Expand Down Expand Up @@ -133,7 +133,7 @@ impl Context {
&self,
hal_texture: A::Texture,
device: &Device,
desc: &TextureDescriptor,
desc: &TextureDescriptor<'_>,
) -> Texture {
let descriptor = desc.map_label_and_view_formats(|l| l.map(Borrowed), |v| v.to_vec());
let global = &self.0;
Expand All @@ -158,7 +158,7 @@ impl Context {
&self,
hal_buffer: A::Buffer,
device: &Device,
desc: &BufferDescriptor,
desc: &BufferDescriptor<'_>,
) -> (wgc::id::BufferId, Buffer) {
let global = &self.0;
let (id, error) = unsafe {
Expand Down Expand Up @@ -307,7 +307,7 @@ impl Context {
sink_mutex: &Mutex<ErrorSinkRaw>,
cause: impl Error + WasmNotSend + WasmNotSync + 'static,
label_key: &'static str,
label: Label,
label: Label<'_>,
string: &'static str,
) {
let error = wgc::error::ContextError {
Expand Down Expand Up @@ -374,14 +374,14 @@ impl Context {
}
}

fn map_buffer_copy_view(view: crate::ImageCopyBuffer) -> wgc::command::ImageCopyBuffer {
fn map_buffer_copy_view(view: crate::ImageCopyBuffer<'_>) -> wgc::command::ImageCopyBuffer {
wgc::command::ImageCopyBuffer {
buffer: view.buffer.id.into(),
layout: view.layout,
}
}

fn map_texture_copy_view(view: crate::ImageCopyTexture) -> wgc::command::ImageCopyTexture {
fn map_texture_copy_view(view: crate::ImageCopyTexture<'_>) -> wgc::command::ImageCopyTexture {
wgc::command::ImageCopyTexture {
texture: view.texture.id.into(),
mip_level: view.mip_level,
Expand All @@ -395,7 +395,7 @@ fn map_texture_copy_view(view: crate::ImageCopyTexture) -> wgc::command::ImageCo
allow(unused)
)]
fn map_texture_tagged_copy_view(
view: crate::ImageCopyTextureTagged,
view: crate::ImageCopyTextureTagged<'_>,
) -> wgc::command::ImageCopyTextureTagged {
wgc::command::ImageCopyTextureTagged {
texture: view.texture.id.into(),
Expand Down Expand Up @@ -608,7 +608,7 @@ impl crate::Context for Context {

fn instance_request_adapter(
&self,
options: &crate::RequestAdapterOptions,
options: &crate::RequestAdapterOptions<'_, '_>,
) -> Self::RequestAdapterFuture {
let id = self.0.request_adapter(
&wgc::instance::RequestAdapterOptions {
Expand All @@ -625,7 +625,7 @@ impl crate::Context for Context {
&self,
adapter: &Self::AdapterId,
_adapter_data: &Self::AdapterData,
desc: &crate::DeviceDescriptor,
desc: &crate::DeviceDescriptor<'_>,
trace_dir: Option<&std::path::Path>,
) -> Self::RequestDeviceFuture {
let global = &self.0;
Expand Down Expand Up @@ -888,7 +888,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: ShaderModuleDescriptor,
desc: ShaderModuleDescriptor<'_>,
shader_bound_checks: wgt::ShaderBoundChecks,
) -> (Self::ShaderModuleId, Self::ShaderModuleData) {
let global = &self.0;
Expand Down Expand Up @@ -950,7 +950,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &ShaderModuleDescriptorSpirV,
desc: &ShaderModuleDescriptorSpirV<'_>,
) -> (Self::ShaderModuleId, Self::ShaderModuleData) {
let global = &self.0;
let descriptor = wgc::pipeline::ShaderModuleDescriptor {
Expand Down Expand Up @@ -978,7 +978,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &BindGroupLayoutDescriptor,
desc: &BindGroupLayoutDescriptor<'_>,
) -> (Self::BindGroupLayoutId, Self::BindGroupLayoutData) {
let global = &self.0;
let descriptor = wgc::binding_model::BindGroupLayoutDescriptor {
Expand All @@ -1003,7 +1003,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &BindGroupDescriptor,
desc: &BindGroupDescriptor<'_>,
) -> (Self::BindGroupId, Self::BindGroupData) {
use wgc::binding_model as bm;

Expand Down Expand Up @@ -1118,7 +1118,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &PipelineLayoutDescriptor,
desc: &PipelineLayoutDescriptor<'_>,
) -> (Self::PipelineLayoutId, Self::PipelineLayoutData) {
// Limit is always less or equal to hal::MAX_BIND_GROUPS, so this is always right
// Guards following ArrayVec
Expand Down Expand Up @@ -1161,7 +1161,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &RenderPipelineDescriptor,
desc: &RenderPipelineDescriptor<'_>,
) -> (Self::RenderPipelineId, Self::RenderPipelineData) {
use wgc::pipeline as pipe;

Expand Down Expand Up @@ -1232,7 +1232,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &ComputePipelineDescriptor,
desc: &ComputePipelineDescriptor<'_>,
) -> (Self::ComputePipelineId, Self::ComputePipelineData) {
use wgc::pipeline as pipe;

Expand Down Expand Up @@ -1310,7 +1310,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &TextureDescriptor,
desc: &TextureDescriptor<'_>,
) -> (Self::TextureId, Self::TextureData) {
let wgt_desc = desc.map_label_and_view_formats(|l| l.map(Borrowed), |v| v.to_vec());
let global = &self.0;
Expand Down Expand Up @@ -1340,7 +1340,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &SamplerDescriptor,
desc: &SamplerDescriptor<'_>,
) -> (Self::SamplerId, Self::SamplerData) {
let descriptor = wgc::resource::SamplerDescriptor {
label: desc.label.map(Borrowed),
Expand Down Expand Up @@ -1380,7 +1380,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &wgt::QuerySetDescriptor<Label>,
desc: &wgt::QuerySetDescriptor<Label<'_>>,
) -> (Self::QuerySetId, Self::QuerySetData) {
let global = &self.0;
let (id, error) = wgc::gfx_select!(device => global.device_create_query_set(
Expand All @@ -1397,7 +1397,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
device_data: &Self::DeviceData,
desc: &CommandEncoderDescriptor,
desc: &CommandEncoderDescriptor<'_>,
) -> (Self::CommandEncoderId, Self::CommandEncoderData) {
let global = &self.0;
let (id, error) = wgc::gfx_select!(device => global.device_create_command_encoder(
Expand Down Expand Up @@ -1426,7 +1426,7 @@ impl crate::Context for Context {
&self,
device: &Self::DeviceId,
_device_data: &Self::DeviceData,
desc: &RenderBundleEncoderDescriptor,
desc: &RenderBundleEncoderDescriptor<'_>,
) -> (Self::RenderBundleEncoderId, Self::RenderBundleEncoderData) {
let descriptor = wgc::command::RenderBundleEncoderDescriptor {
label: desc.label.map(Borrowed),
Expand Down Expand Up @@ -1572,7 +1572,7 @@ impl crate::Context for Context {
&self,
texture: &Self::TextureId,
texture_data: &Self::TextureData,
desc: &TextureViewDescriptor,
desc: &TextureViewDescriptor<'_>,
) -> (Self::TextureViewId, Self::TextureViewData) {
let descriptor = wgc::resource::TextureViewDescriptor {
label: desc.label.map(Borrowed),
Expand Down Expand Up @@ -1794,8 +1794,8 @@ impl crate::Context for Context {
&self,
encoder: &Self::CommandEncoderId,
encoder_data: &Self::CommandEncoderData,
source: crate::ImageCopyBuffer,
destination: crate::ImageCopyTexture,
source: crate::ImageCopyBuffer<'_>,
destination: crate::ImageCopyTexture<'_>,
copy_size: wgt::Extent3d,
) {
let global = &self.0;
Expand All @@ -1817,8 +1817,8 @@ impl crate::Context for Context {
&self,
encoder: &Self::CommandEncoderId,
encoder_data: &Self::CommandEncoderData,
source: crate::ImageCopyTexture,
destination: crate::ImageCopyBuffer,
source: crate::ImageCopyTexture<'_>,
destination: crate::ImageCopyBuffer<'_>,
copy_size: wgt::Extent3d,
) {
let global = &self.0;
Expand All @@ -1840,8 +1840,8 @@ impl crate::Context for Context {
&self,
encoder: &Self::CommandEncoderId,
encoder_data: &Self::CommandEncoderData,
source: crate::ImageCopyTexture,
destination: crate::ImageCopyTexture,
source: crate::ImageCopyTexture<'_>,
destination: crate::ImageCopyTexture<'_>,
copy_size: wgt::Extent3d,
) {
let global = &self.0;
Expand All @@ -1863,7 +1863,7 @@ impl crate::Context for Context {
&self,
encoder: &Self::CommandEncoderId,
_encoder_data: &Self::CommandEncoderData,
desc: &ComputePassDescriptor,
desc: &ComputePassDescriptor<'_>,
) -> (Self::ComputePassId, Self::ComputePassData) {
let timestamp_writes =
desc.timestamp_writes
Expand Down Expand Up @@ -2158,7 +2158,7 @@ impl crate::Context for Context {
&self,
_encoder: Self::RenderBundleEncoderId,
encoder_data: Self::RenderBundleEncoderData,
desc: &crate::RenderBundleDescriptor,
desc: &crate::RenderBundleDescriptor<'_>,
) -> (Self::RenderBundleId, Self::RenderBundleData) {
let global = &self.0;
let (id, error) = wgc::gfx_select!(encoder_data.parent() => global.render_bundle_encoder_finish(
Expand Down Expand Up @@ -2265,7 +2265,7 @@ impl crate::Context for Context {
&self,
queue: &Self::QueueId,
queue_data: &Self::QueueData,
texture: crate::ImageCopyTexture,
texture: crate::ImageCopyTexture<'_>,
data: &[u8],
data_layout: wgt::ImageDataLayout,
size: wgt::Extent3d,
Expand All @@ -2291,7 +2291,7 @@ impl crate::Context for Context {
queue: &Self::QueueId,
queue_data: &Self::QueueData,
source: &wgt::ImageCopyExternalImage,
dest: crate::ImageCopyTextureTagged,
dest: crate::ImageCopyTextureTagged<'_>,
size: wgt::Extent3d,
) {
let global = &self.0;
Expand Down
Loading

0 comments on commit f748b77

Please sign in to comment.