Skip to content
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

Allow empty scissor rects #3863

Merged
merged 3 commits into from Jun 15, 2023
Merged

Conversation

PJB3005
Copy link
Contributor

@PJB3005 PJB3005 commented Jun 13, 2023

Checklist

  • Run cargo clippy.
  • Run cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

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.

PJB3005 and others added 3 commits June 13, 2023 13:13
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.
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: Filed #3871 as a follow up

@cwfitzgerald cwfitzgerald merged commit acb7712 into gfx-rs:trunk Jun 15, 2023
20 checks passed
@PJB3005 PJB3005 deleted the 23-06-13-empty-scissor branch June 16, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants