Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Remove dead code #870

Merged
merged 1 commit into from
Apr 21, 2021
Merged

Remove dead code #870

merged 1 commit into from
Apr 21, 2021

Conversation

dhardy
Copy link
Contributor

@dhardy dhardy commented Apr 21, 2021

Also, why bother setting the padding bytes to 0?

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

IIRC there is a way to observe the padding, so we zero it out just to be sure.
bors r+

@bors
Copy link
Contributor

bors bot commented Apr 21, 2021

@bors bors bot merged commit 394ecc5 into gfx-rs:master Apr 21, 2021
@grovesNL
Copy link
Collaborator

@kvark should we expect the padded range to be zeroed already though? If not, could we move this zeroing down to wgpu-core?

@kvark
Copy link
Member

kvark commented Apr 21, 2021

@grovesNL in wgpu-core you can't create a mapped buffer that is not rounded to 4 bytes already. So it doesn't have a problem. Only wgpu-rs utils have this issue, since they try to be more flexible than wgpu-core itself.

@grovesNL
Copy link
Collaborator

Alright yeah that makes sense to me. In that case though how could we end up with non-zero values in the extra padded range (i.e. the last unpadded_size % 4 bytes)? I thought zeroing it here would be redundant, because it should be zeroed already (in wgpu-core/Gecko)

@kvark
Copy link
Member

kvark commented Apr 21, 2021

Indeed, you are right, wgpu-core recently got this functionality. We can remove that code now from utils.

@dhardy
Copy link
Contributor Author

dhardy commented Apr 21, 2021

Already merged or I would adjust this PR. I'll let you fold into another.

But good to know that the zeroing is redundant. 👍

bors bot added a commit that referenced this pull request Apr 22, 2021
872: Remove zero padding from `create_buffer_init` r=kvark a=grovesNL

Follow-up to #870 (#870 (comment))

Co-authored-by: grovesNL <[email protected]>
kvark pushed a commit to kvark/wgpu that referenced this pull request Jun 3, 2021
872: Remove zero padding from `create_buffer_init` r=kvark a=grovesNL

Follow-up to gfx-rs#870 (gfx-rs/wgpu-rs#870 (comment))

Co-authored-by: grovesNL <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants