Improve sampler

This commit is contained in:
hodasemi 2025-02-28 14:45:27 +01:00
parent 260051b42c
commit c650dcd1e0

View file

@ -112,7 +112,7 @@ impl Sampler {
} }
} }
pub fn pretty_sampler() -> SamplerBuilder { pub fn pretty_sampler(device: &Device, lod: f32) -> SamplerBuilder {
SamplerBuilder { SamplerBuilder {
create_info: VkSamplerCreateInfo::new( create_info: VkSamplerCreateInfo::new(
0, 0,
@ -123,12 +123,20 @@ impl Sampler {
VK_SAMPLER_ADDRESS_MODE_REPEAT, VK_SAMPLER_ADDRESS_MODE_REPEAT,
VK_SAMPLER_ADDRESS_MODE_REPEAT, VK_SAMPLER_ADDRESS_MODE_REPEAT,
0.0, 0.0,
true, device.physical_device().features().samplerAnisotropy.into(),
8.0, if device.physical_device().features().samplerAnisotropy.into() {
device
.physical_device()
.properties()
.limits
.maxSamplerAnisotropy
} else {
1.0
},
false, false,
VK_COMPARE_OP_NEVER, VK_COMPARE_OP_NEVER,
0.0, 0.0,
0.0, lod,
VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE,
false, false,
), ),