Don't ask D3D12 for anisotropic filtering with point mipmapping - #36
Merged
Merged
Conversation
Windows 10 users crashed at FT::Font::size() with a null this. The font was the last thing to go wrong, not the first: the whole GPU device was already dead. SDLWaterRenderer reuses one SDL_GPUSamplerCreateInfo for both its samplers. The second switches mipmap_mode to NEAREST for a render target with no mip chain, but enable_anisotropy is still set from the first. Vulkan and Metal carry the filters and anisotropy as independent fields and take that happily. D3D12 packs them into one enum, and SDLToD3D12_Filter builds it arithmetically: MIN_MAG_LINEAR_MIP_POINT (0x14) | ANISOTROPIC (0x40) = 0x54, which is not a D3D12_FILTER. Only 0x55 and its comparison form are. CreateSampler returns void, so the runtime cannot refuse it by return code. It removes the device instead, and every texture and pipeline after that fails with DXGI_ERROR_INVALID_CALL: the water and minimap pipelines, then the glyph atlas, whose failure surfaced two subsystems away as a null FT::Font that nothing checks. Windows 11 hid all of it -- its newer D3D12Core.dll sanitises the bit pattern, most likely to the D3D12_FILTER_ANISOTROPIC this now asks for outright. Dropping the line is behaviour-preserving: with one mip level there is nothing for POINT and LINEAR to differ over, and max_lod already pins sampling to it. Swept the other nine sampler sites; anisotropy is either off or already paired with linear mipmapping. The rule is written up in Build-PORTING.md beside the vertex-semantic trap, which is the same shape of problem. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.