-
Notifications
You must be signed in to change notification settings - Fork 854
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
Validation error when creating texture of size 64x32 #323
Comments
Looks like a bug in rendy? @omni-viral |
I guess dynamic allocator is used. |
I think the
|
The same trace which does not show any corruption nor gives any error reads:
The only difference seems to be that it allocates 1 large block, vs 4 small ones. |
@cloudhead |
@omni-viral anything I can do to help? |
Here's what I think is causing the problem. |
To fix this problem the code that searches smaller chunks should take alignment into account to find out properly aligned range inside the free blocks sequence. |
Ah yes, that makes sense. Aren't large blocks also checked for alignment anyway? Since a 4096 byte block could also be mis-aligned? Or are blocks always aligned to their size? |
In the |
@omni-viral - see amethyst/rendy#200 - that was indeed the problem. |
The fix has now been merged and published in |
323: Rename SwapChain::get_next_texture to SwapChain::get_next_frame, and return errors to the user. r=kvark a=AlphaModder Depends on gfx-rs#668. This creates a new type `SwapChainResult` just for the method. It also alters the signature of `Context::swap_chain_get_next_texture` to return ```rust (Option<Self::TextureViewId>, wgt::SwapChainStatus, Self::SwapChainOutputDetail) ``` which is a little ugly but I couldn't think of anything better. Co-authored-by: AlphaModder <quasiflux@gmail.com>
I have code that sometimes when creating a texture triggers this validation error and results in the rendered image to be corrupted:
Looking at the wgpu code, it looks like it already handles alignment:
wgpu/wgpu-native/src/device.rs
Lines 683 to 699 in 2acc0eb
So I'm wondering why this causes problems. If creating a
64x64
texture, there is no error. But a64x32
texture results in the above error and corruption.The text was updated successfully, but these errors were encountered: