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

Discard draws when the instance/vertex/index count is zero #5137

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

nical
Copy link
Contributor

@nical nical commented Jan 24, 2024

Connections

Fixes #1879

Description

Discard draws when the instance/vertex/index count is zero

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.

@nical nical requested a review from a team as a code owner January 24, 2024 15:02
Copy link
Member

@ErichDonGubler ErichDonGubler left a comment

Choose a reason for hiding this comment

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

I think this is still compliant based on my read of GPURenderCommandsMixin.draw, though I'm surprised that there's no validation/mention of this case for this. LGTM, but I wanted to loop in @teoxoy or @jimblandy to make sure I'm not missing anything with my lesser familiarity with the spec.

@nical
Copy link
Contributor Author

nical commented Jan 25, 2024

There is no validation simply because it is valid. The reason we have to discard these empty draws is to work around the backend having issues with it.

@nical nical merged commit d47534e into gfx-rs:trunk Jan 25, 2024
27 checks passed
@nical nical deleted the empty-draw branch January 25, 2024 08:06
@cwfitzgerald
Copy link
Member

cwfitzgerald commented Jan 25, 2024

Could we add documentation to hal that these are not valid calls to make?

Arguably they should be valid calls and this be handled by the metal backend?

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.

Assertion failure when using Metal GPU capture
3 participants