Shader Complilation on PC: About to become a bigger bottleneck?

Discussion in 'Rendering Technology and APIs' started by Flappy Pannus, Aug 6, 2020.

  1. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    For me it was pretty bad. Especially in DX12.. every time hitting objects for the first time, or doing abilities... loading into new areas.. DX11 was a bit better.. but still not good.

    Now DX12 is smooth as butter first time through doing anything. Wish it was like this the first time I played it.
     
  2. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    Another thing I was thinking about is that tech sites/channels like Digital Foundry should add gaming "Shader Compilation" tests to their CPU benchmarks. They could pick a suite of games which have these pre-compilation processes and test how long they take to complete on various CPUs they are reviewing, as well as how well they scale with core counts.

    I myself would honestly appreciate that, because if we can expect more of this stuff in the future, there's some value in knowing if it's worth shelling out a bit more money for more cores to drastically reduce the waiting time.

    Also I just think it actually makes a very interesting comparison point between CPUs, which we haven't really seen much of.
     
    #162 Remij, Nov 27, 2021
    Last edited: Nov 27, 2021
    Shifty Geezer, Malo, CeeGee and 2 others like this.
  3. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    @Dictator brought up an issue with Hellblade: Senua's Sacrifice's recent PC RT patch in a past DF Direct. The game suffered from stuttering using the DX12 path, but a patch has just been released which fixes those stutters by pre-generating shaders for both RT off and on presets.

    Good to hear! And I strongly believe that Alex bringing it up in that DF Direct, as well as just in general in other videos has a lot to do with these things actually getting fixed! Also, this bodes well for Hellblade 2, as theoretically they wouldn't want to make the same mistake twice.
     
  4. Malo

    Malo Yak Mechanicum
    Legend Subscriber

    Joined:
    Feb 9, 2002
    Messages:
    8,929
    Likes Received:
    5,528
    Location:
    Pennsylvania
    Isn't the whole problem with shader generation on PC that you have to generate them per GPU and driver version? Or is this doing shader generation on startup?
     
  5. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    I haven't tested it yet, but I'm assuming they mean locally pre-generating on startup.
     
  6. Scott_Arm

    Legend

    Joined:
    Jun 16, 2004
    Messages:
    15,134
    Likes Received:
    7,678
    It's doing it on startup instead of during gameplay. The better way of doing it. Yah, the problem is you have to compile shaders per gpu per driver, so you can't ship them all with the game.
     
    Malo likes this.
  7. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    Ok well I just tested it, and there was no pre-compilation process for me... and the game still stutters like crazy in DX12. :(
     
  8. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    Got another one here.. wow... Guerrilla Games adds DLSS and FSR to Horizon Zero Dawn on PC, and again improves shader compilation process!



     
    PSman1700, BRiT, jlippo and 1 other person like this.
  9. BRiT

    BRiT (>• •)>⌐■-■ (⌐■-■)
    Moderator Legend Alpha

    Joined:
    Feb 7, 2002
    Messages:
    20,502
    Likes Received:
    24,397
    Weird that they remove the separate step and instead shift it to in the background process. Though it sounds like they made it more efficient and has loading screens waiting for the process to complete before proceeding on.
     
    Krteq likes this.
  10. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    3,240
    Likes Received:
    3,393
    It was a background process since patch 1.09 I think.
    The difference is that they've removed the indicator of shaders compiling from the main menu.
    Dunno if that's an issue as I never really saw much difference between waiting in main menu for this compilation to finish and just loading the game straight away.
     
    Krteq and BRiT like this.
  11. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    Ok, so I've tested it out, and they indeed have removed the
    Yea. Though to be honest, I wish they'd add that indicator back in. Keep it the same way it is now, but just add the indicator back to the main/pause menu so that people would know when the game has finished fully caching the shaders without having to use some program to monitor their CPU usage to let them know.
     
  12. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    3,240
    Likes Received:
    3,393
    I mean I can see this being an issue on slower CPUs where background compilation would either affect general performance or won't be able to finish in time when the shaders will actually be needed for a frame.
    So some sort of process indication is generally a good idea.
     
  13. Lurkmass

    Regular

    Joined:
    Mar 3, 2020
    Messages:
    565
    Likes Received:
    711
    Shameless self-plug incoming and we have possibly more bad news on the way ...

     
  14. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    ^yay...

    I'm so tired of this BS. FF7R just released today, and yep... sure as hell.. it's got stuttering issues all over the place from shader compilation...

    Look at this... your first introduction to the world of FF7R..



    You know, it's actually a nice metaphor.. as the cinematic intro video ends on a train engine screeching to a halt the UE4 render thread also screeches to a halt any time it has to wait for shaders to compile.


    ...like... who QA tests this stuff? How do you let it ship like that? I just don't get it. It's god damn depressing as hell to me. Then when Cloud jumps down from the train... another massive stutter...

    This game is cinematic as hell... it's going to be like that the entire damn time.. ugh.
     
    pharma, PSman1700, jlippo and 2 others like this.
  15. Lurkmass

    Regular

    Joined:
    Mar 3, 2020
    Messages:
    565
    Likes Received:
    711
    I thought everyone knew that Unreal Engine compiles at draw time ? Pretty sure compilation stutters are intentionally by design in Unreal Engine for the sake of the artists or iteration times ...

    Artists would prefer stutter over their editor freezing/locking up for potentially indeterminate amount of time ...
     
    DavidGraham likes this.
  16. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    ...lmao
     
  17. Dictator

    Regular

    Joined:
    Feb 11, 2011
    Messages:
    681
    Likes Received:
    3,969
    So this is probably one of the worst AAA PC ports in a long time. Impressive.
     
    T2098, PSman1700, Remij and 2 others like this.
  18. Lurkmass

    Regular

    Joined:
    Mar 3, 2020
    Messages:
    565
    Likes Received:
    711
    Unreal Engine's inherent limitations aren't the fault of developers ...
     
  19. Remij

    Regular

    Joined:
    May 3, 2008
    Messages:
    677
    Likes Received:
    1,256
    Explain Doublefine who managed to fix Psychonauts 2's compilation issues then.. or The Coalition with Gears.. or Sony Bend with Days Gone...

    This isnt an inherent engine issue... You CAN precompile shaders in Unreal Engine... developers just seemingly don't bother to. There are developers who care to put in the effort to properly optimize.. and those who don't.. or are too small and can't due to lack of resources.

    SquareEnix is not a small developer... and a game like FF7R isn't a low budget game.. this is embarrassing to ship a game like this..
     
    PSman1700 and BRiT like this.
  20. Lurkmass

    Regular

    Joined:
    Mar 3, 2020
    Messages:
    565
    Likes Received:
    711
    The default behaviour for Unreal Engine is asynchronous shader compilation with on-demand PSO streaming. Basically, every time the engine issues a draw command and there's a unique PSO you are guaranteed to get shader compilation related stutters ...

    Developers could try to implement a workaround but why would Square do that in particular when their project isn't even complete yet ?
     
    DavidGraham likes this.
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...