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

[Merged by Bors] - fix Default implementation of Image so that size and data match #2833

Conversation

jakobhellermann
Copy link
Contributor

Before using this image resulted in an Error in Queue::write_texture: copy of 0..4 would end up overrunning the bounds of the Source buffer of size 0

@cart
Copy link
Member

cart commented Sep 16, 2021

Hmm yeah this seems reasonable to me. I kind of liked that Image::default() didn't allocate, but empty images aren't "valid" to wgpu, so we should probably disallow that entirely. This also illustrates a problem: allowing people direct access to these fields also allows them to define data and descriptors that are out of sync. We should probably disallow that / hide the fields to ensure people can only construct "valid" Images. But I won't block this on that :)

@cart
Copy link
Member

cart commented Sep 16, 2021

bors r+

bors bot pushed a commit that referenced this pull request Sep 16, 2021
…2833)

Before using this image resulted in an `Error in Queue::write_texture: copy of 0..4 would end up overrunning the bounds of the Source buffer of size 0`
@bors
Copy link
Contributor

bors bot commented Sep 16, 2021

@bors bors bot changed the title fix Default implementation of Image so that size and data match [Merged by Bors] - fix Default implementation of Image so that size and data match Sep 16, 2021
@bors bors bot closed this Sep 16, 2021
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