Skip to content

Commit

Permalink
sampler: Add missing gpu_resource_id() getter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MarijnS95 committed Jul 14, 2024
1 parent 864417d commit e7e1dc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,8 @@ impl SamplerStateRef {
crate::nsstring_as_str(label)
}
}

pub fn gpu_resource_id(&self) -> MTLResourceID {
unsafe { msg_send![self, gpuResourceID] }
}
}

0 comments on commit e7e1dc8

Please sign in to comment.