Page 1 of 1
Hardware Rendering Possible?
Posted: Wed Dec 14, 2022 12:52 pm
by held
Hi,
After a year of absolute bliss with the MiSTer I am now stumbling into the side projects like ScummVM and DosBox because why not. The DE10 nano is a bit slow when it comes to those. Some games work fine, others do not, c'est la vie.
Configuring to get some better performance out of them my eyes locked on "Software Rendering" and I figured I might as well ask:
Would it be possible to do "Hardware Rendering" with the FPGA?
(because currently its idle and if possible could be put to good use)
Re: Hardware Rendering Possible?
Posted: Thu Dec 15, 2022 12:17 am
by DevilHunterWolf
Take this with a grain of salt from a non-programmer, but I don't see it possible with the current version of ScummVM or DOSBox. I can't imagine there's any code to both program and take advantage of an FPGA chip. So as far as either program is concerned, it doesn't know the FPGA chip exists nor what it would even do with it. Hardware rendering leverages a computer's GPU to help with emulation rather than usually strictly CPU in software rendering so I'm guessing you mean for the FPGA to recreate a GPU. That's a bit of a tall order.
Let's say someone did branch off ScummVM or DOSBox to be able to code an FPGA chip. What would it be able to bring to the table in the DE10-Nano? It's hitting a ceiling with PS1 and Saturn era hardware so nothing too modern would fit. I don't know what kind of GPU could fit into the programmable units of the DE10-Nano. That's also assuming the full board of the chosen GPU has documentation to outline every chip and trace in order to recreate it. Otherwise, someone would have to do that work first. On top of that, someone would also have to figure out how to get the ARM CPU and the recreated GPU to communicate without issues. And after all of that there's the golden questions of the hour: would it improve anything?
From where I'm seeing it, basically the entire premise would be starting at square one. That's a lot of work that would have to be done to try to add hardware rending for one device. And that's me assuming there isn't a process I'm overlooking as an outsider that kills the whole theoretical in the first place. If you're feeling brave, then by all means go for it and see how it works out. But otherwise, I think this is just one of those things best left to the less specialty boards.
Re: Hardware Rendering Possible?
Posted: Thu Dec 15, 2022 3:18 am
by rhester72
AFAIK there simply isn't enough communication bandwidth between the ARM and FPGA sides of the house to make such a thing possible.
Re: Hardware Rendering Possible?
Posted: Thu Dec 15, 2022 10:09 am
by held
So there is nothing that can be done with the chip in this case? Not even sound or some type of offloading ?
Re: Hardware Rendering Possible?
Posted: Thu Dec 15, 2022 2:29 pm
by bbond007
held wrote: ↑Thu Dec 15, 2022 10:09 am
So there is nothing that can be done with the chip in this case? Not even sound or some type of offloading ?
ALSA on the HPS Linux is already using the FPGA for PCM sound.
Additionally, You could probably use the FPGA for OPL3 using the RetroWave protocol (which ScummVM supports)
https://github.com/SudoMaker/RetroWave/ ... b/Protocol
held wrote: ↑Wed Dec 14, 2022 12:52 pm
(because currently its idle and if possible could be put to good use)
Likewise the framebuffer is using the FPGA for video, so I don't know if is accurate to say its idle.
Re: Hardware Rendering Possible?
Posted: Thu Dec 15, 2022 3:50 pm
by held
Well in that case, I feel much better
Re: Hardware Rendering Possible?
Posted: Sat Dec 17, 2022 3:07 am
by Mr. Encyclopedia
rhester72 wrote: ↑Thu Dec 15, 2022 3:18 am
AFAIK there simply isn't enough communication bandwidth between the ARM and FPGA sides of the house to make such a thing possible.
I disagree, per Intel's specs there's a high-performance AXI bridge between the FPGA and HPS. In fact, it's this very interconnect that makes a lot of what MiSTer does possible, for instance the CD cores stream data from the HPS to FPGA via this bus.
My understanding is the Menu core is already using the FPGA as a simple graphics controller/framebuffer, based on software from Terasic. It's certainly true that someone could build a better menu/linux mode with a more robust "graphics core" running on the FPGA, but that's not what Sorg is interested in, much less any other MiSTer developer.
Re: Hardware Rendering Possible?
Posted: Sat Dec 17, 2022 3:21 am
by rhester72
Mr. Encyclopedia wrote: ↑Sat Dec 17, 2022 3:07 am
rhester72 wrote: ↑Thu Dec 15, 2022 3:18 am
AFAIK there simply isn't enough communication bandwidth between the ARM and FPGA sides of the house to make such a thing possible.
I disagree, per Intel's specs there's a high-performance AXI bridge between the FPGA and HPS. In fact, it's this very interconnect that makes a lot of what MiSTer does possible, for instance the CD cores stream data from the HPS to FPGA via this bus.
1x CD rate = 176KB/sec
Screen refresh = 6,075KB/sec
I couldn't find any reference in the Terasic documentation on the speed of the AXI bridge (it can be up to 128 bits wide, though)...I'd have to imagine it could best 6MB/sec, though. Duly noted.
Re: Hardware Rendering Possible?
Posted: Sat Dec 17, 2022 11:12 am
by FPGAzumSpass
Not sure what hardware rendering itself means in that case, but transfer speed between core and HPS is not a issue at all, as it can be done through shared DDR3 at very high speed.
So if you think about e.g. clearing a frame with black and drawing some background and sprites on it, this could be done via display draw commands transfered via ddr3.
But i doubt it's worth it for ScummVM?
Maybe for some hybrid emulation apporach someday.
Re: Hardware Rendering Possible?
Posted: Tue Dec 20, 2022 1:01 am
by Mr. Encyclopedia
When I think "Hardware rendering" I imagine support for graphics and resolutions akin to what other retro game consoles can do. Graphical menus that show game art and information pulled from online sources, software that bypasses the OSD to directly load a core and game via MGL, that sort of thing. Honestly, given that the de10-nano can run a Linux desktop (slowly) it seems like this should already be possible, but I don't doubt there are improvements that could be made. There are demos for FPGA graphics accelerators, all it would take is someone interested in putting it all together.
Re: Hardware Rendering Possible?
Posted: Tue Apr 18, 2023 6:23 pm
by ferropop
In full support of RetroWave OPL3 interfacing with the MiSTer!
Re: Hardware Rendering Possible?
Posted: Tue Apr 18, 2023 8:52 pm
by thorr
Here is a novel idea (maybe), install Linux on the ao486 core and run DosBox and ScummVM there!
http://www.slackware.com/install/sysreq.php
But it takes a Pentium Pro 200 to run like a 286 6MHz. https://www.dosbox.com/wiki/Performance
Re: Hardware Rendering Possible?
Posted: Tue Apr 18, 2023 9:48 pm
by ferropop
Hahah I think I'm ok. While I don't have the ability to do this myself, I can't imagine it's crazy to reroute commands from the internal OPL3 implementation to an actual OPL3 on the userport, especially with the guidance of multiple other open-source projects that have done similar things.
Re: Hardware Rendering Possible?
Posted: Mon May 01, 2023 8:29 pm
by ferropop
Any wider interest in seeing the RetroWave OPL3 connect to the MiSTer FPGA in similar fashion to MT32-pi? Happy to create a crowdfund page for it.