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.
Checklist
cargo clippy
.cargo clippy --target wasm32-unknown-unknown
if applicable.Connections
none
Description
This used to be disallowed in older versions of the WebGPU spec, but it's allowed now: gpuweb/gpuweb@eb96ea6
That said, I'm not sure about the Metal side of it all. According to the original discussion, Metal doesn't support empty scissor rects. I tested just now however, and at least on Ventura 13.4 it's absolutely allowed. I cross-checked Dawn's source code and there doesn't seem to be any special trickery of using empty viewports there either (as suggested in the spec commit).
I just left the Metal backend untouched and, well, it seems to work.
Testing
I modified
hello-triangle
to draw with an empty scissor rectangle, and confirmed it did what I want.