gfx-rs / metal-rs

Rust bindings for Metal
Apache License 2.0
567 stars 112 forks source link

sampler: Add missing `gpu_resource_id()` getter #328

Open MarijnS95 opened 1 month ago

MarijnS95 commented 1 month ago

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

MarijnS95 commented 1 month ago

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.