-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
CPU side double pixel buffer #171
Comments
Hi, unless I'm misunderstanding what you mean by it, Pixels already uses a CPU side pixel buffer. I'm assuming you mean something different, so please comment and leave some more details on the problem your code solves, thanks! |
Hello! I didn't explain the initial issue well at all lol. I may also not be 100% understanding how the pixel buffer is currently working but it seems to me that theres only one buffer right now so it might be prone to a double buffer issue where the buffer is in the middle of an update but the screen renders so half the screen is displaying an old frame and half of it is displaying a new frame. I was wondering if there needed to be a double buffer which is when you write the data to another buffer and when the update is ran a pointer swaps the buffers and the screen is only updated with a completed buffer and a case where the buffer is overwritten when it is displayed never happens. This might not be the best description, but I recently read this article on it and while I was using pixels I saw there was only one buffer and thought that this might be an issue? |
This should not be possible, assuming you have appropriately set the All of this magic is built on top of what is called a swap chain in You can see this happening with trace logging level enabled. E.g.:
This is the render target. which
This is the second buffer (aka back buffer). This is the texture that receives pixel data. The last log snippet was created by adding a bunch of Trace log of a single frame, annotated
And that is why, this scenario should not be possible to experience in practice with |
Ohh okay thanks for taking the time to explain all of this to me it was really interesting. I should have read more of the wgpu documentation before raising the issue sorry about that 😄. I'll close out this issue now |
No worries. This can serve as more documentation of the |
Hi, I saw that in issue #170 there was some talks about a GPU side pixel buffer and I was wondering if there was also a need for a CPU side pixel buffer? I've been working on an implementation for a CPU side buffer in my fork and could make a PR when its finished which would be soon.
The text was updated successfully, but these errors were encountered: