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

VideoCommon: Add support for unrestricted depth range. #13100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CrossVR
Copy link
Contributor

@CrossVR CrossVR commented Oct 4, 2024

This PR uses the unrestricted depth range extension to achieve the following:

  • Remove the need for normalization of the [0, 2^24) depth value range.
  • Natively support oversized depth ranges while still clamping the result to the [0, 2^24) range.

This is mostly a clean up by providing a code path that removes normalization and was not intended as an accuracy fix. However by removing normalization we have an opportunity to influence rounding behavior, which fixes the last known issue with fast depth.

@CrossVR CrossVR force-pushed the unrestricted-depth-range branch 2 times, most recently from 793ef80 to 8a3e4e1 Compare October 5, 2024 01:05
@CrossVR
Copy link
Contributor Author

CrossVR commented Oct 5, 2024

There seems to be an issue with the lavapipe implementation, these results do not reproduce on Nvidia. I'll investigate the driver bug.

@Pokechu22
Copy link
Contributor

However by removing normalization we have an opportunity to influence rounding behavior, which fixes the last known issue with fast depth.

Which issue does this fix? https://bugs.dolphin-emu.org/issues/13633 seems to still be present on my Nvidia GPU when using fast depth but not with fast depth disabled.

@JMC47
Copy link
Contributor

JMC47 commented Oct 5, 2024

You might need modified driver that supports it.

@Pokechu22
Copy link
Contributor

I see an Available extension: VK_EXT_depth_range_unrestricted line... but I'm missing VK_EXT_depth_clamp_control. (I do have VK_EXT_depth_clamp_zero_one but that doesn't seem useful here).

@CrossVR
Copy link
Contributor Author

CrossVR commented Oct 5, 2024

Correct you need a driver with VK_EXT_depth_clamp_control support or else we can't natively support oversized depth ranges. Though given that removing the normalization can fix the Pokemon channel I could add a code path that only removes the normalization while still using the vertex depth range hack to support oversized depth ranges.

@dolphin-ci
Copy link

dolphin-ci bot commented Oct 5, 2024

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • aeon-charge-attack on ogl-lin-mesa: diff
  • bk-tev on ogl-lin-mesa: diff
  • chibi-robo-fastdepth on ogl-lin-mesa: diff
  • chibi-robo-zfighting on ogl-lin-mesa: diff
  • ea-pink on ogl-lin-mesa: diff
  • ed-updated on ogl-lin-mesa: diff
  • fifa-street on ogl-lin-mesa: diff
  • fortune-street on ogl-lin-mesa: diff
  • fortune-street-fog on ogl-lin-mesa: diff
  • fortune-street-white-box on ogl-lin-mesa: diff
  • jb-shadow on ogl-lin-mesa: diff
  • kirby-shadows on ogl-lin-mesa: diff
  • last-story-shadows on ogl-lin-mesa: diff
  • lego-star-wars-crane-shadow on ogl-lin-mesa: diff
  • mario-baseball-shadows on ogl-lin-mesa: diff
  • mario-sluggers-bar on ogl-lin-mesa: diff
  • mini-ninjas on ogl-lin-mesa: diff
  • mkdd-babypark on ogl-lin-mesa: diff
  • mkdd-efb on ogl-lin-mesa: diff
  • mkw-bridge on ogl-lin-mesa: diff
  • mkwii-bluebox on ogl-lin-mesa: diff
  • mp2-scanner on ogl-lin-mesa: diff
  • mp3-bloom on ogl-lin-mesa: diff
  • nfsu-reflections on ogl-lin-mesa: diff
  • nhl-slap on ogl-lin-mesa: diff
  • nsmbw-intro on ogl-lin-mesa: diff
  • pbr-sfx on ogl-lin-mesa: diff
  • rs3-bumpmapping on ogl-lin-mesa: diff
  • simpsons-game on ogl-lin-mesa: diff
  • smg2-fog on ogl-lin-mesa: diff
  • smg-mmg on ogl-lin-mesa: diff
  • sonic-riders-blur on ogl-lin-mesa: diff
  • sonic-riders-zg-4p on ogl-lin-mesa: diff
  • sonicriderszg-gb on ogl-lin-mesa: diff
  • spyro-bloom on ogl-lin-mesa: diff
  • spyro-depth on ogl-lin-mesa: diff
  • super-sluggers-white-out on ogl-lin-mesa: diff
  • tla-menu on ogl-lin-mesa: diff
  • tos-invis-char on ogl-lin-mesa: diff
  • tsp3-pinkgrass on ogl-lin-mesa: diff
  • vegas-party-depth on ogl-lin-mesa: diff
  • xblade-bloom on ogl-lin-mesa: diff
  • xenoblade-menu on ogl-lin-mesa: diff
  • ztp-grass on ogl-lin-mesa: diff
  • chibi-robo-zfighting on mvk-osx-m1: diff
  • ea-pink on mvk-osx-m1: diff
  • ed-updated on mvk-osx-m1: diff
  • fortune-street on mvk-osx-m1: diff
  • fortune-street-fog on mvk-osx-m1: diff
  • fortune-street-white-box on mvk-osx-m1: diff
  • kirby-shadows on mvk-osx-m1: diff
  • mini-ninjas on mvk-osx-m1: diff
  • mkdd-babypark on mvk-osx-m1: diff
  • mkdd-efb on mvk-osx-m1: diff
  • mkw-bridge on mvk-osx-m1: diff
  • mkwii-bluebox on mvk-osx-m1: diff
  • mp2-scanner on mvk-osx-m1: diff
  • my-word-coach on mvk-osx-m1: diff
  • nfsu-reflections on mvk-osx-m1: diff
  • nhl-slap on mvk-osx-m1: diff
  • nintendo-channel on mvk-osx-m1: diff
  • nsmbw-intro on mvk-osx-m1: diff
  • pbr-sfx on mvk-osx-m1: diff
  • rs3-bumpmapping on mvk-osx-m1: diff
  • rs3-skybox2 on mvk-osx-m1: diff
  • simpsons-game on mvk-osx-m1: diff
  • smg2-fog on mvk-osx-m1: diff
  • sonic-riders-blur on mvk-osx-m1: diff
  • sonic-riders-zg-4p on mvk-osx-m1: diff
  • sonicriderszg-gb on mvk-osx-m1: diff
  • spyro-bloom on mvk-osx-m1: diff
  • spyro-depth on mvk-osx-m1: diff
  • tla-menu on mvk-osx-m1: diff
  • tos-invis-char on mvk-osx-m1: diff
  • tsp3-pinkgrass on mvk-osx-m1: diff
  • vegas-party-depth on mvk-osx-m1: diff
  • xblade-bloom on mvk-osx-m1: diff
  • xenoblade-menu on mvk-osx-m1: diff
  • ztp-grass on mvk-osx-m1: diff
  • chibi-robo-zfighting on mtl-osx-m1: diff
  • ea-pink on mtl-osx-m1: diff
  • ed-updated on mtl-osx-m1: diff
  • fortune-street on mtl-osx-m1: diff
  • fortune-street-fog on mtl-osx-m1: diff
  • fortune-street-white-box on mtl-osx-m1: diff
  • kirby-shadows on mtl-osx-m1: diff
  • mini-ninjas on mtl-osx-m1: diff
  • mkdd-babypark on mtl-osx-m1: diff
  • mkdd-efb on mtl-osx-m1: diff
  • mkw-bridge on mtl-osx-m1: diff
  • mkwii-bluebox on mtl-osx-m1: diff
  • mp2-scanner on mtl-osx-m1: diff
  • my-word-coach on mtl-osx-m1: diff
  • nfsu-reflections on mtl-osx-m1: diff
  • nhl-slap on mtl-osx-m1: diff
  • nintendo-channel on mtl-osx-m1: diff
  • nsmbw-intro on mtl-osx-m1: diff
  • pbr-sfx on mtl-osx-m1: diff
  • rs3-bumpmapping on mtl-osx-m1: diff
  • rs3-skybox2 on mtl-osx-m1: diff
  • simpsons-game on mtl-osx-m1: diff
  • smg2-fog on mtl-osx-m1: diff
  • sonic-riders-blur on mtl-osx-m1: diff
  • sonic-riders-zg-4p on mtl-osx-m1: diff
  • sonicriderszg-gb on mtl-osx-m1: diff
  • spyro-bloom on mtl-osx-m1: diff
  • spyro-depth on mtl-osx-m1: diff
  • tla-menu on mtl-osx-m1: diff
  • tos-invis-char on mtl-osx-m1: diff
  • tsp3-pinkgrass on mtl-osx-m1: diff
  • vegas-party-depth on mtl-osx-m1: diff
  • xblade-bloom on mtl-osx-m1: diff
  • xenoblade-menu on mtl-osx-m1: diff
  • ztp-grass on mtl-osx-m1: diff

automated-fifoci-reporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants