pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

GS: Single dylib with all ISAs

Open TellowKrinkle opened this issue 4 years ago • 8 comments

Fixes one of the blockers on #4100

Note: Requires #4131 and #4658

Needs msbuild implementation, not sure how to set that up. You need to split GSdx into a main piece and the ISA-specific piece, which should be compiled once per isa in ["avx2", "avx", "sse4", "sse2"] and with the added define MULTI_ISA_UNSHARED_COMPILATION. Finally, combine everything into one massive GSdx dll. In CMake I accomplished this by making static library targets for the ISA specific pieces and linking them with the main GSdx.

Details: Does the dynamic split at the GSRenderer class, initializes a different GSRenderer depending on the ISA. I had to add an IGSRenderer virtual-only interface as GSRenderer didn't seem like it would be easy to separate from its implementation details

TellowKrinkle avatar Jan 30 '21 09:01 TellowKrinkle

I went around and rebased this PR to the latest constexpr changes master had EDIT: fixing the rebase as we speak, the pre rebase branch is available at https://github.com/PCSX2/pcsx2/tree/old-SingleGSdx EDIT2: rebase is now working

GovanifY avatar Mar 25 '21 21:03 GovanifY

With the GS merge is this still useful, if so can we get a rebase.

Edit: also won't this be mostly obsoleted by #3579 and #3577.

fantesykikachu avatar Jul 06 '21 06:07 fantesykikachu

Yes it's still useful and planned, no those won't make it obsolete, and yes it will be rebased when Tellow gets time, he has a lot of PR's to rebase and update since the merge, so he will get around to it when he can.

refractionpcsx2 avatar Jul 06 '21 08:07 refractionpcsx2

With the GS merge is this still useful

Yes, it was made specifically because GS merge was removing our previous method of selecting between SSE4 and AVX2

Edit: also won't this be mostly obsoleted by #3579 and #3577

I'd like to think I'm not dumb enough to PR a fix that's already been obsoleted by another PR that I made

can we get a rebase

This one's waiting for some cmake changes before it can be merged so I probably won't rebase it for a bit. We ended up deciding to use cmake for published builds on Windows to get this working there, which means that we need cmake builds working on Windows first

TellowKrinkle avatar Jul 06 '21 09:07 TellowKrinkle

Now all the requirements are merged on this, maybe we can consider testing this and getting it ready?

refractionpcsx2 avatar Nov 06 '21 18:11 refractionpcsx2

Can’t wait for this one. One build!

seta-san avatar Feb 04 '22 22:02 seta-san

For anyone wondering about the status of this, it's waiting until we figure out why cmake builds are slower than msbuild builds (even though they're using the same compiler...)

Since it would be pretty pointless to switch to a build that combines SSE4 and AVX2 but is slower than just giving everyone an SSE4 build

TellowKrinkle avatar May 06 '22 06:05 TellowKrinkle

You could give a try doing a diff of the vcxproj files generated by cmake and those handcrafted, you should see some differences in the flags (probably due to how cmake interpret by default the Release mode vs how we do).

iMineLink avatar May 06 '22 07:05 iMineLink

Which build is supposed to be tested if this combines sse4 and avx2?

seta-san avatar Nov 27 '22 23:11 seta-san

Which build is supposed to be tested if this combines sse4 and avx2?

CMake (and compare its performance to an AVX2 build)

TellowKrinkle avatar Nov 28 '22 02:11 TellowKrinkle

if anything i've found this build to be marginally faster. doing all testing with software renderer of course.

seta-san avatar Nov 28 '22 20:11 seta-san