VRS: Variable Rate Shading *spawn*

Discussion in 'Rendering Technology and APIs' started by BRiT, Jun 26, 2020.

  1. Frenetic Pony

    Regular Newcomer

    Joined:
    Nov 12, 2011
    Messages:
    681
    Likes Received:
    363
    I need to make sure but I don't think VRS natively works with compute shader threads... all the documentation and implementation details I've seen either state or imply its for pixel shader threads. Can anyone confirm?
     
  2. iroboto

    iroboto Daft Funk
    Legend Regular Subscriber

    Joined:
    Mar 6, 2014
    Messages:
    13,021
    Likes Received:
    15,765
    Location:
    The North
    I think he’s referring to standard compute shaders augmenting the 3D pipeline as regular and not specifically VRS being called from within the compute shader pipeline.
     
    DegustatoR likes this.
  3. DegustatoR

    Veteran

    Joined:
    Mar 12, 2002
    Messages:
    2,206
    Likes Received:
    1,601
    Location:
    msk.ru/spb.ru
    Rasterization doesn't work from compute threads either. So if you plan on shading pixels with compute you still need to get them somehow and if you're getting them from h/w rasterizer then you can use VRS. If not then as I've said h/w VRS won't help probably - but if it will be a case of s/w rasterizing one pixel triangles like in UE5 then you'd probably won't want to use VRS here anyway. At least that would be my take here, I can be wrong.
     
    PSman1700 and BRiT like this.
  4. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,480
    Likes Received:
    417
    Worded another way... what I understood DegustatoR to be saying, and I agree with, is you rasterize the G-buffer using VRS. Then it doesn't matter if you use PS or CS to consume the G-buffer. The G-buffer is written by a PS.
     
  5. Frenetic Pony

    Regular Newcomer

    Joined:
    Nov 12, 2011
    Messages:
    681
    Likes Received:
    363
    I'm trying to find anything I can about specific technical details of what's happening behind the scenes. But again, I don't think that's how it works. Even going through all of Microsoft's talks about it at GDC, they specifically mention pixel shader invocations per defined tile. And the Gears guys specifically mention it does not work with UE's new screenspace GI, which is a compute shader and not a pixel shader. It seems like it invokes the specific pixel shader once per tile and does all the reconstruction magic for you. And maybe the hw implementation of VRS could be changed to work with compute shaders, whatever it's doing. And it's not like the screenspace tile idea couldn't work universally. Sample geometry at X rate, tile based on proximity/normal direction, downsample each tile, then shade either full version or downsampled version for each pass dependent on what you're doing, upsample and combine. It's more or less the deferred version of what IW tried for Modern Warfare at first.

    But as stated, all the evidence I've seen points towards hardware VRS currently being more restrictive than that.
     
    #85 Frenetic Pony, Feb 21, 2021
    Last edited: Feb 21, 2021
    Remij likes this.
  6. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,480
    Likes Received:
    417
    I don't know the specifics of the Gears screenspace GI, but it really depends on the algorithm using the G-buffer. If you need the full resolution pixel data as input to the then using VRS to create it won't work.

    There are some specific limitations depending on the hardware (see the AMD recommendations slide someone posted), but the basics of VRS are it's used in conjunction with the hardware rasterizer. So it works with Pixel Shaders. If the compute passes can work with this data they are orthogonal to VRS. So as was stated earlier compute based rasterization doesn't work with hardware VRS.
     
  7. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,480
    Likes Received:
    417
    I just realized part of the confusion here may be where the savings come from. When forward shading the savings comes in the final pixel shading. When using deferred shading the saving is rendering the G-buffer. Maybe there's a trick to get savings for the final shading pass, but I've not read about it or given any thought.
     
    tinokun and BRiT like this.
  8. Ethatron

    Regular Subscriber

    Joined:
    Jan 24, 2010
    Messages:
    921
    Likes Received:
    356
    It's situational I think, if the hardware plays well with it.
    If you have a shading rate map, then you can respect that for Tiled passes too. The problem is more how to deal with the incoherence. If there are only a handful of distinct rate-tile patterns, maybe a stencil test in a PS (instead of CS) could be possible. Or using your preferred version of masking specific compute lanes on the compute grid.
    If you align all the dimensions well, and a rate-tile is at least a natural multiple of the threat-group size, then the rate-tile switch potentially are coherent, and it depends on the hardware if it finds that appealing or not.
     
  9. BRiT

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

    Joined:
    Feb 7, 2002
    Messages:
    18,795
    Likes Received:
    21,098
    There's an upcoming session as part of Microsoft's Game Stack event in April on VRS. I hope there's more details shared online afterwards or at least the full video of the session.

     
  10. scently

    Veteran Regular

    Joined:
    Jun 12, 2008
    Messages:
    1,083
    Likes Received:
    420
    Previous article by The Coalition on implementing VRS in Gears 5/Gears Tactics: https://devblogs.microsoft.com/directx/gears-vrs-tier2/
    I think it's important to post this again as they go into detail about what they did, the challenges/solutions, and future work including taking VRS into account from the inception of development (as opposed to implementing it after the game has already been completed. The implication being that it will provide more performance improvement/saving), and combining software VRS with hardware VRS.
     
    #90 scently, Feb 22, 2021
    Last edited: Feb 22, 2021
    Jay, RagnarokFF and BRiT like this.
  11. Jay

    Jay
    Veteran Regular

    Joined:
    Aug 3, 2013
    Messages:
    3,470
    Likes Received:
    2,826
    In the first post with a couple other worth while links.
    Worth bringing up again though.
     
    scently likes this.
  12. jlippo

    Veteran Regular

    Joined:
    Oct 7, 2004
    Messages:
    1,597
    Likes Received:
    841
    Location:
    Finland
    There were few good VRS talks a while back.
    This has segment how to implement sparse lighting using g-buffer.
     
    tinokun, Krteq, Pete and 5 others like 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...