CNA-PLAT-001: SDL_RENDERER throws for any Texture2D mip level above 0, so mipmapped textures (including XNB textures with mip chains) cannot be uploaded there
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit c1c316b9; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
SDL_RENDERER's texture renderer throws std::runtime_error from UpdatePixelsLevel for level > 0 because SDL_Renderer textures have no mip chain; the XNB Texture2D reader uploads every level it reads.
- Identifier
CNA-PLAT-001- Category
- Platform limitation
- Subsystem
- Graphics & renderers
- Status
- Open
- Verified against
- CNA
c1c316b9(c1c316b9c7a846ce8002809c151fcd1af14942c9) - Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Texture2D::SetData(level > 0, ...) and ContentManager::Load<Texture2D> of mipmapped assets on SDL_RENDERER
Expected behaviour
On renderers without mip sampling a mip chain can only be ignored; XNA content commonly ships textures with generated mip levels.
Actual behaviour at TARGET
SdlTextureRenderer::UpdatePixelsLevel (SdlRenderer.cpp) throws std::runtime_error for level != 0 (“does not support mip-level texture uploads ... Use Texture2D::SetData(level=0, ...) only”), by design: SDL_Renderer textures have no mip chain. The XNB reader (Texture2DContentTypeReader.cpp) creates the texture with mipMap = levelCount > 1 and calls SetData(level, ...) for every level; Texture2D::SetData forwards level > 0 to the renderer, so a mipmapped XNB texture fails to load on SDL_RENDERER with a std::runtime_error rather than a NotSupportedException.
Source locations
modules/renderers/sdl-renderer/src/SdlRenderer.cpp— SdlTextureRenderer::UpdatePixelsLevelmodules/content/src/Xnb/Texture2DContentTypeReader.cpp— per-level SetData loop
Evidence
Checked by reading the named sources at c1c316b9; nothing was built or executed for this entry. The XNB consequence is traced through Texture2DReader, Texture2D::SetData and the renderer's level upload; no mipmapped asset was loaded. SDL_Renderer_Texture2D_MipLevelThrows (sdlrenderer_texture2d_miplevel_throws_test.cpp) pins the throw.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
SDL_Renderer_Texture2D_MipLevelThrows pins the throw; no SDL_RENDERER test loads a mipmapped XNB texture.
Regression test
A test that loads a mipmapped XNB texture on SDL_RENDERER and expects either success (levels ignored) or a documented NotSupportedException.
Blast radius
Games whose content was built with mipmaps and that target SDL_RENDERER.
Workaround
Rebuild textures without mipmaps for this target.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Known issues
- Platform limitation index