You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
Reacted by Corentin Wallez
devshgraphicsprogramming commented on Oct 30, 2019
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.
Activity
kainino0x commentedon Aug 8, 2019
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.
krogovin commentedon Aug 8, 2019
Ok, but keep this thought in mind since it can be a big deal for tiled based renderers.
[-]Renderpasses for mobile[/-][+]Add render sub-passes[/+]litherum commentedon Aug 9, 2019
Whatever we do here, we should make sure it can be implemented on Metal Imageblocks.
devshgraphicsprogramming commentedon Oct 28, 2019
This stuff needs to be in core.
kvark commentedon Oct 30, 2019
@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.
devshgraphicsprogramming commentedon Oct 30, 2019
Aand the alternative is just killing performance across the hardware that could have supported and exposed it?
kvark commentedon Oct 30, 2019
@devshgraphicsprogramming no - the alternative is speccing an extension for this.
FlorianUekermann commentedon Dec 15, 2019
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.
Kangz commentedon Sep 2, 2021
Closing in favor of #435
Fix dev_server cache key for Typescript files (gpuweb#393)