Anisotropic samplers with point mips keep them where the card has them (upstream e45bacd, 23fc8a5, 7dfa86f)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-24 23:24:56 -06:00
1 parent c5a2f8d6fd
commit 011735ff80
3 files changed
+90 -3

No files matched your search

+14 -1
View File
@@ -437,6 +437,19 @@ impl HostPipeline {
}
let host = host()?;
let mut options = D3D12_FEATURE_DATA_D3D12_OPTIONS19::default();
// SAFETY: the feature query writes the structure of the given size.
// Older runtimes may not recognize OPTIONS19; that means no support.
let aniso_point_mip_supported = unsafe {
host.device.CheckFeatureSupport(
D3D12_FEATURE_D3D12_OPTIONS19,
(&raw mut options).cast(),
size_of_val(&options) as u32,
)
}
.is_ok()
&& options.AnisoFilterWithPointMipSupported.as_bool();
// The root signature the translated shaders' bindings define.
let mut params: Vec<D3D12_ROOT_PARAMETER1> = Vec::new();
// The ranges table parameters point at, alive until the root
@@ -544,7 +557,7 @@ impl HostPipeline {
}
for (n, s) in t.static_samplers.iter().enumerate() {
samplers.push(D3D12_STATIC_SAMPLER_DESC {
Filter: D3D12_FILTER(s.filter as i32),
Filter: D3D12_FILTER(s.filter_for_host(aniso_point_mip_supported) as i32),
AddressU: D3D12_TEXTURE_ADDRESS_MODE(s.address[0] as i32),
AddressV: D3D12_TEXTURE_ADDRESS_MODE(s.address[1] as i32),
AddressW: D3D12_TEXTURE_ADDRESS_MODE(s.address[2] as i32),