Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make StoreOp an enum instead of a bool #4147

Merged
merged 12 commits into from
Sep 18, 2023
Merged

Make StoreOp an enum instead of a bool #4147

merged 12 commits into from
Sep 18, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Sep 16, 2023

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections

Description

wgpu::Operations::store used to be an underdocumented boolean value,
causing missunderstandings of the effect of setting it to false.

The API now resembles WebGPU which distinguishes store and discard,
see WebGPU spec on GPUStoreOp.

// ...
depth_ops: Some(wgpu::Operations {
    load: wgpu::LoadOp::Clear(1.0),
-   store: false,
+   store: wgpu::StoreOp::Discard,
}),
// ...

Opted to put this text into the changelog under Major Changes since it breaks like every single use ;-)

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Comments, like the api change!

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
wgpu/src/lib.rs Outdated Show resolved Hide resolved
wgpu/src/lib.rs Outdated Show resolved Hide resolved
wgpu/src/lib.rs Outdated Show resolved Hide resolved
wgpu/src/lib.rs Show resolved Hide resolved
wgpu/src/backend/direct.rs Show resolved Hide resolved
Wumpf and others added 4 commits September 17, 2023 10:48
Co-authored-by: Connor Fitzgerald <[email protected]>
Co-authored-by: Connor Fitzgerald <[email protected]>
Co-authored-by: Connor Fitzgerald <[email protected]>
Co-authored-by: Connor Fitzgerald <[email protected]>
@Wumpf
Copy link
Member Author

Wumpf commented Sep 17, 2023

Thanks for all the comment improvements and keeping the bar for documentation high!

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Did you miss a push, a couple resolved things are still unaddressed

wgpu/src/lib.rs Show resolved Hide resolved
wgpu/src/lib.rs Outdated Show resolved Hide resolved
@Wumpf
Copy link
Member Author

Wumpf commented Sep 18, 2023

Did you miss a push

eh, yeah I managed to push to the wrong remote 🤦

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

LGTM!

wgpu/src/lib.rs Show resolved Hide resolved
@cwfitzgerald cwfitzgerald merged commit 5071019 into trunk Sep 18, 2023
@cwfitzgerald cwfitzgerald deleted the better-store-op branch September 18, 2023 18:58
bradwerth pushed a commit to bradwerth/wgpu that referenced this pull request Sep 19, 2023
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.

Depth target gets cleared before compute pass when previously used as attachement without storing values
3 participants