Skip to content

Conversation

@ErichDonGubler
Copy link
Member

No description provided.

@cwfitzgerald cwfitzgerald self-requested a review November 5, 2025 16:16
@cwfitzgerald cwfitzgerald self-assigned this Nov 5, 2025
Comment on lines +294 to +297
let buffer = match &bar.buffer.backing {
&BufferBacking::Gl { raw } | &BufferBacking::GlCachedOnHost { raw, .. } => raw,
BufferBacking::Host { .. } => unreachable!(),
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let buffer = match &bar.buffer.backing {
&BufferBacking::Gl { raw } | &BufferBacking::GlCachedOnHost { raw, .. } => raw,
BufferBacking::Host { .. } => unreachable!(),
};
let buffer = match bar.buffer.backing {
BufferBacking::Gl { raw } | &BufferBacking::GlCachedOnHost { raw, .. } => raw,
BufferBacking::Host { .. } => unreachable!(),
};

This feels like a weird reference-dereference? If it needs a ref, could we use ref raw

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also in general I don't like taking references in match expressions, preferring to explictly using ref/ref mut. This is a slightly less conservative version of the clippy lint against match ergonomics.

/// Storage backing a [`Buffer`]'s operations, possibly implemented with a host-side vector of
/// bytes.
///
/// The [`Self::OnlyRaw`] variant is preferred, when supported. However, various workarounds for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of date docs

Suggested change
/// The [`Self::OnlyRaw`] variant is preferred, when supported. However, various workarounds for
/// The [`Self::Gl`] variant is preferred, when supported. However, various workarounds for

Comment on lines +375 to +381
// #[derive(Clone, Debug)]
// enum MapState {
// Mapped {
// offset: Arc<MaybeMutex<wgt::BufferAddress>>,
// },
// Unmapped,
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants