libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.08k stars 1.81k forks source link

(Direct3D9) Implement a HLSL renderchain codepath [will make Xbox 360 port possible] #7233

Open inactive123 opened 5 years ago

inactive123 commented 5 years ago

Right now, Direct3D 9 only works on RetroArch using the Cg renderchain backend. We need a HLSL solution so we can get RetroArch to work again on Xbox 360, and also to reduce our dependencies on Cg in general.

inactive123 commented 5 years ago

Linked to this - https://www.bountysource.com/issues/63490208-direct3d9-implement-a-hlsl-renderchain-codepath

driver1998 commented 5 years ago

Is it working now? I enabled HAVE_HLSL and HAVE_D3DX then RetroArch crashes on start.

inactive123 commented 5 years ago

The HLSL renderchain driver doesn't work properly. RGUI kinda looks broken with it and the core image itself doesn't properly show up. Either somebody needs to fix the existing issues with it, or start from scratch.

If somebody thinks it's easier to make a separate D3D9 driver in its own file written with HLSL in mind instead of going through the renderchain interface, I'm open to that too. It's all up to whoever wants to implement this.

driver1998 commented 5 years ago

We need D3D9 driver for Windows RT as well, Surface RT only supports feature level 9_1. And clearly there won't be CG on ARM.

We are using gdi on RT so far.

(ANGLE seems to be software emulated on 9_1 hardware, form: https://github.com/Microsoft/angle/blob/ms-master/README.md) That is not that useful either.

at88mph commented 4 years ago

This issue is in the libretro/RetroArch repository, but there is a libretro/common-shaders repository, too. For someone coming into this, where would this work go? Is it specific to RetroArch?

hizzlekizzle commented 4 years ago

the common-shaders repo is just for post-processing Cg/HLSL shaders. This would be specific to RetroArch and would be a part of its codebase.

driver1998 commented 2 years ago

Should be working recently with https://github.com/libretro/RetroArch/pull/13038 and https://github.com/libretro/RetroArch/pull/13855.

Speaking of Windows RT, Windows 10/11 on ARM: Currently the D3D9 driver depends on D3DX9 libraries for font rendering. ARM D3DX9 does not officially exist, but a test build of D3DX9_43.DLL for Windows RT can be found in Windows 8 HLK, and does work. No such luck for ARM64. But I tested d3dx9 from wine with RetroArch instead of MS ones and it seems to work fine as well. Of course on ARM64 we should have D3D11/12 working...