Skip to content

Commit e7e1dc8

Browse files
committed
sampler: Add missing gpu_resource_id() getter
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
1 parent 864417d commit e7e1dc8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sampler.rs

+4
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,8 @@ impl SamplerStateRef {
158158
crate::nsstring_as_str(label)
159159
}
160160
}
161+
162+
pub fn gpu_resource_id(&self) -> MTLResourceID {
163+
unsafe { msg_send![self, gpuResourceID] }
164+
}
161165
}

0 commit comments

Comments
 (0)