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

Implement push constants for metal backend #2314

Merged
merged 2 commits into from
Dec 24, 2021

Conversation

TheOnlyMrCat
Copy link
Contributor

Connections
Fixes #1825

Description
Implement push constants for the metal backend in wgpu-hal. I adapted the implementation from gfx-backend-metal v0.9, and tried to match its behaviour.

Testing
Compute shader push constants tested with googlefonts/compute-shader-101 example from #2258.
Vertex shader push constants and reassignment tested with my own code from polystrip

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

A few small comments, overall looks great!
I like how much simpler this is versus gfx-backend-metal version, given that the programming model here is more restricted.

wgpu-hal/src/metal/mod.rs Show resolved Hide resolved
wgpu-hal/src/metal/command.rs Outdated Show resolved Hide resolved
@kvark kvark enabled auto-merge (squash) December 24, 2021 19:40
@kvark kvark merged commit 61fa8a3 into gfx-rs:master Dec 24, 2021
@TheOnlyMrCat TheOnlyMrCat deleted the metal-push-constants branch December 25, 2021 23:02
@kvark kvark added the PR: needs back-porting PR with a fix that needs to land on crates label Dec 29, 2021
kvark pushed a commit to kvark/wgpu that referenced this pull request Dec 29, 2021
* Implement push constants for metal backend

* Clear push constants on reset; get upload size from layout
kvark pushed a commit that referenced this pull request Dec 29, 2021
* Implement push constants for metal backend

* Clear push constants on reset; get upload size from layout
@kvark
Copy link
Member

kvark commented Dec 29, 2021

published in wgpu-hal-0.12.1

@kvark kvark removed the PR: needs back-porting PR with a fix that needs to land on crates label Dec 29, 2021
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.

Missing Features::PUSH_CONSTANTS for Metal
2 participants