-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Render API v3 #117
Comments
The shadow example creates one render pass for each light source and another for the forward rendering pass. A total of 3 render passes per frame. The water example also uses three render passes. This doesn't appear to align with the recommendations in the linked middleware article:
It may be that there is just no way to do these rendering techniques without multiple render passes. Which would extend to the I will still keep this tracking ticket open, just in case things change in the future, or if new ideas happen to come up. Previous discussions suggested it may be nice to allow users to manage the GPU and treat |
Here's talk of render subpasses in webgpu: gpuweb/gpuweb#393 This is something that the noise renderer in the custom shader example could make use of. But I still don't believe this will be usable in general cases. Taking the shadow and water examples again as illustration. |
This ticket will track exploration to improve the render API further. This is a superset of #107
First up: Refactor the render API to follow the middleware pattern. This API replaces the
CommandEncoder
andTextureView
references with a singleRenderPass
ref.I'm not able to get this to work with closures, so the new API will force the caller to manage the swap chain, command encoder, and render pass. This design isn't in the spirit of
pixels
, which wants to minimize user responsibility over the GPU.I also had trouble reusing the
RenderPass
for bothpixels
and thecustom-shader
example, as described by the Encapsulating Graphics Work article. The custom shader samples from a texture that is written by thepixels
render pipeline. I have not found a way to make this work with a single render pass, but some quick searching indicates that Vulkan has a concept of subpasses for this (and I cannot find any mention of this concept in webgpu).Even if subpasses were implicit, the pixel that the fragment shader works on would need to be
inout
, which is apparently not valid at global scope. I wasn't even able to create a render pass with multiple color attachments (hoping the first pass would use the first attachment, the second pass uses the second attachment) but that didn't work because the render pipeline needs to know about all attachments! I must be missing something because deferred rendering doesn't appear to be possible at all.The text was updated successfully, but these errors were encountered: