PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.45k stars 1.59k forks source link

DX12 and Vulkan backends? #1047

Closed ADormant closed 2 years ago

ADormant commented 8 years ago

I wonder if there is a chance for DX12 backend in PCSX2 it gives huge performance increase.

https://github.com/dolphin-emu/dolphin/pull/3364 https://forums.dolphin-emu.org/Thread-unofficial-dolphin-dx12-backend?page=5

willkuer commented 8 years ago

Maybe gabest will show up again and provide a dx12 backend (as he does from time to time). I guess no other active dev would consider this.

Also this is a typical question for a forum and was answered there several times to all extends.

Blackbird88 commented 8 years ago

Vulkan would be better for obvious reasons. But still it's not like PCSX2 needs fast GPU that much.

ADormant commented 8 years ago

Okay I ping gabest @gabest11

Dokman commented 8 years ago

idk what i am talking about, but i will ask you. EE is really important but his job it can be done by a gpu no? if you use another instructions it can work with the gpu or not? how it works?

gabest11 commented 8 years ago

Maybe once I move to Windows 10.

mirh commented 8 years ago

Wasn't this already discussed tons of times on the forums? And with Vulkan coming imminently (a month? Which I'd say is more or less the time needed for a somewhat usable new renderer) I wouldn't know

Sarania commented 8 years ago

You guys heard the man - he will randomly probably add it when he randomly moves to Windows 10 XD

IMO Vulkan is a much better choice because of portability.

ghost commented 8 years ago

I disagree, better to focus on cross-platform stuff

mrcmunir commented 8 years ago

DX12 must exist both with vulkan because some manufacturers have poor outside opengl/ vulkan api in windows version and that's the harsh reality .

mirh commented 8 years ago

It's not like those very some manufacturers aren't the same manufacturer that released Mantle spec the whole Vulkan api is based upon.

tl;dr: there's no correlation between GL and vulkan. Pcsx2 is definitively going to support the later, someday, considering where most of the graphic "team" is. As for the former who knows. Nobody is going to say no to a nice addition. But first you have to code it. And it's not a priority atm.

gregory38 commented 8 years ago

So far we've found 2 games that might benefit from newer API.

Sarania commented 8 years ago

How'd you find them? Based on # of draw calls?

nicman23 commented 8 years ago

AMD people would also benefit, as the current opengl backend runs very poorly :(

gregory38 commented 8 years ago

@Sarania more or less. I profile them too. If I have a high usages of function 0x2351521, I infer the driver is busy. (note that I need to double check ZoE, I debug/profile some much dump). However those games are very heavy on texture/state change. So you don't have any guarantee that new API will really improve the situation (as you still need to flush your GPU).

@nicman23 No. What AMD users need is a multi-thread API dispatcher. Nvidia provides it in the GL driver, I guess DX provides it for all vendors. Remains the others... In all cases, it won't be provided by newer API, so GSdx would need to provide this code too (like thousand of projects... AKA useless code duplication)

ghost commented 8 years ago

@gregory38 Vulkan and DX12 reduce the strain on an AMD CPU. If they chose to implement Async Compute in the plugin you'd see quite an increase. Newer APIs would absolutely provide a significant performance boost to AMD GPU setups.

Enverex commented 8 years ago

I'd say Vulkan, as there's no real point implementing both DX12 and Vulkan when they do the same thing, but the advantage of Vulkan would be that it would work cross-platform (whereas DX12 would be limited to Windows 10 exclusively).

ghost commented 8 years ago

As far as I know, Dolphin itself isn't using DX12 Feature level, the rewrite of the graphic backend itself discovered some severe bugs in dolphin, which so got solved. DX12 hasn't been totally tested out.

nicman23 commented 8 years ago

Iirc a dev team just randomly, posted the patches to dolphin.

The initial effort wasn't by the dolphin devs

ghost commented 8 years ago

As I said.

Two-Tone commented 7 years ago

So far we've found 2 games that might benefit from newer API.

The Ratchet and Clank games would likely see a benefit as well as those games really stress the CPU, unless you heavily underclock the EE which can cause the in-game FPS to dip at times.

Any reduction in CPU overhead would help, honestly.

gregory38 commented 7 years ago

But are you sure that the issue is the overhead of the driver. And not the GSdx overhead. It is really a complex topic.

Any reduction in CPU overhead would help, honestly.

Sure but it doesn't come for free. I'm pretty sure people prefer a slow openGL rendering with nice mipmap texture and shadows rather than a fast Vulkan mipmap garbage.

Two-Tone commented 7 years ago

I'm not saying that the issue is the driver, just that the reduction in driver overhead would give the emulator more room to breathe.

Well of course people would prefer a more full features yet slower renderer compared to one that is fast but lacking vital features. But it's a moot point as there is no Vulkan backend currently. I On Sep 27, 2016 4:14 AM, "Gregory Hainaut" notifications@github.com wrote:

But are you sure that the issue is the overhead of the driver. And not the GSdx overhead. It is really a complex topic.

Any reduction in CPU overhead would help, honestly.

Sure but it doesn't come for free. I'm pretty sure people prefer a slow openGL rendering with nice mipmap texture and shadows rather than a fast Vulkan mipmap garbage.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PCSX2/pcsx2/issues/1047#issuecomment-249810452, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJES-qs3rVozeYM83yoUSNxvR6-9uh1ks5quN5bgaJpZM4G41S4 .

gregory38 commented 7 years ago
I'm not saying that the issue is the driver, just that the reduction in driver overhead would give the emulator more room to breathe.

No. The driver is running is own thread. If you're not limited by the driver overhead, it could be 10x time faster that you will barely notice any speed impact on the emulation. Well you're right that it will reduce the load on 2 core CPU but it is maybe time (and faster) to upgrade to a 4 core CPU (with AMD comes back, I hope it will become more standard).

But it's a moot point as there is no Vulkan backend currently.

There is no Vulkan backend but emulation of Ratchet and Clank games is nearly perfect. So it isn't moot, I already made the choice to improve the quality over a potential speedup.

jcdenton2k commented 7 years ago

@Two-Tone:

I've looked through your github contribution history and it seems you're more of a tester/issue commiter than an actual coder. I'm of a somewhat similar ilk. Just be sure you know that gregory38 is an actual coder and intimately involved deep in the nuts and bolts of maintaining a PCSX2 codebase that has been around for several years and has over 95% compatibility with PS2 games.

That said, perhaps you should realize that neither Vulkan nor DX12 are 'magic bullets' when it comes to improving performance. The primary benefit comes from those who have the HARDWARE to handle things and that hardware isn't going to happen from people who (time and again) complain their Intel Integrated HD-shit graphics have bugs or won't run X game despite bold stickied caps threads on the PCSX2 forums.

The overwhelming majority of users are not on Win10 nor have any inclination of 'updating' to Win10. I've made this comparison elsewhere but Win7 is your rock solid STABLE OS while Win8.1 is a BETA OS and Win10 is your DEV/ALPHA OS that isn't ready for prime time and won't be ready for at least another year or two. Microsoft fired most of their testing team and the buggy broken garbage 'updates' they've released to break people's systems time and again have unfortunately caused a backlash where NOBODY is updating their computers even for crucial security updates. GG, Micro$oft.

Win10 is not the answer and DX12 is not the answer. It would be utterly insane to bother with DX12 support for less than 20% of the market and have that 'support' change on a near-daily basis with every random forced untested Windows Update for Win10 causing nothing but headaches for both users and developers of programs like PCSX2.

And all that said, Vulkan is by far the most promising of the APIs but from personal experience and poking around it is NOT ready for prime time. Maybe 85% ready but still not quite there yet. I know of Doom being one of the few high-profile games that have Vulkan support and that is because John Carmack is a programming genius and managed to get it done within a reasonable amount of time. Not every project has a John Carmack on staff (if only we were so lucky) so we work with what we have.

DX12 is a lost cause and Win10-only while Vulkan is still at least a year away from being a mature-enough API for regular production use. Neither of those APIs are going to provide a significant performance increase in enough PS2 games to justify the (unpaid volunteer) coders here to set aside significant time & resources to work on it.

TLDR: Please do your research before spewing your ignorant vomit all over this project, thanks.

Here's a video that even a simpleton like you can understand; you should do an internet search for more detail if you like: https://www.youtube.com/watch?v=r0fgEVEgK_k

Two-Tone commented 7 years ago

What? I never mentioned Win10 or DX12, only Vulkan, so you're putting an awful lot of words in my mouth.

It wouldn't make sense for me to advocate Win10 or DX12 as Debian and Win7 are my two primary OSes.

it seems you're more of a tester/issue commiter than an actual coder.

I generally don't contribute code to floss programs, but I have my own private repos on here. Don't assume you know a person just because you looked through their minimal public GitHub history.

That said, perhaps you should realize that neither Vulkan nor DX12 are 'magic bullets' when it comes to improving performance

Of course not , but other emulators have shown that using a low level API like Vulkan have allowed better overall performance, especially for lower end systems. If the Steam HW Survey shows anything, it's that the overwhelming majority of gamers have low end machines.

Like Gregory said, there is a definite cost, and that cost is man hours. You can't just press a button or tell gcc to compile your code a certain way and suddenly have a high performing Vulkan or DX12 backend. But the potential benefits can be fairly large, especially for the average user.

BTW Gregory, I've got an i5 3470. That's a quad core. I'm still CPU bound by the Ratchet and Clank games, so any driver overhead reduction would benefit me some and those with lesser hardware greatly.

Doom being one of the few high-profile games that have Vulkan support and that is because John Carmack is a programming genius and managed to get it done within a reasonable amount of time

Carmack left id back in 2013, long before Vulkan was ever even announced (2015) or released (this year). Maybe you're the one not doing their research?

TL;DR Please don't be so toxic.

Also, there seems to be some sort of misunderstanding; I never said that this HAS to be done, just saying that the R&C games would benefit from a backend that has lower CPU overhead.

FlatOutPS2 commented 7 years ago

Of course not , but other emulators have shown that using a low level API like Vulkan have allowed better overall performance, especially for lower end systems. If the Steam HW Survey shows anything, it's that the overwhelming majority of gamers have low end machines.

Except that most lower end systems don't support those API's...

Two-Tone commented 7 years ago

Except that most lower end systems don't support those API's...

If you're talking about age, then for Nvidia their GPU support goes back as far as their 600 series (2012), AMD is their entire GCN family (early 2012, support is sketchy on Linux, but that is improving, plus the vast majority of users are on Windows), and for Intel no support yet on Windows but support on Windows goes as far back as Ivy Bridge (2012).

Intel is the odd one out, but the as the Steam Hardware Survey consistently shows every month, approx 82% of all their users use AMD and Nvidia hardware. About 10% of that (or 75% total) doesn't (there is close to 13% of the total that I wasn't able to account for because they only show up as "Other". And yes, I went through and added up the percentage of shown AMD and Nvidia users with GPUs that are unable to use Vulkan).

In other words, most users' systems do support Vulkan.

FlatOutPS2 commented 7 years ago

Most users' systems do support Vulkan, but most lower end systems don't or only support it through their Intel iGPU on Linux(which does not really count, as most users don't want to switch).

Two-Tone commented 7 years ago

At least 35% of the surveyed AMD and Nvidia users are using a mid-low to low end GPU that support Vulkan. That's close to half of all AMD and Nvidia GPUs that support Vulkan (46.6~%). It's also greater than the total number of Intel or AMD users (if combined it's only behind by 7%).

The total number of users who would benefit from a Vulkan backend is fairly substantial.

I did not go through and count the ones that don't support it as the number of low end that do was greater than the total that don't.

avih commented 7 years ago

The total number of users who would benefit from a Vulkan backend is fairly substantial.

Agreed. Now let's move on from this point.

I don't think anyone is opposing supporting new backends. The issue remains that it needs someone to actually add the support for new backends, which takes considerable knowledge, time and effort. Until such someone volunteers for the task, well.. not much would happen.

ghost commented 7 years ago

Vulkan is still new, every new GPU will support it, even low end range, it's just about time, just like every other tech

FlatOutPS2 commented 7 years ago

At least 35% of the surveyed AMD and Nvidia users are using a mid-low to low end GPU that support Vulkan. That's close to half of all AMD and Nvidia GPUs that support Vulkan (46.6~%). It's also greater than the total number of Intel or AMD users (if combined it's only behind by 7%).

Those mid-low to low end GPU's are either laptop GPU's that often have CPU's that can hardly support PCSX2 anyway or they're fall in the high end systems category for PCSX2 and won't have much issue's with PCSX2, except in a handful of games. Either way it won't help the actual low-end systems.

jcdenton2k commented 7 years ago

I see a few issues with this thread.

1 - Using Steam Hardware Survey as the be-all and end-all of 'what hardware PC gamers use'. While Steam represents a majority of the market, it still isn't 100% of the market. Many people like myself use GoG or Humble Bundles to obtain games and don't use or participate in Steam's ecosystem. Ignoring that fact is to ignore reality.

2 - The case is made for Vulkan supporting low-end GPUs and that point is under contention. In some cases it may help but in other cases it may not help at all. Laptop hardware in particular is difficult to account for when it comes to features supported. There have been many cases where a GPU says 'OpenGL compliant' and then it didn't support the actual 100% compliance spec but only a random handful of things instead.

3 - Vulkan is not a silver bullet and may or may not provide a substantial improvement for those with the capability to utilize it. The Nvidia 600+ series is listed but Doom Vulkan support explicitly lists issues with the Nvidia 690 and says it is NOT fully Vulkan-compliant.

*Vulkan is not currently supported on NVIDIA GPUs with 2 GB of RAM on Windows 7 or on the GTX 690. Users with these GPUs need to run DOOM on the OpenGL graphics API.

https://community.bethesda.net/thread/54585

So far when it comes to benchmarks there haven't been many cases where it would drastically improve things except for a small portion of users in specific circumstances with very specific games.

In most cases, as FlatOutPS2 stated, you either have more than enough hardware to run full speed with OpenGL/DirectX and wouldn't benefit much from Vulkan, or your hardware is so old and so poor/unfit that even with Vulkan you'd either have spotty/buggy support or it would still provide no benefit to your setup or gaming experience.

I'd actually want to vote for the devs to drop DirectX support altogether. Why maintain two APIs when we have OpenGL not only on par with DirectX but BETTER than it with more accuracy AND better performance rolled into one ALONG with cross-platform compatibility? Even on my Windows gaming machine I prefer using the OpenGL API whenever I have the option in emulators to do so. It just works well for me :)

And ultimately in the end, talk can happen but someone with the coding capability has to get it done. I'd much prefer seeing work done to improve what we already have rather than use a beta-quality API that hasn't been matured enough for significant development time to be devoted to it.

Two-Tone commented 7 years ago

I'd actually want to vote for the devs to drop DirectX support altogether. Why maintain two APIs when we have OpenGL not only on par with DirectX but BETTER than it with more accuracy AND better performance rolled into one ALONG with cross-platform compatibility?

Because AMD's OpenGL sucks but the DirectX driver is just fine, meaning a LARGE number of users would see a huge decrease in performance (I see about a 30-50% decrease in every game I have tested on my 390).

FlatOutPS2 commented 7 years ago

Because AMD's OpenGL sucks but the DirectX driver is just fine, meaning a LARGE number of users would see a huge decrease in performance (I see about a 30-50% decrease in every game I have tested on my 390).

Unless that was a very small and unlucky collection of games you tried, that's a load of BS. I see a decrease in maybe 25% of the games, and most of those drops are between 10-20%, which can often be mended by changing a few (speedhacks)settings, and that's with an AMD GPU that is quite a bit older than yours...

gregory38 commented 7 years ago

Oh my, welcome to drama world.

Here some facts

I get a significant boost to emulation speed on the gpu side with mipmapping enabled for hardware. Like gains of 14-20 fps significant. Whatever else mipmapping did it also increased my speed.

Specs that matter are Nvidia geoforce 750m and Intel core i7 4700mq with nvidia binary version 370.28.

Mipmap likely increases the driver overhead (more texture to upload). Yet it is much faster because it reduces the size of the texture to process on the GSdx thread.

Conclusion, there is no need to rush on Vulkan when the first step ought to be GSdx MT support. Then next step is to redo a new renderer based on latest extension. So we can have a fast accurate date, fast accurate blending, potentially reduce the cost of depth conversion (note fast on CPU but heavier on GPU) ...

Sunderland93 commented 7 years ago

Vulkan would be great, but I preffer full 64-bit support in PCSX2, because I'm tired of install many i386 dependency's on my Linux systems. And PCSX2 interface is ignore desktop theme and looks like "hello from Windows 95"

gregory38 commented 7 years ago
 PCSX2 interface is ignore desktop theme and looks like "hello from Windows 95"

Oh, it could explain why it's looking so much modern on my PC :stuck_out_tongue: On linux, I think the issue come from the link of wxWidget with GTK2.

 I'm tired of install many i386 dependency's

In order to do development, to use mesa driver, mesa testsuite, gpu debugger. Do you know how many Debian package I recompiled in local. And how much my system is a mess to support multiple arch dev packages.

Enverex commented 7 years ago

Regarding the interface, make sure your themes are set up properly. I'm running a 64bit system and it looks fine here, so it's not a PCSX2 issue:

image

gregory38 commented 7 years ago

Oh might need to install a 32 bit theme too ;)

Sunderland93 commented 7 years ago

PCSX2 interface is ignore desktop theme and looks like "hello from Windows 95"

Oh, it could explain why it's looking so much modern on my PC :stuck_out_tongue: On linux, I think the issue come from the link of wxWidget with GTK2.

I'm tired of install many i386 dependency's

In order to do development, to use mesa driver, mesa testsuite, gpu debugger. Do you know how many Debian package I recompiled in local. And how much my system is a mess to support multiple arch dev packages.

I just gave a couple examples. 32 bits is a past. Many software now has 64-bits only, many game emulators has 64-bit version, and don't need to install any i386 crap.

Sunderland93 commented 7 years ago

@Enverex I'm using KDE.

Lithium64 commented 7 years ago

@FlatOutPS2 My gpu is a R7 260x and it is much slower on OpenGL backend

mirh commented 7 years ago

That's going to be fixed soon™. And.. If nobody has actual technical reasons it would be better not post.

EDIT: better not to post here with incidental reasons this may benefit somebody

refractionpcsx2 commented 7 years ago

better not post where? on the AMD forum? It looks like he's not totally convinced that it is a problem with the drivers to me, looks like he's trying to blame you for using old drivers or your rig. I've been trying to sign up to reply this is a common problem where OGL is half the speed on most games compared to DX11, regardless of driver, since neither of you have spoken in there since 4 weeks ago :P

jcdenton2k commented 7 years ago

When Vulkan is more mature, we may be able to see more devs use it and implement it into other emulators including this one. For now though, it is a toss-up as to whether it will be worth the time.

mirh commented 7 years ago

since neither of you have spoken in there since 4 weeks ago

They PMed me (probably since I never really received a notification about that post) telling they found an optimization that would have been rolled out soon.

FlatOutPS2 commented 7 years ago

Did you get those low FPS on the AMD test case dump with default settings? Because I got similar results to the AMD employee, and nowhere near as low as indicated in your first post.

mirh commented 7 years ago

Settings are included in the test case. Perhaps it's just you don't have a Core 2 Duo?

LazyBunny commented 7 years ago

I would like to see both Vulkan and DX12 support. And with good reason. Vulkan is great for multiplatform, but I need something that the Intel HD 400 could support, which is DX12. DX12 doesn't really help with graphics as it does with spreading out the cpu load. The computer i'm using this on.. is a very underpowered intel Atom X5-z8300 LattePanda board which is a small SoC board, think Raspberry Pi sized. It runs x64 windows 10. But vulkan only supports this chip in ubuntu atm. I haven't been able to get Vulkan to work at all.

In the dolphin emulator, using the DX12 backend which is supported in the dev/daily builds, gamecube games are now running a solid 30fps, 60vps, and even some wii games are running at 95% or higher speeds, which is impressive for such a weak SoC board.

So I want DX12 for those of us who don't seem to have a lot of vulkan support. But i want vulkan for all you multi-platformers. Android, linux users etc. Seriously! a palm sized PC that does Gamecube, wii, PSP, and even PS2? That's pretty awesome to me.