Hardware Rendering Possible?

Discussion of developmental aspects of the MiSTer Project.
held
Posts: 209
Joined: Sun Sep 26, 2021 2:18 pm
Has thanked: 27 times
Been thanked: 31 times

Hardware Rendering Possible?

Unread post 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? :D
(because currently its idle and if possible could be put to good use)

DevilHunterWolf
Posts: 102
Joined: Thu Aug 19, 2021 4:07 am
Has thanked: 2 times
Been thanked: 40 times

Re: Hardware Rendering Possible?

Unread post 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.

rhester72
Top Contributor
Posts: 1107
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 13 times
Been thanked: 169 times

Re: Hardware Rendering Possible?

Unread post 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.

held
Posts: 209
Joined: Sun Sep 26, 2021 2:18 pm
Has thanked: 27 times
Been thanked: 31 times

Re: Hardware Rendering Possible?

Unread post by held »

So there is nothing that can be done with the chip in this case? Not even sound or some type of offloading ?

bbond007
Top Contributor
Posts: 519
Joined: Tue May 26, 2020 5:06 am
Has thanked: 85 times
Been thanked: 198 times

Re: Hardware Rendering Possible?

Unread post 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.

held
Posts: 209
Joined: Sun Sep 26, 2021 2:18 pm
Has thanked: 27 times
Been thanked: 31 times

Re: Hardware Rendering Possible?

Unread post by held »

Well in that case, I feel much better :D

User avatar
Mr. Encyclopedia
Posts: 111
Joined: Thu Aug 05, 2021 1:52 am
Has thanked: 50 times
Been thanked: 47 times
Contact:

Re: Hardware Rendering Possible?

Unread post 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.

rhester72
Top Contributor
Posts: 1107
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 13 times
Been thanked: 169 times

Re: Hardware Rendering Possible?

Unread post 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. :)

FPGAzumSpass
Core Developer
Posts: 380
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 38 times
Been thanked: 383 times

Re: Hardware Rendering Possible?

Unread post 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.

User avatar
Mr. Encyclopedia
Posts: 111
Joined: Thu Aug 05, 2021 1:52 am
Has thanked: 50 times
Been thanked: 47 times
Contact:

Re: Hardware Rendering Possible?

Unread post 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.

ferropop
Posts: 52
Joined: Wed Jul 14, 2021 2:44 pm
Been thanked: 4 times

Re: Hardware Rendering Possible?

Unread post by ferropop »

In full support of RetroWave OPL3 interfacing with the MiSTer!

thorr
Top Contributor
Posts: 1099
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 535 times
Been thanked: 252 times

Re: Hardware Rendering Possible?

Unread post by thorr »

Here is a novel idea (maybe), install Linux on the ao486 core and run DosBox and ScummVM there! :-D
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

ferropop
Posts: 52
Joined: Wed Jul 14, 2021 2:44 pm
Been thanked: 4 times

Re: Hardware Rendering Possible?

Unread post by ferropop »

thorr wrote: Tue Apr 18, 2023 8:52 pm

Here is a novel idea (maybe), install Linux on the ao486 core and run DosBox and ScummVM there! :-D
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

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.

ferropop
Posts: 52
Joined: Wed Jul 14, 2021 2:44 pm
Been thanked: 4 times

Re: Hardware Rendering Possible?

Unread post 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.

Post Reply