Merged
Conversation
There was a lot of highly unsafe use of serialization based on peek-poke that we weren't entirely happy with. It's replaced by just serializing the passes now. Also, switch BufferSize to Option<NonZero>.
Member
Author
|
@cwfitzgerald this is ready for reviewing! Do you think you can rebase on top of this? |
cwfitzgerald
approved these changes
Jun 20, 2020
Member
cwfitzgerald
left a comment
There was a problem hiding this comment.
LVGTM! This is amazing, so much unsafe code, vanished into the ether!
bors r+
Contributor
bors bot
added a commit
to gfx-rs/wgpu-rs
that referenced
this pull request
Jun 20, 2020
396: Update wgpu without peek-poke r=cwfitzgerald a=kvark 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. ```rust struct ColorAttachmentDescriptor { attachment: &'a TextureView, resolve_target: Option<&'a TextureView>, clear_color: Option<Color>, store_result: bool, } enum DepthStencilChannel<T> { ReadOnly, Mutable { clear_value: Option<T>, store_result: bool }, } struct DepthStencilAttachmentDescriptor { } ``` 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. Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
kvark
added a commit
to kvark/wgpu
that referenced
this pull request
Jun 3, 2021
396: Update wgpu without peek-poke r=cwfitzgerald a=kvark Depends on gfx-rs#739 Everything works, however I think it's worth changing the render pass color/depth/stencil descriptors to be more rusty, e.g. ```rust struct ColorAttachmentDescriptor { attachment: &'a TextureView, resolve_target: Option<&'a TextureView>, clear_color: Option<Color>, store_result: bool, } enum DepthStencilChannel<T> { ReadOnly, Mutable { clear_value: Option<T>, store_result: bool }, } struct DepthStencilAttachmentDescriptor { } ``` 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. Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
NonZeroU64and 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