Ported WebGPU blur path to use fragment shaders #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on a request from kbr@ in https://issues.chromium.org/u/1/issues/445223447
This change ports the WebGPU Blur renderer to use Render passes instead of compute passes. The shaders were ported as directly as possible from the WebGL version of the shaders, not the WebGPU version that was previously in the file. This is for the purposes of providing a more direct power usage comparison between the WebGPU and WebGL versions (which I have not done).
The main benefits of using the fragment shaders here are that they make some of the texture sampling simpler, "workgroup" sizes will be handled by the implementation automatically and optimally. It also doesn't require STORAGE usage, and thus any concerns about being able to use bgra8 as a storage texture are no longer a problem. This likely removes the need for the "Zero-copy output" toggle, since you are guaranteed that it can always be zero copy. Nevertheless I've still included support for both modes in case it was providing something else I wasn't aware of.