Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLand offthread rendering #12
Comments
taisel
added
the
enhancement
label
Jan 19, 2016
taisel
self-assigned this
Jan 19, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I already have this feature planned out, so I'll code monkey it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
taisel
Jan 21, 2016
Owner
The renderer the graphics proxy holds a reference to will be replaced by a shim that contains two fifo ring buffers. They will proxy commands to the webworker and the framebuffer result back to the core thread. The graphics renderer webworker will only thread block/futexWait if the outbound framebuffer ring buffer is full, while the core thread will block/futexWait while the command buffer is full. I/O and VRAM writes will be pushed onto the fifo command buffer unprocessed, with a correspond ID sequence prior to the (optional) data.
|
The renderer the graphics proxy holds a reference to will be replaced by a shim that contains two fifo ring buffers. They will proxy commands to the webworker and the framebuffer result back to the core thread. The graphics renderer webworker will only thread block/futexWait if the outbound framebuffer ring buffer is full, while the core thread will block/futexWait while the command buffer is full. I/O and VRAM writes will be pushed onto the fifo command buffer unprocessed, with a correspond ID sequence prior to the (optional) data. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
taisel
Jan 21, 2016
Owner
There will be a separate VRAM copy inside the core emulation thread, so it doesn't have to block on R/W of VRAM.
|
There will be a separate VRAM copy inside the core emulation thread, so it doesn't have to block on R/W of VRAM. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
taisel
Jan 23, 2016
Owner
Starting work for this in https://github.com/taisel/IodineGBA/tree/offthread-gfx
|
Starting work for this in https://github.com/taisel/IodineGBA/tree/offthread-gfx |
taisel commentedJan 19, 2016
We already run the emulator in a webworker if your browser supports sharedarraybuffer. We'll just spawn another webworker controlled by the emulator core inside first webworker, to render graphics. This really needs to land for performance reasons, we can always pull out if it doesn't give an improvement.
Basically if we land this chunk of code, it'll purposefully start rendering at the start of a scanline, and run in parallel to the core emulation. We're exploiting the undefined-ness of mid-scanline rendering to offthread this, even for scanline-by-scanline interrupts.