XboxDev / nxdk-sdl

SDL2 (adapted for original Xbox / nxdk toolchain)
Other
20 stars 8 forks source link

video: Add hardware-accelerated rendering backend #37

Open fgsfdsfgs opened 3 years ago

fgsfdsfgs commented 3 years ago

Adds a hardware accelerated SDL renderer backend that uses pbkit. Could be useful for upscaling screen-sized textures, especially in games like Chocolate Doom, where a 320x200 software rendered framebuffer texture is stretched all the way up to cover (almost) the entire screen.

In addition, this fixes a couple issues that I found in nxdk-sdl:

There are still some issues with the renderer left to solve, namely:

This was tested in my Odamex fork and appears to work fine.

UPD: The SSE define fix and the ARGB8888 change have been reverted, since there appears to be no need for them anymore.

Ryzee119 commented 3 years ago

Ive tested this in SDLPop and Xenium-Tools. both work quite well. I definitely notice a performance gain in 720p Xenium-Tools. Good work with this.

GXTX commented 2 years ago

What's the status on this? I was looking into the intrinsics in SDL and noticed we had a PR here already addressing it. Could we perhaps open a 2nd PR to fix just that if this is deadlocked?

kosmas12 commented 2 years ago

It works but doesn't support some things like render targets. I tried to use it in my fixed Zombie Breakout port but due to not having render targets the zombies weren't properly rendered. I also tried it on some more things that don't use render targets (like an old project of mine) and it seems that it gives quite the performance boost, even when just going software mode now that MMX and SSE work.

fgsfdsfgs commented 2 years ago

The SSE define fix and the ARGB8888 change have been reverted, since there appears to be no need for them anymore. I've also added (barely tested) support for rendertargets and (untested) SDL_RenderSetClipRect.