add convenience function (#1197)

This commit is contained in:
Restioson 2021-01-03 21:57:18 +02:00 committed by GitHub
parent ca310b856f
commit 820f37fccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,15 @@ pub struct SamplerDescriptor {
pub anisotropy_clamp: Option<NonZeroU8>,
}
impl SamplerDescriptor {
/// Sets the address mode for all dimensions of the sampler descriptor.
pub fn set_address_mode(&mut self, address_mode: AddressMode) {
self.address_mode_u = address_mode;
self.address_mode_v = address_mode;
self.address_mode_w = address_mode;
}
}
impl Default for SamplerDescriptor {
fn default() -> Self {
SamplerDescriptor {