CNA-PLAT-016: On Apple, SamplerState.MipMapLevelOfDetailBias does not reach the GPU on FNA3D's non-OpenGL drivers

CNA snapshot 3b43bd86  ·  Known Issues › Platform limitations  ·  source links pinned to 3b43bd86

✓

Evidence basis: source-verified at the pinned commit; recorded by CNA's own run (not repeated here); tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 3b43bd86; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

FNA3D on macOS and iOS hands a sampler LOD bias to SDL's Metal-backed GPU driver, which ignores it, so the bias is accepted without effect; RendererFeature::SamplerLevelOfDetailBias reports that.

Identifier
CNA-PLAT-016
Category
Platform limitation
Subsystem
Graphics & renderers
Status
Open
Verified against
CNA 3b43bd86 (3b43bd8687ed46523d873f9bec4b32bd8481dcb5)
Evidence basis
Recorded by CNA: CNA's own recorded run, not repeated here
Tests touching this area
Yes: see Current tests
Affected contract
SamplerState.MipMapLevelOfDetailBias on the FNA3D renderer on macOS and iOS; GraphicsDevice::SupportsRendererFeatureEXT(RendererFeature::SamplerLevelOfDetailBias)

Expected behaviour

XNA 4.0 applies SamplerState.MipMapLevelOfDetailBias on every device: a bias of +1 selects the next smaller mip level, and a game that sharpens or blurs textures with it gets the same mip selection everywhere.

Actual behaviour at TARGET

FNA3D selects its SDL_GPU driver on Apple, which runs on SDL's Metal driver; that driver ignores mip_lod_bias, and FNA3D's MojoShader shaders have no other route for it, so the bias is accepted and has no effect. Fna3dRenderer::SamplerLodBiasReachesTheGpuEXT() (Fna3dRenderer.cpp, AM4-191) reports false on Apple for every driver but OpenGL; nothing is thrown.

Since c6dec91fb (CNA-DEMOS-ISSUE-006) the answer is public: RendererFeature::SamplerLevelOfDetailBias, answered by Fna3dRenderer::AppliesSamplerLevelOfDetailBiasEXT() from the same probe, is false there, and CrossRendererContractTest.SamplerLevelOfDetailBiasSupportMatchesWhatSpriteBatchSamples requires each compiled-in renderer's answer to match the pixels. CNA closed ISSUE-006 on a complete checkpoint (6c8b042c4, 2026-10-24). CNA's own SDL_GPU renderer is not affected for SpriteBatch, the stock effects and compiled XNA effects, which carry the bias in their shaders (SDLGPU-121/122).

Source locations

Evidence

Read at 3b43bd86: FNA3D's SamplerLodBiasReachesTheGpuEXT, the shared mip contract test and CNA's records; nothing was executed here. AM4-191 records that FNA3D's SDL_GPU driver on Metal ignores the bias. Related and outside Apple: MipMapLevelOfDetailBias has no OpenGL ES equivalent, so EasyGL's OPENGLES3 and WEBGL2 identities accept it without effect, as fx-compiled-effects.md documents.

Re-verified at c6dec91f: the FNA3D probe is unchanged; c6dec91fb added AppliesSamplerLevelOfDetailBiasEXT() to IGraphicsRenderer (false by default; FNA3D answers from the probe, EasyGL true only for a desktop core profile) and the cross-renderer pixel test. Not executed; no Apple run after the renderer retirement of 2026-10-13 is recorded.

Re-verified at 3b43bd86: SamplerLodBiasReachesTheGpuEXT is unchanged (Fna3dRenderer.cpp changed only in a readback comment) and CNA_DEMOS_REPAIR_MATRIX.json lists ISSUE-006 as FIXED_VALIDATED; the closure reports the limitation of SDL's Metal driver, it does not remove it. Not executed; no Apple run is recorded.

Focused reproduction

No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.

Current tests

CrossRendererContractTests.cpp (SamplerLevelOfDetailBiasSupportMatchesWhatSpriteBatchSamples) draws a mip-coloured texture with a +1.25 bias and holds the reported feature to the pixels; the FNA3D compiled-effect sampler contract passes SamplerLodBiasReachesTheGpuEXT() as its supportsLodBias option, so on Apple it skips the bias section. Neither has a recorded run on Apple hardware after 2026-10-13.

Regression test

The existing contract tests are the regression tests; if FNA3D gains a shader route for the bias, its Apple exception in the sampler contract and in SamplerLodBiasReachesTheGpuEXT goes.

Blast radius

Games that set a non-zero MipMapLevelOfDetailBias and run FNA3D on Apple through a non-OpenGL driver: textures are sampled as if the bias were 0. A bias of 0, every other sampler state, FNA3D's OpenGL driver and CNA's own SDL_GPU renderer are unaffected.

Workaround

Check RendererFeature::SamplerLevelOfDetailBias and keep the bias at 0 where it is unsupported, or bias the mip level in the shader of a compiled effect.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.