Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Extend full bindless to cover cases with phi nodes #6853

Merged
merged 7 commits into from
May 26, 2024

Conversation

gdkchan
Copy link
Member

@gdkchan gdkchan commented May 23, 2024

This is basically extending the "full bindless" mode implemented on #6577 to activate in more casses. This change allows it to activate when the handle comes from a phi node, when all sources are either a constant buffer, a storage buffer, or a shader input. It ignores other phi nodes that might be a possible source.

An example of case that is supported now is:

LDG.E.CI.64 R24, [R24]
FMUL.FTZ R26, R51, R22
@P1 MOV R26, c[0x2][0x100]
@!P1 MOV R26, R24

The FMUL instruction is not an actual possible source, but unfortunately it is also considered to be one right now due to the use of predicates. The shader generator does not know that this is basically a if-else construct. The fact that it skips other phi nodes right now is what makes it work, as if only sees the constant buffer, and the LDG and FMUL are "hidden behind" another phi node.

I also added a log message when bindless elimination fails, since this seems to be a problem quite often.

This fixes save boxes being black on Paper Mario: The Thousand-Year Door.
Before:
image
After:
image
Testing is welcome. This might have performance impact as it enables "full bindless" in more cases, although I suspect this game was already triggering it before (I will update this after I can test it more).

@github-actions github-actions bot added the gpu Related to Ryujinx.Graphics label May 23, 2024
@ryujinx-mako ryujinx-mako bot requested review from riperiperi and a team May 23, 2024 05:11
@gdkchan gdkchan added the fix Fix something label May 23, 2024
@gdkchan gdkchan changed the title Extend full bindless to cover cases with phi nodes Vulkan: Extend full bindless to cover cases with phi nodes May 23, 2024
@GamerzHell9137
Copy link

GamerzHell9137 commented May 23, 2024

Fixes No Man's Sky too!

Before:
image

After:
image

@SoftTurnip
Copy link

image_2024-05-23_100459505
Tested and it also fixes properly the crystal stars that were black before!

@CuppaXanax
Copy link

image
Wanted to +1 that this fixed save blocks for me - thanks for the fast fix!!

@BanchouBoo
Copy link

BanchouBoo commented May 23, 2024

Getting an out of memory error that crashes the emulator when trying to load into East Rogueport from the main square, going from the main square through other loading zones (west, south, the pipe) does not crash. This crash does not happen for me on the latest master build (e65effc).

Log file Ryujinx_1.1.0+1f40537_2024-05-23_18-18-53.log

@DPS2004
Copy link

DPS2004 commented May 23, 2024

Getting an out of memory error that crashes the emulator when trying to load into East Rogueport from the main square, going from the main square through other loading zones (west, south, the pipe) does not crash. This crash does not happen for me on the latest master build (e65effc).

Log file Ryujinx_1.1.0+1f40537_2024-05-23_18-18-53.log

Getting this as well. Downgrading back to the master build fixed it for me.

@tomineitor
Copy link

image
+1 to the fix. The save blocks and coins render properly now.

@Vbuck-gang
Copy link

looks like it's working for the save blocksScreenshot (131)

@Vbuck-gang
Copy link

chapter medals seem to work too Screenshot (133)

@Snavvie
Copy link

Snavvie commented May 25, 2024

Entering paper mode casues the game to blur a bit until game reset

@Like4Schnitzel
Copy link

Getting an out of memory error that crashes the emulator when trying to load into East Rogueport from the main square, going from the main square through other loading zones (west, south, the pipe) does not crash. This crash does not happen for me on the latest master build (e65effc).

Log file Ryujinx_1.1.0+1f40537_2024-05-23_18-18-53.log

Happens for me too, even when attempting to enter East Rogueport from the sewers pipe. Black screen for a while, watch memory usage go up steadily, then an "ErrorOutOfDeviceMemory" crash.

@ChromaZero
Copy link

Hi, (RTX3060, using dev-build here with the latest firmware), everything works well so far but rarely, the textboxes appear to become corrupted like in the attached image.
image

@Vbuck-gang
Copy link

@riperiperi

@gdkchan
Copy link
Member Author

gdkchan commented May 26, 2024

Getting an out of memory error that crashes the emulator when trying to load into East Rogueport from the main square, going from the main square through other loading zones (west, south, the pipe) does not crash. This crash does not happen for me on the latest master build (e65effc).

Log file Ryujinx_1.1.0+1f40537_2024-05-23_18-18-53.log

I rebased this on top of #6870 which should fix this crash.

@xsm2
Copy link

xsm2 commented May 26, 2024

Getting an out of memory error that crashes the emulator when trying to load into East Rogueport from the main square, going from the main square through other loading zones (west, south, the pipe) does not crash. This crash does not happen for me on the latest master build (e65effc).
Log file Ryujinx_1.1.0+1f40537_2024-05-23_18-18-53.log

I rebased this on top of #6870 which should fix this crash.

I East Rogueport doesn't crash for me after this changes

@Like4Schnitzel
Copy link

Like4Schnitzel commented May 26, 2024

It appears that surfaces, which have been fixed with this, display weird flickers. See the attached video for reference. Flickers in the video occur on:

  • The hook anchors on the wall
  • The save block edges
  • Golden parts of the Thousand Year Door

All these surfaces were completely black prior to the fix.
Flickers appear to update whenever the camera moves.

ttyd_ryujinx_flicker.mp4

EDIT: It appears the save block in Rogueport is fine, no flickers. Very curious.
EDIT 2: Upon closer inspection, the save block in the sewers right beside the East Rogueport pipe also exhibits flickering. So it seems this only applies to fixed surfaces in areas where there was a black screen on AMD cards previously?

@riperiperi
Copy link
Member

This seems to be an issue with AMD graphics cards, again. I think it was also visible in Penny's Big Breakaway, so maybe it's an issue with how barriers work with texture arrays.

@AZthemute
Copy link

AZthemute commented May 26, 2024

Entering paper mode casues the game to blur a bit until game reset

I am also getting this.

2024-05-26.13-54-24.mp4

Sadly, I can't provide logs due to Vulkan causing my logs to go haywire and write about 1 GB of logs per minute (this happens on the main branch too. This is not an issue specific to this PR, and likely just an issue with my hardware, but I'm not sure).

Aside from that, the save block and crystal stars do work normally.

Copy link
Member

@riperiperi riperiperi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I tested a varied bunch of games and it didn't trigger when unnecessary, which was really my only concern.

@gdkchan gdkchan merged commit c41fddd into Ryujinx:master May 26, 2024
12 checks passed
@gdkchan gdkchan deleted the more-bindless branch May 26, 2024 18:21
@AZthemute
Copy link

Entering paper mode casues the game to blur a bit until game reset

I am also getting this.

2024-05-26.13-54-24.mp4

Sadly, I can't provide logs due to Vulkan causing my logs to go haywire and write about 1 GB of logs per minute (this happens on the main branch too. This is not an issue specific to this PR, and likely just an issue with my hardware, but I'm not sure).

Update, this seems to not happen when my resolution scale is set to Native (the video has it set to 2x). The logs are sadly still multiple GB for me, but I'm hoping someone else with the same issue can post detailed logs of why the blur effect is being caused. I'm suspecting it has something to do with the resolution scale, since anything higher than native after entering paper mode seems to do nothing to the image.

@cy-bernet-ix
Copy link

Hi, (RTX3060, using dev-build here with the latest firmware), everything works well so far but rarely, the textboxes appear to become corrupted like in the attached image. image

I'm also getting this.
image

@Ryujinx Ryujinx locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fix Fix something gpu Related to Ryujinx.Graphics
Projects
None yet
Development

Successfully merging this pull request may close these issues.