This repository was archived by the owner on Jun 18, 2021. It is now read-only.
Update wgpu without peek-poke#396
Merged
bors[bot] merged 2 commits intogfx-rs:masterfrom Jun 20, 2020
Merged
Conversation
bors bot
added a commit
to gfx-rs/wgpu
that referenced
this pull request
Jun 20, 2020
739: Remove Peek-Poke r=cwfitzgerald a=kvark **Connections** Related to #738 Related to djg/peek-poke#10 **Description** As of #726 , the buffers have a minimum binding size that has to include the shader struct size. It, therefore, can't be zero. We can remove the hacks we had previously and switch fully to the idiomatic `Option<NonZeroU64>`. Peek-poke doesn't `NonZeroU64` and friends, so this made me reconsider the user of it entirely. Today, render bundles as well as the Player already represent command streams using a much rustier method. I tried to move everything to this method now, and I think this is going to work much better, and safer. **Testing** wgpu-rs works - gfx-rs/wgpu-rs#396 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
cwfitzgerald
approved these changes
Jun 20, 2020
Member
cwfitzgerald
left a comment
There was a problem hiding this comment.
Very nice! Looks good as is, will review again when any additional changes are made.
Member
Author
|
I'm thinking of going with this API: /// Operation to perform to the output attachment at the start of a renderpass.
pub enum LoadOp<V> {
/// Clear with a specified value.
Clear(V),
/// Load from memory.
Load,
}
/// Pair of load and store operations for an attachment aspect.
pub type Operations<V> = (LoadOp<V>, StoreOp);
/// Describes a color attachment to a [`RenderPass`].
pub struct RenderPassColorAttachmentDescriptor<'a> {
pub attachment: &'a TextureView,
pub resolve_target: Option<&'a TextureView>,
pub ops: Operations<Color>,
}
/// Describes a depth/stencil attachment to a [`RenderPass`].
pub struct RenderPassDepthStencilAttachmentDescriptor<'a> {
pub attachment: &'a TextureView,
pub depth_ops: Option<Operations<f32>>,
pub stencil_ops: Option<Operations<u32>>,
} |
Member
|
I like it! |
Member
Author
|
thanks for reviewing quickly! |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on gfx-rs/wgpu#739
Everything works, however I think it's worth changing the render pass color/depth/stencil descriptors to be more rusty, e.g.
This would also involve wgpu-type/wgpu-core changes, but can be done as a follow-up (don't want to block on them).
There is a value in doing it in this PR, so that end users don't get multiple disruptions, but we need to find a proper shape first.