Skip to content

Add render sub-passes #393

Closed
Closed

Description

@krogovin

This is a feature request to have something akin to Renderpasses from the Vulkan API. The main use case is when an application renders to a (quite fat) G-buffer which is then in a next pass used to read data to compute lighting. With Renderpasses, the G-buffer is never written to memory and reads from the G-buffer are restricted to be at the same fragment location as the frag shader reading it is at. This is essentially a big performance (and potentially battery saver) for mobile platforms.

Because of the complexity in specifying it, in addition that not all of the new API's support it along with that the only impact is really for tiled based renderers, I am advocating for this to come as a later extension. There was discussion related to this in a much older issue, #23, but there has been no words there in two years.

Activity

  1. kainino0x commented on Aug 8, 2019

    @kainino0x
    Contributor

    I think you're talking specifically about subpasses - we already have single-subpass render passes.

    We did decide (long ago) to omit them in 1.0 based, IIRC, on some feedback from hardware vendors. But it makes sense to consider them again in the future.

  2. added
    feature request
    on Aug 8, 2019
  3. krogovin commented on Aug 8, 2019

    @krogovin
    Author

    Ok, but keep this thought in mind since it can be a big deal for tiled based renderers.

  4. changed the title [-]Renderpasses for mobile[/-] [+]Add render sub-passes[/+] on Aug 9, 2019
  5. litherum commented on Aug 9, 2019

    @litherum
    Contributor

    Whatever we do here, we should make sure it can be implemented on Metal Imageblocks.

  6. devshgraphicsprogramming commented on Oct 28, 2019

    @devshgraphicsprogramming

    This stuff needs to be in core.

  7. kvark commented on Oct 30, 2019

    @kvark
    Contributor

    @devshgraphicsprogramming this isn't obvious.

    There is certainly a way to expose render pass API, which would map to Vulkan sub-passes and Metal image blocks. But on platforms that don't have any matching features (D3D, Metal before image blocks, Vulkan on desktop under the hood), they would translate into regular loads and stores.

    The problem is that I don't think we can say "if you can use sub-passes, use them, and you'll run faster". The architecture of a rendering pipeline typically diverges between "we can use HW tile cache" and "we can't", so exposing core render pass API that doesn't do any acceleration is both having negative effect on the portability properties and not very useful for performance-sensitive apps.

    In other words, this would be a candidate for the core API if we could consistently (across platforms) say that this feature is backed by driver/hardware support.

  8. devshgraphicsprogramming commented on Oct 30, 2019

    @devshgraphicsprogramming

    Aand the alternative is just killing performance across the hardware that could have supported and exposed it?

  9. kvark commented on Oct 30, 2019

    @kvark
    Contributor

    @devshgraphicsprogramming no - the alternative is speccing an extension for this.

  10. FlorianUekermann commented on Dec 15, 2019

    @FlorianUekermann

    Correct me if I'm wrong, but I don't think the value of sub-passes lies entirely in using some kind of tile cache for transient attachments. http://gpuopen.com/wp-content/uploads/2016/03/VulkanFastPaths.pdf (GDC 2016) mentions a number of other benefits, which AMD seems to think apply to their to their desktop GPUs. Some of those benefits were mentioned in #23 as well, but I highly recommend a close look at the slides linked above.
    I understand that you may not want to include subpasses in V1, but checking that extending the api with subpass support in v2 core won't create problems seems more appropriate than planning for an extension.

    I don't quite see the portability issues, but tbh I'm not familiar enough with any WebGPU implementation to be sure. However, the whole idea of subpasses seems to be to describe dependencies and data flow more precisely and succinctly as a graph. Given the extra work a WebGPU implementation has to do for safety and portability, maybe vulkan-like renderpasses could actually reduce the overhead of the WebGPU implementation compared to the underlying APIs.

    Last but not least, I find multi-subpass renderpasses easier to use in practice than a set of separate renderpasses.

  11. Kangz commented on Sep 2, 2021

    @Kangz
    Contributor

    Closing in favor of #435

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions