libretro / flycast

Flycast is a multiplatform Sega Dreamcast emulator. NOTE: No longer actively developed, use upstream repo for libretro from now on - https://github.com/flyinghead/flycast
http://reicast.com
GNU General Public License v2.0
155 stars 77 forks source link

upstream backports #985

Open barbudreadmon opened 3 years ago

barbudreadmon commented 3 years ago

The following upstream backports were reverted and need to be ported again (carefully) : https://github.com/libretro/flycast/commit/3bc48306312b5951261df9a9e219fbaf6cdd8619 https://github.com/libretro/flycast/commit/7b3c39e464f18138f1c0ffbf22dd7baf3b4a9bec https://github.com/libretro/flycast/commit/73f0ee4e9623a398fe708e97ed45aa235630a613 https://github.com/libretro/flycast/commit/5be6e0103d22da089f27135f1a63fdb35c3670bd https://github.com/libretro/flycast/commit/2b347a7a5e38b1ba460e176b2912070a035dc967 https://github.com/libretro/flycast/commit/e6dd855a05853fdf87142dc5745275c6f3ebfba6 https://github.com/libretro/flycast/commit/756846b6a7d2192d491ffdf2f37ec85737c55a9e https://github.com/libretro/flycast/commit/5ee21b671d4cbd126cd21f8a58ac38b7ffed61f8 https://github.com/libretro/flycast/commit/e66efe8fa8573a1ca277e41cc08dd78601c58206 https://github.com/libretro/flycast/commit/ef975de635d9b0451be79ab9bd5f919800961861 https://github.com/libretro/flycast/commit/8c5bef74887304a4a54cce60383625385ad3f838 https://github.com/libretro/flycast/commit/5620ec7735fb0605e59b77754d52528eee82f354 https://github.com/libretro/flycast/commit/102b199a8ac5dec069716335c155319e3bdde5c4 https://github.com/libretro/flycast/commit/06260526be971eb18279ea19f64fa9d0a40b32d4 https://github.com/libretro/flycast/commit/ba2117cacc073ffb3eb7ae718c9694d3aed39da1 https://github.com/libretro/flycast/commit/8e6861b658778a026405b44df73362f8c76cc9e4 https://github.com/libretro/flycast/commit/ec817799deb8e20be586a257e2de08e8810f957c https://github.com/libretro/flycast/commit/f8a2f2df2f799c9227f600d72dbe9c143bcdbd17 https://github.com/libretro/flycast/commit/fc87fa9f51401d82ebefd18822a0593c17b0becb https://github.com/libretro/flycast/commit/b849778159e7867b237f7d67afaa52e901141884 https://github.com/libretro/flycast/commit/ca2fa4212c22666312a8f103babfc14cff7f2a4e

Other things to backport : https://github.com/flyinghead/flycast/commit/af6993a81912d048aca53d9179843e19a42ffbee https://github.com/flyinghead/flycast/commit/9d3ee3b57f6b0eed1de8296d8ead1f1fb43eb909 https://github.com/flyinghead/flycast/commit/953200b87bd33e201bd5b4bc9bb68f7047aa3100

I'll do that bit by bit, let me know if there are other upstream commits i should know about

shantigilbert commented 3 years ago

Just out of curiosity, is there a particular reason why they were reverted? and would this have anything to do with some gfx glitches on Mali 450 after the following commit 5c9f995bb0ded447eb4ef757c8ba80a72efcb550 or should I open another issue for that ?

barbudreadmon commented 3 years ago

I started syncing coding standard with upstream some time ago (upstream uses tabs, let's use tabs too, it'll make comparing code way easier), those commits were reverting some of this. It seems some typos were also hidden in them, ending up breaking stuff. Idk about mali 450 gfx glitches.

shantigilbert commented 3 years ago

Thanks for the explanation!

flyinghead commented 3 years ago

@shantigilbert @barbudreadmon the glitches on Mali 400/450 should be fixed by this: https://github.com/flyinghead/flycast/commit/953200b87bd33e201bd5b4bc9bb68f7047aa3100

It's fresh from yesterday though so use with caution

barbudreadmon commented 3 years ago

@flyinghead thanks for the heads-up !

emiliodubois commented 3 years ago

Can this be the cause for "ERROR. JAMMA I/O BOARD NOT FOUND" when loading naomi games in retroarch?

barbudreadmon commented 3 years ago

@emiliodubois that one was fixed already

emiliodubois commented 3 years ago

Thanks, I updated the cores in retroarch and got the update on this one, now everything is working!

bluestang2006 commented 3 years ago

Any way of backporting the Vulkan backend from upstream? The current backend in lr-flycast makes assumptions about the API version based on extensions present but that is not the correct way of determining the API version. Upstream uses the correct method of checking apiVersion through the device. I have been able to get the RPi4 to work on the current backend but I had to patch the code to check for apiVersion.

blisstik commented 3 years ago

@bluestang2006 - please make a clean branch off the latest master here then submit the pull request, that's the faster way it'll get done.

barbudreadmon commented 3 years ago

Upstream uses the correct method of checking apiVersion through the device

@bluestang2006 if you give me the commit implementing that code, i can add it to the list of commits i have to backport.

bluestang2006 commented 3 years ago

@barbudreadmon Here are the commits. However, the entire backend was rewritten initially here https://github.com/flyinghead/flycast/commit/b1defae3f7fbddaf796559a3eed267014979e1e4 These other 2 are the actual Vulkan 1.1 checks, and also providing the applicable vkApplicationInfo. https://github.com/flyinghead/flycast/commit/369624b28fe20884c8b0e7da02d167f6e8612816 https://github.com/flyinghead/flycast/commit/d1b29a59d28053e93b92f6735a9c4590048efcc4

The root cause of the issue is that vkGetPhysicalDeviceProperties2 can't be called by a device that creates a Vulkan 1.0 instance. These devices should be calling vkGetPhysicalDeviceProperties, even though they may have the struct vkGetPhysicalDeviceProperties2 in their driver code. Once they are able to create a 1.1 instance, the device can use vkGetPhysicalDeviceProperties2.

barbudreadmon commented 3 years ago

Oh, that's interesting, i'm wondering if it's related to the pixel buffer size issue with recent nvidia drivers, i'll try to make those backports a priority.

barbudreadmon commented 3 years ago

@bluestang2006 could you check if https://github.com/libretro/flycast/pull/998 improve situation on pi4 ? i'll merge it after you confirm

barbudreadmon commented 3 years ago

@shantigilbert i backported the mali 400/450 fix, could you check if things are ok on your side ? it might also be worth checking if it changes something on mali GXX gpus

shantigilbert commented 3 years ago

@shantigilbert i backported the mali 400/450 fix, could you check if things are ok on your side ? it might also be worth checking if it changes something on mali GXX gpus

Sorry for the late reply.

I haven't been able to test it on a Mali 450, but I did test the latest on the G31 and G52, both worked as they should (on the games I tested) I will test Mali 450 ASAP and report back.

shantigilbert commented 3 years ago

I tested Mali 450 here are the results:

Atomiswave

Melty Blood: background gfx glitches: 20210102151611556

Fotns looks good: 20210102151841985

Mslug6 looks good: 20210102152137605

Asian Dynamite major gfx glitches: 20210102152424066

Dolphin blue looks good: 20210102153247050

Dreamcast

Soul Calibur background glitches, but playable 20210102152636976

MVC2 Looks good: 20210102152907868

Crazy Taxi looks good: 20210102153041807

kage2051 commented 3 years ago

I've heard Mali-450 has issues with depth precision on certain games (Cannon Spike, Dynamite Cop) which seems to be difficult to address since that GPU doesn't support GLES 3.x features.

barbudreadmon commented 3 years ago

@shantigilbert melty blood, asian dynamite and soulcalibur are regressions ?

kage2051 commented 3 years ago

@shantigilbert melty blood, asian dynamite and soulcalibur are regressions ?

Those issues were present before the Mali fix too: https://github.com/EmuELEC/EmuELEC/issues/299

shantigilbert commented 3 years ago

Yeah those games looked the same, what I don't know is that if they always looked like that. But judging on how old this gpu (no real gles 3) is I don't think they did.

kage2051 commented 3 years ago

I remember testing the emulator on a device with PowerVR SGX544 MP2 GPU (which is GLES 2.0 only), and the results in Cannon Spike were pretty similar to what you get on those old Utgard-gen Mali models.

kage2051 commented 3 years ago

This commit https://github.com/flyinghead/flycast/commit/a00aad5fa73b9f31125c49a3814a40e15aa76b98 might help devices/PCs with low specs. It's a smart auto frameskip setting with three options:

This new auto frameskipping setting replaces synchronous rendering though, 'normal' auto frameskip retains its function.