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

sampler: Add missing gpu_resource_id() getter #328

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

MarijnS95
Copy link
Contributor

@MarijnS95 MarijnS95 commented Jul 13, 2024

According to the upstream docs and the Metal Shader Converter implementation the SamplerState type has a way to get access to its MTLResourceID on the GPU: https://developer.apple.com/documentation/metal/mtlsamplerstate/3974101-gpuresourceid

Copy link
Contributor

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

The label is explicitly marked as readonly in the documentation, so I wouldn't rely on it being settable after the creation of the sampler state.

@MarijnS95 MarijnS95 changed the title sampler: Add missing gpu_resource_id() getter and set_label() setter sampler: Add missing gpu_resource_id() getter Jul 14, 2024
@MarijnS95
Copy link
Contributor Author

Right there's another documentation page that actually describes this.

It seems inconsistent at first, but after a while most *Descriptor based types (that are created from a *Descriptor with a var label? { get set }) appear to have a readonly var label? { get } on the final object/instance.

According to the upstream docs and the Metal Shader Converter
implementation the `SamplerState` type has a way to get access to its
`MTLResourceID` on the GPU:
https://developer.apple.com/documentation/metal/mtlsamplerstate/3974101-gpuresourceid
@kvark kvark merged commit ef768ff into gfx-rs:master Nov 24, 2024
2 checks passed
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.

4 participants