Graphics Renderers
How renderers work
CNA separates the game-facing rendering API from the underlying graphics implementation with a pure virtual interface, IGraphicsRenderer. Game code never calls a graphics API directly, and never names a renderer.
The compact default is a single-renderer build. Choose its renderer at configure time with either form below; do not mix the forms:
# Long form: name the renderer
cmake -S . -B build -DCNA_GRAPHICS_RENDERER=SDL_GPU
# Option form: exactly one CNA_RENDERER_<NAME> may be ON
cmake -S . -B build -DCNA_RENDERER_SDL_GPU=ON
CNA exposes 10 public renderer identities, implemented by 8 families. The three GL identities below (OPENGLES3, OPENGL33, WEBGL2) share one family, EasyGL; none of the public identities is an alias. The defaults are WEBGL2 under Emscripten, SDL_GPU on Windows, macOS and iOS, and OPENGLES3 everywhere else (Linux, Android and the BSDs) (RendererIdentityDefault.cmake).
Every identity has a stable, sparse C ABI value (OPENGLES3 is 3, FNA3D is 43) that is never renumbered; the values in between that no current identity uses are permanently reserved, and the next new identity would take 52. The CMake list, the C++ enum, the CMake registry map, the C header and the C API table are held together by scripts/check_renderer_identities.py, which CTest runs as RendererIdentityRegistry. C++ enum ordinals, by contrast, are dense (GraphicsRendererType::OpenGLES3 is 0 and Fna3d is 9) and are not a stable contract: never convert between an ordinal and a C ABI value.
A name outside the 10 given to CNA_GRAPHICS_RENDERER or as a member of CNA_GRAPHICS_RENDERERS — a misspelling, a lower-case spelling, or an identity that an older document or build script mentions but this snapshot does not provide — stops the configure step with a FATAL_ERROR. A retired name is refused by name, with its reserved C ABI value, on every route: the CMake options, the CNA_GRAPHICS_RENDERER environment variable, GraphicsRendererSelection::SetPreferred and the C API’s by-name route. The check runs first, before SDL or any dependency is configured. There are no aliases, and CMake matches the public names case-sensitively (sdl_gpu is an unknown name; SDL_GPU is not). One route is not covered: a CNA_RENDERER_<X>=ON switch whose name is neither a public nor a retired identity (-DCNA_RENDERER_D3D9=ON, -DCNA_RENDERER_EASYGL=ON, a typo) is a cache entry nothing reads, so the configure does not fail and builds the platform default renderer (at most CMake's generic warning about a manually specified variable that was not used). In old scripts name the renderer with CNA_GRAPHICS_RENDERER, and read the CNA: Using <X> graphics renderer line of the configure log.
Which CNA does this page describe? CNA snapshot 3b43bd86 (27 October 2026) on branch next, 948 commits after the v0.1.0 release tag; its version string is still 0.1.0. A plain git clone https://github.com/libcna/cna.git gives the 0.1.0 release, whose renderer set was larger; use git clone -b next and check out 3b43bd86 for what is documented here, with sharp-runtime on its next branch and easy-gl and meta-gl at v0.1.1 and v0.4.1 (see Releases & Versioning).
The Windows, macOS and iOS default is SDL_GPU, and it is not qualified there yet. SDL_GPU is CNA’s modern native path: CNA maps XNA 4.0 onto SDL’s GPU API, and SDL picks its Vulkan, Direct3D 12 or Metal GPU driver underneath. At this snapshot it is validated on Linux (Vulkan) and, cross-compiled, under Wine with vkd3d-proton (Direct3D 12). No native Windows run, no re-run on Apple hardware and no iOS build of it exists yet; CI has macOS and iOS legs for it, the macOS one gating (CNA’s handoff.md §5.2). On Windows, DIRECTX9 is the alternative; on macOS and iOS, SOFTWARE is the evidenced fallback.
10 identities are not 10 equally complete renderers. They differ in scope, dependencies, platform gates and verification. Treat an identity as a named implementation contract, not as a promise of feature parity with every other row — the capability matrix and the declared maturity table show the differences.
Multi-renderer builds and runtime selection
This snapshot supports an opt-in build mode that links several compatible renderer families into one binary. CNA_GRAPHICS_RENDERERS is a semicolon-separated set; CNA_GRAPHICS_RENDERER remains the default and must be a member of that set (otherwise the configure step fails; nothing is silently substituted). Omitting the plural option keeps the ordinary single-renderer build. Duplicates are removed, the default is moved first, and the configure log prints CNA: renderer set -- <list> (default: <X>).
cmake -S . -B build-multi -G Ninja \
-DCNA_GRAPHICS_RENDERER=HEADLESS \
-DCNA_GRAPHICS_RENDERERS="HEADLESS;SOFTWARE;STUB"
Before the first GraphicsDevice is created, CNA::GraphicsRendererSelection resolves the renderer in this order: an explicit SetPreferred() call, the CNA_GRAPHICS_RENDERER environment variable, then the compile-time default. In an Emscripten build the page property Module.cnaPreferredRenderer is consulted at the environment variable's precedence (a real environment variable wins over it), and the exported Module._cna_set_preferred_renderer(name) behaves like an explicit SetPreferred(). A name that is unknown, retired or not compiled in throws; CNA never substitutes silently.
#include <array>
#include "CNA/GraphicsRendererSelection.hpp"
using CNA::GraphicsRendererSelection;
using CNA::GraphicsRendererType;
GraphicsRendererSelection::SetPreferred(GraphicsRendererType::SdlGpu); // or SetPreferred("SDL_GPU")
constexpr std::array chain{GraphicsRendererType::OpenGLES3,
GraphicsRendererType::Software};
GraphicsRendererSelection::SetFallbackChain(chain); // opt-in
MyGame game;
game.Run();
On a native build the environment route is CNA_GRAPHICS_RENDERER=SDL_GPU ./mygame; in a page it is var Module = { cnaPreferredRenderer: "WEBGPU" };. Names are case-insensitive at run time (unlike CMake).
Fallback is off by default. SetFallbackChain() (which takes a std::span, so pass an array rather than a bare brace list) or EnableAutomaticFallback(true) opts in; every skipped renderer is recorded in GetFallbackHistory() with a reason (NotCompiledIn, ProbeUnavailable, InitializationFailed, WindowKindConflict). Automatic fallback tries the renderers that show a picture first and HEADLESS only after them. GetSelected() is the renderer CNA will try, GetActive() is what actually started, and GraphicsDevice::GetGraphicsRendererType() reports the device's real renderer. The compile-time getCurrentGraphicsRendererType() still reports only the build default.
Selection latches at the first successful device. The latch closes when the first GraphicsDevice has successfully created a renderer. After that, SetPreferred, SetFallbackChain and EnableAutomaticFallback throw InvalidOperationException. A failed creation does not latch, so a game may catch the error and try another configuration; GetSelected() never latches; recreating the same renderer on a live device (Reset, an MSAA change) and creating a second GraphicsDevice keep the selection. Fallback between renderers that need different kinds of window can recreate a CNA-owned window, but a caller-owned DeviceWindowHandle cannot be recreated; that candidate is skipped as WindowKindConflict.
Two device flags ask for a specific renderer: GraphicsAdapter::UseNullDevice requires HEADLESS and UseReferenceDevice requires SOFTWARE (C++ accessors setUseNullDeviceProperty and setUseReferenceDeviceProperty). If that renderer is not compiled in, or the selection already latched to another one, device creation fails with NoSuitableGraphicsDeviceException; a fallback chain cannot satisfy them with a different renderer. For testing, the environment lists CNA_DEBUG_UNAVAILABLE_RENDERERS and CNA_DEBUG_FAIL_RENDERER_INIT simulate an unavailable or failing renderer, and CNA_FORCE_HEADLESS_DEVICE_EXT creates the named renderers' device without a window. The full API, fallback ordering and C ABI surface are on Runtime Renderer Selection.
Combination rules
Multi-renderer builds add code size and every selected family's dependencies. This snapshot rejects demonstrated conflicts at configure time, each with a reason in the error. Windows-only and Emscripten-only identities cannot cross platform partitions: one toolchain cannot target both.
| Platform partition | Identities | Enforced by |
|---|---|---|
| Windows only (1) | DIRECTX9 | FATAL_ERROR unless CMAKE_SYSTEM_NAME is Windows (native MSVC/MinGW or the mingw-w64 cross toolchain) |
| Emscripten only (1) | WEBGL2 | Refused on any other target; OPENGLES3 and OPENGL33 are refused under Emscripten |
| Everything else (8) | All other identities | No operating-system partition; each family's own dependencies still apply (and iOS admits only its allow-list, see below) |
Several EasyGL identities may coexist in one binary — the GL profile is a runtime value — provided they do not cross the native/Emscripten partition. In a multi-renderer build only the default renderer's CNA_RENDERER_<IDENTITY> macro is defined project-wide; CNA_MULTI_RENDERER is defined when more than one is compiled in. The rules are checked by scripts/check_renderer_combinations.py.
Names that changed (and one trap)
The renderer vocabulary was normalised. If you are following an older document, translate first — the old spellings are not aliases, they are unknown values that stop the configure step with a FATAL_ERROR when given to CNA_GRAPHICS_RENDERER or CNA_GRAPHICS_RENDERERS (an old-style -DCNA_RENDERER_D3D9=ON switch is simply not read; see above). The old option name behaves the same way: no build file at this snapshot reads CNA_GRAPHICS_BACKEND, so -DCNA_GRAPHICS_BACKEND=OPENGL33 is accepted without an error and the platform default renderer is configured (read from the CMake files; not executed). In old scripts, rename the option itself.
| Old name | Today |
|---|---|
CNA_GRAPHICS_BACKEND | CNA_GRAPHICS_RENDERER |
IGraphicsBackend | IGraphicsRenderer |
CNA::GraphicsBackendCategory, CNA::GraphicsBackendMaturity (CNA/GraphicsBackend*.hpp, getGraphicsBackend*()) | CNA::GraphicsRendererCategory, CNA::GraphicsRendererMaturity (CNA/GraphicsRendererCategory.hpp, CNA/GraphicsRendererMaturity.hpp, get[Current]GraphicsRendererCategory(), get[Current]GraphicsRendererMaturity()); in C, CNA_GraphicsRenderer* and cna_graphics_renderer_* (C ABI 0.49.0). No alias of the old names is kept |
CNA::Internal::Renderers::ShaderDialectEXT | CNA::ShaderDialectEXT (CNA/ShaderDialectEXT.hpp), returned by GraphicsDevice::GetShaderDialectEXT(); same enumerators and values |
EASYGL | One of OPENGLES3 / OPENGL33 / WEBGL2 |
D3D9 | DIRECTX9 |
ASCII | Not a renderer. It is now AsciiPostProcessEffect, a CNAEXT effect (and CNAEXT is off by default: -DCNA_CNAEXT=ON) |
Case matters in CMake, not at run time. -DCNA_GRAPHICS_RENDERER=sdl_gpu stops the configure with unknown graphics renderer 'sdl_gpu', while GraphicsRendererSelection::SetPreferred("sdl_gpu") and the CNA_GRAPHICS_RENDERER environment variable accept it.
Test labels moved with the names too: ctest -L D3D9 matches nothing. The label is DIRECTX9.
The 10 renderers at a glance
One row per public identity, in C ABI order. Scope comes from the code-declared ThreeD capability; maturity is CNA's own declaration (see Declared maturity), not a measurement. Detail, dependencies and caveats follow in the per-family sections.
| Renderer | C ABI | Family | Scope | Declared maturity | Platform gate |
|---|---|---|---|---|---|
OPENGLES3 | 3 | EasyGL | 2D + 3D | Production | Native hosts (default on Linux, Android and the BSDs) |
OPENGL33 | 4 | EasyGL | 2D + 3D | Production | Native hosts |
WEBGL2 | 6 | EasyGL | 2D + 3D | Supported | Emscripten only (default) |
WEBGPU | 9 | WebGPU | 2D + 3D | Supported | Native (wgpu-native) and browser (emdawnwebgpu) |
HEADLESS | 11 | Headless | No pixels | Supported | Any host |
SOFTWARE | 12 | Software | 2D + 3D | Experimental | Any host (off-screen; displayed on Terminal) |
STUB | 13 | Stub | No pixels | Supported | Any host |
DIRECTX9 | 22 | DirectX9 | 2D + 3D | Production | Windows only |
SDL_GPU | 31 | SdlGpu | 2D + 3D | Supported | SDL3 with a GPU driver (Vulkan, Direct3D 12 or Metal); default on Windows, macOS and iOS |
FNA3D | 43 | Fna3d | 2D + 3D | Experimental | Any host FNA3D + SDL3 support |
The gaps in the C ABI numbering are deliberate: the values that are not listed are permanently reserved and refused by every C route, and the next new identity would take 52. CNA's stated policy is a curated set — a renderer earns a place with meaningful platform coverage, compatibility value, architectural value or a capability the set does not cover, and "renderer count is not a goal"; no new identity is planned (docs/renderer-registry.md).
The GL family — three profiles, one EasyGL implementation
Three renderer identities share one internal implementation, EasyGL, which lives in the ../easy-gl sibling repository (itself needing ../meta-gl). The profile is a runtime value inside the family, so the two native profiles can be linked into one binary; WEBGL2 sits on the other side of the native/Emscripten partition.
| Renderer | What it is | Scope | Platform | Dependency |
|---|---|---|---|---|
OPENGLES3 | OpenGL ES 3.0 context (GLSL ES 3.00) via EasyGL — the default on Linux, Android and the BSDs | 2D + 3D; MSAA, anisotropy and wireframe by runtime probe; MRT, occlusion, Texture3D, multi-stream and instancing yes; shadow sampling and IBL claimed | Native (non-Emscripten) hosts | ../easy-gl + ../meta-gl; a GL context from the SDL3 platform |
OPENGL33 | Desktop OpenGL 3.3 core profile (GLSL 3.30) via EasyGL | 2D + 3D, as OPENGLES3 (native wireframe) | Native hosts | Same as above |
WEBGL2 | Browser WebGL 2 (GLSL ES 3.00) via EasyGL — the Emscripten default | 2D + 3D, as OPENGLES3 | Emscripten only | Same; the link contract pins WebGL 2 |
Hand-written ShaderEffect shaders execute on all three: GLSL ES on OPENGLES3 and WEBGL2, desktop GLSL on OPENGL33. Compiled XNA effects are opt-in with CNA_EASYGL_COMPILED_EFFECTS. Against the 39-scene XNA oracle corpus, EasyGL is gated on two line scenes at tolerance 0 (EasyGL_XnaLineCoverage); a whole-corpus measurement recorded 10 of 39 on 2026-08-11, before later pixel-centre fixes — see How renderers are verified. The adapter promises at most 4× MSAA. Step-by-step use is in Tutorial 102.
"EasyGL" remains the correct name for the implementation and for the sibling library. It is not a value you can pass to CNA_GRAPHICS_RENDERER.
Modern GPU APIs: SDL_GPU and WebGPU
Two renderers drive a modern explicit GPU API, both through a portable layer: SDL_GPU through SDL3’s GPU API, and WEBGPU through WebGPU. CNA has no compute-shader, storage-buffer, indirect-draw or GPU-timer API on any renderer; ordinary graphics (stock effects, ShaderEffect, PBR, image-based lighting, shadows, float render targets, instancing, compiled effects) is what these renderers implement.
| Renderer | What it is | Scope | Platform | Dependency |
|---|---|---|---|---|
SDL_GPU | CNA’s modern native path: XNA 4.0 mapped onto SDL3's GPU API (SPIR-V; SDL selects its Vulkan, Direct3D 12 or Metal GPU driver); declared Supported | 2D + 3D; MSAA, depth and stencil from the formats the device offers, MRT, instancing and base-instance drawing, float targets, shadow sampling, IBL; no occlusion queries; BlendState.MultiSampleMask only all-or-none (a partial mask is refused); custom ShaderEffect only where a target-native libshaderc exists (Linux and Android builds) | SDL3 platform with a GPU driver; default on Windows, macOS and iOS (qualified on Linux and under Wine only) | SDL3; SDL_shadercross + SPIRV-Cross (default ON on Windows and Apple); optional libshaderc |
WEBGPU | WebGPU renderer; declared Supported since 17 October 2026 | 2D + 3D; MRT, occlusion queries, wireframe, multi-stream, instancing, MSAA (4× probe), float render targets (probed), half-float linear filtering | Native through wgpu-native and the browser (Emscripten emdawnwebgpu port); verified on Linux x86_64 and in headless Chrome only | Pinned wgpu-native v29.0.1.1 (auto-downloaded, SHA-256 pinned) or the Emscripten port |
SDL_GPU is covered by Tutorial 131 and WEBGPU by Tutorial 132. To run on Vulkan, Direct3D 12 or Metal, use SDL_GPU (or FNA3D, whose own SDL_GPU driver reaches the same APIs); the native GPU driver is SDL’s choice, reported by SDL, not a CNA identity.
What SDL_GPU does not do yet. CNA records these gaps against the native renderers it replaced (CNA’s CHANGELOG.md and handoff.md §5.2): ShaderEffect is compiled out on Windows, Apple and Emscripten builds because no runtime GLSL → SPIR-V → DXIL/MSL path exists; occlusion queries are unavailable (SDL’s GPU API has none); on a multisampled target BlendState.MultiSampleMask is applied only when it keeps every sample or none (the pinned SDL reserves the field): a mask of none drops the draw and any partial mask throws NotSupportedException, which RendererFeature::MultiSampleMask reports as Restricted. Base-instance drawing is implemented by expanding per-instance streams on the host. Cube faces in a multi-render-target set and SpriteSortMode::Immediate (each sprite drawn with the texture as it is at its Draw call) work on SDL_GPU at this snapshot; CNA’s handoff lists no open renderer defect.
2D games
Every renderer that draws pixels draws both 2D and 3D, so a SpriteBatch-only game runs on any of them and the platform default is a good choice. STUB reports ThreeD false, but it is a no-op renderer, not a 2D renderer.
What a 3D call does where 3D is missing
The behaviour is a setting, Unsupported3DGraphicsCallBehavior, changed with GraphicsDevice::SetUnsupported3DGraphicsCallBehavior (or, from C, cna_graphics_device_set_unsupported_3d_call_behavior). Throw is the default and raises an error naming the renderer and the method; WarnAndStub logs one warning per operation and returns a safe no-op or null object (on STUB and HEADLESS a Texture3D request gets such a null object too). WarnAndStub does not change any SupportsCapability() answer.
Windows renderers: Direct3D 9 and SDL_GPU
One renderer is hard-gated to CMAKE_SYSTEM_NAME=Windows and stops the configure step with a FATAL_ERROR anywhere else: DIRECTX9, real Direct3D 9 — the API real XNA 4.0 itself ran on — through its genuine COM interfaces rather than emulated over another API. The Windows default, SDL_GPU, reaches Direct3D 12 through SDL’s GPU driver.
Windows evidence is Wine evidence. CNA validates DIRECTX9 through MinGW-w64 cross builds run under Wine with DXVK, and SDL_GPU’s Direct3D 12 driver under Wine with vkd3d-proton. A native-Windows MSVC workflow exists (d3d-windows-ci.yml: the DIRECTX9 suite and an SDL_GPU Direct3D 12 smoke leg), but it is manual-dispatch only; CNA’s handoff records the SDL_GPU leg as not run yet and no current real-Windows hardware validation. The reference images of the oracle corpus were captured under Wine + DXVK on Linux, not on Windows. Treat any Wine result as evidence for that exact configuration.
| Renderer | What it is | Scope | Platform | Dependency |
|---|---|---|---|---|
DIRECTX9 | Real Direct3D 9; the only renderer with a full exact-match CTest against the real-XNA-4.0 reference corpus (tolerance 0, run under Wine + DXVK); declared Production | 2D + 3D; inherits the permissive capability default wholesale (MSAA, instancing, Texture3D, custom effects true; multi-stream false; MRT bounded by profile: Reach 1, HiDef 4); classifies Texture2D, cube and volume formats natively; Color-only render targets; stock effects lit by punctual sources, PBR and shadow sampling in its HLSL shaders | Windows only (native or mingw-w64 cross-build) | d3d9, d3dcompiler (Windows SDK) |
SDL_GPU | See Modern GPU APIs; on Windows SDL picks its Direct3D 12 driver | As above; ShaderEffect compiled out on Windows | The Windows default | SDL3; SDL_shadercross (default ON on Windows) |
Only DIRECTX9 has no SupportsCapability() override. It relies on the permissive base defaults wholesale, so its true answers are the least informative. Custom ShaderEffect shaders on it are HLSL, compiled at run time with D3DCompile (vs_3_0/ps_3_0 under HiDef, vs_2_0/ps_2_0 under Reach). Compiled XNA effects are opt-in with CNA_DIRECTX9_COMPILED_EFFECTS; under Wine with DXVK 2.6.0 their test hangs or aborts in DXVK’s device teardown, while DXVK 3.1.1 passes (CNA’s measurement, handoff.md §5.3). DIRECTX9 is the only renderer recorded as pixel-exact against the XNA oracle corpus — see How renderers are verified. A guided tour is Tutorial 103.
Browser renderers
Two renderers draw in a browser. WEBGL2, from the GL family, exists only there and is the Emscripten default. WEBGPU also has a browser route (the browser’s own WebGPU through the emdawnwebgpu port) but is not Emscripten-only, because it also builds natively through wgpu-native. A page uses WebGPU where the browser offers it and WebGL 2 elsewhere; both can be linked into one bundle.
The Emscripten multi-renderer workflow builds one bundle containing WEBGL2 and WEBGPU and asserts that both renderer archives, both registry entries and the JavaScript selection surface are present — it builds and inspects symbols; it does not run them. Under Emscripten a WEBGPU build needs a larger Asyncify stack, which the build sizes automatically. The strongest browser evidence is outside CI: the 90 sample builds at samples.libcna.com run on WEBGL2 and were each run in Chrome when they were published (against earlier CNA revisions).
To pick a renderer from the page, set the property before the module starts: var Module = { cnaPreferredRenderer: "WEBGPU" }; (or call Module._cna_set_preferred_renderer); the bundle must have been built with that renderer in CNA_GRAPHICS_RENDERERS. Tutorial 105 and Tutorial 132 walk through both routes.
Web caveats apply to both renderers in this group (to WEBGPU when it is built for the browser). There is no video: FFmpeg is never built for Emscripten, so the Video types exist and link but throw NotSupportedException at run time. Online sessions and invitations are refused in a browser build. Your Game object does not have to be heap-allocated: Game::Run() blocks through Asyncify, so MyGame game; game.Run(); is fine, and the browser loop honours a variable time step. Save persistence and threading are described on Platforms.
Translation and adapter layers
Three renderers do not name one native graphics API. Each targets a portable layer that itself picks a native API — sometimes at build time, sometimes at run time. CNA classifies WEBGPU, SDL_GPU and FNA3D as its TranslationLayer category. That indirection is the point, and it is also where the surprises live.
| Renderer | What it is | Scope | Platform | Dependency |
|---|---|---|---|---|
SDL_GPU | SDL3's GPU API; SDL picks the native GPU driver and CNA feeds it SPIR-V | 2D + 3D | Any host SDL3's GPU API supports | SDL3; SDL_shadercross + SPIRV-Cross; optional libshaderc |
WEBGPU | WebGPU: wgpu-native natively, the browser's own WebGPU through emdawnwebgpu on the web | 2D + 3D | Native desktop hosts and Emscripten | Pinned wgpu-native v29.0.1.1 or the Emscripten port |
FNA3D | FNA’s XNA-shaped C graphics library, built from CNA’s fork; FNA3D chooses its SDL_GPU, Direct3D 11 or OpenGL driver internally at run time (override with FNA3D_FORCE_DRIVER); declared Experimental | 2D + 3D; compiled effects always on; instancing and MSAA follow FNA3D; PBR (metallic-roughness, image-based lighting, double-sided faces, texture-coordinate sets) and stock-effect punctual lights and shadow sampling through its own shaders; no float render targets | Any host FNA3D + SDL3 support | FNA3D and MojoShader fetched from CNA’s forks (libcna/FNA3D 10f650b9); SDL3 |
Group-specific caveats, all of which change what your code does rather than merely how fast it runs:
SDL_GPUis an SDL3 API, so it requires the SDL3 platform. A configure withCNA_ENABLE_SDL=OFFrefuses it by name, and a platform without SDL video refuses it as the platform rather than failing later. On Windows and Apple SDL_shadercross is on by default (CNA_SDL_GPU_SHADERCROSS); Linux and Android use the committed SPIR-V natively.WEBGPU’s native route downloads a pinnedwgpu-nativerelease unless you giveCNA_WEBGPU_ROOT; its browser route needs no native library. Its Windows, macOS and linux-aarch64 packages are unverified.FNA3Denables XNA/FNA compiled Effect Framework bytecode automatically. It executes those binaries through MojoShader and cannot compileShaderEffectsource at all. ItsFna3d_XNA_Oracletest renders the whole corpus but gates only that every scene renders, not that it matches. FNA3D’s own driver decides some answers (CNA records, for example, that it ignoresSkinnedEffect.VertexColorEnabled). See Tutorial 108.
CPU and no-GPU renderers
Three renderers need no GPU, no driver and no display server. One produces real pixels on the CPU; two produce none at all.
| Renderer | What it is | Scope | Platform | Dependency |
|---|---|---|---|---|
SOFTWARE | CNA's own CPU rasterizer that owns its framebuffer; no window, no GPU library; declared Experimental | 2D + 3D; MSAA, MRT (up to 4), occlusion, instancing, wireframe, Texture3D storage, anisotropy, float and half-float targets, PBR with image-based lighting and shadow reception, BasicEffect punctual lights; no custom ShaderEffect execution (fixed stock path); compiled effects opt-in | Any host; off-screen (readback) except on CNA_PLATFORM=TERMINAL, where it is displayed; the evidenced renderer on macOS and in the iOS Simulator | None (compiled effects: MojoShader via CNA_SOFTWARE_COMPILED_EFFECTS) |
HEADLESS | A no-GPU, no-window harness that validates arguments and counts or traces calls (CNA_HEADLESS_MODE = Fast, Validation (default) or Trace); renders nothing | No pixel output; reports 3D, depth/stencil and instancing true (nothing is rasterized); MSAA, Texture3D, additive and multi-stream false; applies 0 samples everywhere | Any host; selected by UseNullDevice | None |
STUB | The smallest possible complete renderer: renders nothing, keeps no bookkeeping | No pixel output; all 17 capabilities false | Any host; the default of the dev, unit and release-modules presets | None |
SOFTWARE never presents to a window. It rasterizes for real and stays off-screen in an SDL3 window (on Windows, X11 or Wayland alike): you read the result back with GetBackBufferData() rather than watching it appear in a window. That makes it useful for deterministic, GPU-free pixel checks. The deliberate exceptions are platforms that report surface presentation without a native window handle: SOFTWARE on CNA_PLATFORM=TERMINAL attached to a TTY hands each finished frame to the terminal platform's surface presenter, and on iOS it is presented through the platform's surface presenter. Terminal accepts only SOFTWARE, HEADLESS and STUB, and of those only SOFTWARE actually displays.
SOFTWARE reports CustomEffects false: its fixed CPU shading path produces the pixels, and your shader source will not run. HEADLESS validates and records the call without executing it, which is exactly what a harness should do. UseNullDevice maps to HEADLESS and UseReferenceDevice to SOFTWARE. See Tutorial 107.
What each renderer needs from the platform
The renderer and the platform implementation (CNA_PLATFORM: SDL3 by default, HEADLESS, TERMINAL) are independent build axes, but the platform decides which renderers can find a window or a GL context. SDL3 is CNA’s one windowing implementation: Windows, X11, Wayland, macOS, iOS, Android and the browser are reached through SDL’s own video drivers, and a renderer that needs a native handle (an HWND, an X11 Display* and window, a Wayland wl_display* and wl_surface*, a Cocoa or UIKit view) receives it from the SDL3 window through NativeWindowHandle.
- Two renderers are SDL3 APIs or depend on SDL directly:
SDL_GPUandFNA3D. The other families are SDL-free at source level and take their window and GL context from the platform. - A GL context is provided by the SDL3 platform (not Terminal, not Headless).
- An SDL-free build has no window.
CNA_ENABLE_SDL=OFFrefusesCNA_PLATFORM=SDL3, SDL3 audio and the two SDL renderers by name; what remains is a windowless configuration (HEADLESSorTERMINALwithHEADLESS,SOFTWAREorSTUB, and Null or ALSA audio) for servers, test runners and terminal games. - Terminal accepts only the CPU/no-pixel renderers and is POSIX-only. iOS admits
SOFTWAREandSDL_GPU(the latter never yet built for iOS); anything else is aFATAL_ERRORunless the unsupported override-DCNA_APPLE_ALLOW_UNVALIDATED_RENDERER=ONis given.
The platform matrix, the CNA_AUDIO_PLATFORM axis and the per-OS status are on Platforms.
Sibling repositories and fetched dependencies
Sibling repositories are not submodules; the configure step checks that they sit next to the CNA checkout and that each declares the version CNA requires (-DCNA_CHECK_DEPENDENCY_VERSIONS=OFF turns a mismatch into a warning). Third-party sources that CNA fetches are pinned.
| Dependency | Needed by | How it arrives |
|---|---|---|
../sharp-runtime (version 0.1.x; its next branch for this snapshot) | Every build | Sibling checkout |
../easy-gl (0.1.1) + ../meta-gl (0.4.1) | The three GL identities | Sibling checkouts |
FNA3D + MojoShader from CNA’s forks libcna/FNA3D (10f650b9) and libcna/mojoshader (03b686fe) | FNA3D; every CNA_*_COMPILED_EFFECTS option | Fetched by CMake at the pinned commit (CNA’s fixes are commits on the forks; a drifted checkout is refused) |
wgpu-native v29.0.1.1 (SHA-256 pinned) | WEBGPU (native route) | Auto-downloaded unless CNA_WEBGPU_ROOT is given |
SDL_shadercross 1ff05be + SPIRV-Cross vulkan-sdk-1.4.350.0 | SDL_GPU (default ON on Windows and Apple) | Fetched by CMake |
d3d9/d3dcompiler | DIRECTX9 | Windows SDK / MinGW import libraries |
Shaders: what actually executes where
Two separate things get called "shaders" in an XNA-shaped framework, and CNA treats them very differently.
Compiled Effect Framework bytecode is the XNA-compatible path described below. It accepts XNA/FNA Direct3D 9 Effect binaries on qualified renderer builds; it is not a compiler for HLSL .fx source and does not accept DXBC or MGFX.
Renderer-native custom shaders use ShaderEffect, and three separate questions apply: does the renderer accept a ShaderEffect (the CustomEffects capability), does the supplied source text determine the pixels (the detailed ShaderEffectSourceExecution feature), and which payload does it consume (its declared shader dialect, CNA::ShaderDialectEXT).
| Renderer(s) | Accepts ShaderEffect | Payload consumed | Source execution declared |
|---|---|---|---|
OPENGLES3, WEBGL2 | Yes | GLSL ES source | Yes |
OPENGL33 | Yes | Desktop GLSL source | Yes |
DIRECTX9 | Yes (inherited default) | HLSL source, compiled with D3DCompile | Not declared |
WEBGPU | Yes | WGSL source | Yes |
SDL_GPU | Only where libshaderc exists (Linux and Android builds; compiled out on Windows, Apple and Emscripten) | Compiled SPIR-V bytecode | Yes while a device exists |
HEADLESS | Reports yes; nothing is rasterized | — | No |
SOFTWARE, FNA3D, STUB | No (CustomEffects false) | — | — |
The last column comes from the renderers' own ExecutesShaderEffectSourceEXT() overrides; the profile states an accepted-but-not-executed ShaderEffect in its report text ("the supplied source text does not determine rendered pixels on this renderer"). FNA3D cannot compile custom shaders at all; its only shader entry point is XNA's own compiled stock-effect bytecode, run through MojoShader. See Shader Effects for the API itself.
Compiled XNA effects
GraphicsCapability::CompiledEffects is independent of CustomEffects. It means the renderer can execute XNA/FNA Direct3D 9 Effect Framework bytecode (.fxb), which needs MojoShader (or CNA's translation of it) from the pinned FNA3D checkout. FNA3D supports it always; five other families support it only when their build option is on, and every option defaults to OFF. A default configure therefore reports CompiledEffects false on 9 of the 10 identities. MojoShader is linked only into builds that opt in. See Effects System.
| Family (identities) | Gate |
|---|---|
FNA3D (FNA3D) | Always on |
EasyGL (OPENGLES3/OPENGL33/WEBGL2) | -DCNA_EASYGL_COMPILED_EFFECTS=ON |
WebGPU (WEBGPU) | -DCNA_WEBGPU_COMPILED_EFFECTS=ON; the browser build translates SPIR-V to WGSL |
SDL_GPU (SDL_GPU) | -DCNA_SDL_GPU_COMPILED_EFFECTS=ON; MojoShader emits SPIR-V |
Software (SOFTWARE) | -DCNA_SOFTWARE_COMPILED_EFFECTS=ON |
Direct3D 9 (DIRECTX9) | -DCNA_DIRECTX9_COMPILED_EFFECTS=ON |
There is no compiled-effect implementation on HEADLESS or STUB. Each opt-in family has its own compiled-effect test file; FNA-executed reflection, state and pixel fixtures (tests/fixtures/compiled-effects/) are replayed by several of them with a ±3 channel tolerance on 8×8 flat-input pixels — compiled effects only, not sprites or 3D scenes.
Capability reporting
Do not branch game logic on a bare positive SupportsCapability() answer and expect execution proof. The base implementation of IGraphicsRenderer::SupportsCapability still returns true for every member except MultiStreamVertexInput (false), StencilBuffer (delegated to the renderer), CompiledEffects (routed through its false-by-default opt-in) and FloatRenderTargets and HalfFloatRenderTargets (false). Only DIRECTX9 has no override at all; SDL_GPU uses a switch with no default arm, STUB answers false to everything, and WEBGPU, HEADLESS, SOFTWARE, EasyGL and FNA3D use partial default: true arms.
GraphicsCapability has 17 members: the 14 that existed in alpha.1 (ThreeD, DepthStencilBuffer, MultiSampleAntiAliasing, MultipleRenderTargets, AnisotropicFiltering, WireFrame, OcclusionQuery, CustomEffects, Texture3D, MultiStreamVertexInput, Instancing, StencilBuffer, AdditiveBlending, CompiledEffects) and three added since: FloatRenderTargets, HalfFloatRenderTargets and HalfFloatTextureLinearFiltering. At the device level, GraphicsDevice::SupportsCapability answers six members from separate questions rather than the renderer's own switch: CompiledEffects from the renderer’s opt-in, FloatRenderTargets and HalfFloatRenderTargets from whether Vector4 and HdrBlendable are accepted as render-target formats, half-float filtering from a false-by-default virtual, and MultipleRenderTargets and Texture3D ANDed with the graphics profile’s limits. The device-level answer is the public one: a caller who holds the renderer interface directly can see different values.
The practical consequence is unchanged: a capability query is a hint, not a contract. The reliable checks are the ones this page states directly — which renderers execute custom shaders, and which report a feature in the matrix below — plus the detailed profile that follows. Tutorial 101 shows how to query and interpret them.
One gap no capability member reports: a cube face inside a multiple-render-target set. DIRECTX9 refuses it at SetRenderTargets with System::NotSupportedException, and WEBGPU refuses it with its own message (a face "cannot be bound in a multiple-render-target set"); HEADLESS accepts it (it rasterizes nothing), and the GL family, SOFTWARE, SDL_GPU and FNA3D implement it (SDL_GPU binds a face in any slot of the set). A single cube face bound on its own is a different, ordinary path. Check Render Targets before relying on it.
Capability matrix
Derived from each renderer's own capability code at this snapshot: T true, F false, c conditional (a device, driver or build-option probe decides). The first table is the 13 original members as the renderer answers them; the second the four members the device derives. Unless noted, a c means the answer comes from a run-time probe of the driver or device.
| Renderer | 3D | DS | AA | RT | An | Wf | Oq | Cx | T3 | MS | In | St | Ad |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OPENGLES3 | T | T | c | T | c | c | T | T | T | T | T | T | T |
OPENGL33 | T | T | c | T | c | T | T | T | T | T | T | T | T |
WEBGL2 | T | T | c | T | c | c | T | T | T | T | T | T | T |
WEBGPU | T | T | c | T | T | T | T | T | T | T | T | T | T |
HEADLESS | T | T | F | T | T | T | T | T | F | F | T | T | F |
SOFTWARE | T | T | T | T | T | T | T | F | T | T | T | T | T |
STUB | F | F | F | F | F | F | F | F | F | F | F | F | F |
DIRECTX9 | T | T | T | T* | T | T | T | T | T | F | T | T | T |
SDL_GPU | T | c | c | T | T | T | F | c | T | T | T | c | T |
FNA3D | T | T | c | T | T | T | c | F | T | T | c | c | T |
| Renderer | CE | F32 | F16 | HF |
|---|---|---|---|---|
OPENGLES3, OPENGL33, WEBGL2 | c | c | c | c |
WEBGPU | c | c | c | T |
HEADLESS | F | F | F | F |
SOFTWARE | c | c | c | c |
STUB | F | F | F | F |
DIRECTX9 | c | F | F | c |
SDL_GPU | c | c | c | c |
FNA3D | T | F | F | F |
Reading the conditions. T*: DIRECTX9 carries its own profile table for MRT (Reach 1, HiDef 4), but the gating is not specific to it. At the device level GraphicsDevice::SupportsCapability(MultipleRenderTargets) is the renderer's answer ANDed with that same profile ceiling for every identity, Texture3D is ANDed with the profile’s volume limit (Reach has none), and float render targets are refused outright under Reach. CNA defaults to Reach, so the RT, T3, F32 and F16 columns describe each renderer under HiDef: on the default profile GraphicsDevice::SupportsCapability reports them false on every renderer. The Oq column is likewise the renderer's own answer: under Reach the OcclusionQuery constructor throws NotSupportedException whatever the column says. EasyGL: AA is GL_MAX_SAMPLES>1; An needs GL_EXT_texture_filter_anisotropic; Wf is native glPolygonMode, GL_NV_polygon_mode on ES, or a WebGL extension. WEBGPU: AA from a 4× MSAA probe. SDL_GPU: DS/St from the formats created, Cx only with libshaderc. FNA3D: Cx is false because FNA3D accepts only compiled D3D9 Effect binaries; Oq is whatever FNA3D’s driver reports (its SDL_GPU driver has no occlusion queries). F32 and F16 are true only where the renderer classifies Vector4 / HdrBlendable as render-target formats (EasyGL, SDL_GPU, SOFTWARE and WEBGPU classify render-target formats; the others accept only Color render targets). CE c means "true only in a build with that renderer's compiled-effects option".
RendererCapabilityProfile: the detailed answer
The 17-member GraphicsCapability enum is a summary. The finer API is CNA::RendererCapabilityProfile: 33 RendererFeature ids (the legacy summaries split further, plus ShaderEffectSourceExecution, Texture3DSampling, ShadowSampling, ImageBasedLighting, six shader-dialect flags, BaseInstanceDrawing, SamplerLevelOfDetailBias, PbrEffectShading, SkinnedPbrEffectShading, MultiSampleMask and RenderTargetReadback), a four-state answer (Unknown, Unsupported, Supported, Restricted), 8 RendererLimit ids (texture size, vertex streams, uniform-buffer size, sampled textures per stage, vertex-input bindings and attributes, colour attachments, uniform-buffer offset alignment, each with an explicit known/unknown flag), per-format usage masks for the 27 SurfaceFormat values (each usage carries separate known and supported bits, so an unclassified use is not misread as unsupported), and a generated English report. Retired feature and limit ordinals stay reserved, so the surviving values keep their numbers. The profile is built lazily by the GraphicsDevice and cached until renderer reconstruction or device destruction.
#include "Microsoft/Xna/Framework/Game.hpp"
#include "CNA/RendererCapabilityProfile.hpp"
// inside a Game subclass, after the device exists:
auto& device = getGraphicsDeviceProperty();
bool shadows = device.SupportsRendererFeatureEXT(CNA::RendererFeature::ShadowSampling);
CNA::RendererLimitValue maxTex =
device.GetRendererLimitEXT(CNA::RendererLimit::MaxTextureDimension); // maxTex.known / maxTex.value
CNA::RendererFormatSupport color =
device.GetRendererSurfaceFormatSupportEXT(Graphics::SurfaceFormat::Color);
bool colorRt = color.Supports(CNA::RendererFormatUsage::RenderTarget);
std::string_view report = device.GetRendererCapabilityReportEXT(); // English text
The accessors are GetRendererCapabilityProfileEXT(), GetRendererFeatureSupportEXT(), SupportsRendererFeatureEXT(), GetRendererLimitEXT(), GetRendererSurfaceFormatSupportEXT() and GetRendererCapabilityReportEXT(); C functions expose the same surface in the experimental C API (ABI 0.50.0). Tutorial 133 is a full walkthrough.
Modern features by renderer
Only where the code claims the feature and a test exists. "Verified" means read in the renderer's implementation and its test registration; nothing here says a test was run.
| Feature | Renderers claiming it | Test evidence |
|---|---|---|
| Shadow sampling (single map, cascades, punctual) | SDL_GPU, WEBGPU, the three EasyGL identities, SOFTWARE, DIRECTX9 and FNA3D (stock-effect shadow sampling) | Per-family shadow-receiver and shadow-caster tests |
| Image-based lighting (PBR IBL) | EasyGL, SDL_GPU, WEBGPU, SOFTWARE, FNA3D | CNAEXT_ImageBasedLighting; per-family PBR golden or hand-derived tests |
PBR / skinned-PBR drawing (PbrEffect, SkinnedPbrEffect) | GL family, SDL_GPU, WEBGPU, DIRECTX9 (native HLSL), SOFTWARE (CPU evaluation), FNA3D; per renderer reported by PbrEffectShading and SkinnedPbrEffectShading | Golden and hand-derived tests per family (easygl_*pbreffect_golden, sdlgpu_*pbreffect_test, webgpu_*pbr3d_test) |
| Skinned mesh drawing | EasyGL, SDL_GPU, WEBGPU, SOFTWARE, DIRECTX9, FNA3D | Many per-family skinned-effect tests; parity fixture skinned_terms |
| Hardware instancing and base-instance drawing | Instancing: EasyGL, WEBGPU, SDL_GPU, DIRECTX9, SOFTWARE, HEADLESS; FNA3D conditional. Base-instance (DrawInstancedPrimitivesBaseInstanceEXT): SDL_GPU only | Parity fixture instanced_draw; SDL_GPU base-instance tests, including through a compiled effect |
| MSAA | See the matrix | Per-family MSAA tests; parity fixture backbuffer_msaa |
| Float / half-float render targets (HDR) | SDL_GPU, WEBGPU, EasyGL, SOFTWARE | Parity fixture hdr_render_target; float-render-target tests |
The opt-in CNAEXT extensions (CNA::Graphics: CRT, colour-depth and ASCII effects and debug drawing) need custom ShaderEffect support for the two shader-based effects; see CNAEXT extensions. Shadow maps and environment maps are rendered by the application and passed to the receivers in the table above.
Texture and surface formats
SurfaceFormat has 27 members: the 20 classic XNA formats and 7 CNA extensions (ColorBgraEXT, ColorSrgbEXT, Dxt5SrgbEXT, Bc7EXT, Bc7SrgbEXT, ByteEXT, UShortEXT). Each renderer classifies formats itself; a renderer with no classifier gets the framework rule: SurfaceFormat::Color only, anything else throws ("... is not implemented by the selected graphics renderer"). Six families classify Texture2D formats (DIRECTX9, EasyGL, FNA3D, SDL_GPU, SOFTWARE, WEBGPU), so only HEADLESS and STUB accept nothing but Color textures; four classify render-target formats (EasyGL, SDL_GPU, SOFTWARE, WEBGPU), so DIRECTX9, FNA3D, HEADLESS and STUB accept only Color render targets. Native Alpha8 render-target storage exists on no renderer: a target preferring it falls back to Color. Summaries below come from the implementation files, so treat them as guidance and use the profile for the truth on your device.
- EasyGL: Color, Alpha8 and DXT1/3/5 on every profile (CPU-decoded without S3TC), the packed 16-bit formats as sized GL storage, NormalizedByte2/4 and the remaining classic formats through the ES 3 sized-format set; the extension formats defer.
SDL_GPU: Color, packed 16-bit, DXT (native BC or CPU decode), NormalizedByte2/4 and Alpha8; Rgba1010102, Rg32, Rgba64 and the float and half-float formats in their exact native storage (widened to four channels with Direct3D 9’s fill) where the device can sample that storage, refused otherwise — never substituted; float formats inTexture3Dtoo.DIRECTX9: nativeTexture2D, cube and volume formats through its D3DFMT mapping, checked against the device; render targetsColoronly.WEBGPU: BC only when the device enabled it;HalfVector4andHdrBlendablestored natively asrgba16floatinTexture2D; float formats inTexture3D; optional browser texture formats are gated on what the browser offers; Rgba64 has no render-target mapping.SOFTWARE: the 20 classic formats, DXT stored as blocks; a block-compressedTexture2Dkeeps no zero-filled CPU shadow.FNA3D: Color and the signed-normalizedNormalizedByte2/NormalizedByte4(authentic XNA normal maps) are classified supported, with typedTexture3Dformats; DXT and BC7 follow the driver’s own format answer; every other format defers to the framework rule.
Declared maturity
Every identity carries a code-declared maturity and category (CNA::GraphicsRendererMaturity, CNA::GraphicsRendererCategory), readable from C++ and from the C API. These are CNA's own classification, not a measurement. Historical and Deprecated exist in the enum, but no renderer uses them at this snapshot.
| Declared maturity | Identities |
|---|---|
| Production | OPENGLES3, OPENGL33, DIRECTX9 |
| Supported | WEBGL2, WEBGPU, HEADLESS, STUB, SDL_GPU |
| Experimental | SOFTWARE, FNA3D |
Categories: Native (OPENGLES3, OPENGL33, DIRECTX9), TranslationLayer (WEBGPU, SDL_GPU, FNA3D), Software (SOFTWARE), Web (WEBGL2) and Diagnostic (HEADLESS, STUB). Automatic fallback uses these two declarations to order the candidates (mature GPU renderers first, CPU renderers later, HEADLESS after every renderer that shows a picture, STUB last). Read "Production" with the verification section beside it: it is a declaration, and the Windows lane in particular is exercised mostly under Wine.
How renderers are verified
Renderer verification is configuration-scoped. The selected renderer set, platform implementation, audio implementation, host and feature options decide which pixel, smoke and integration tests are built and registered. A multi-renderer build may contain several renderer test sets. Report ctest -N and executed results for the exact configuration rather than quoting a tree-wide registration total as though it were universal. CNA’s own latest full Debug runs (17 October 2026, Linux, Mesa RADV, recorded in its handoff.md, not repeated here) cover SDL_GPU, WEBGPU, SOFTWARE, FNA3D and a multi-renderer tree with OPENGLES3 as default; Verification lists them.
The XNA oracle corpus
CNA keeps 39 renderer-neutral reference scenes (256×256, HiDef) under tools/xna-oracle/scenes/, with 39 reference PNGs captured from the genuine Microsoft XNA 4.0 runtime running under Wine + DXVK on Linux — not on Windows. A further 7 unbound-texture scenes and a 17-format channel-expansion table were measured the same way; they sit outside every diff denominator. Renderers are compared against the 39 references at tolerance 0:
| Renderer | Scenes matched at tolerance 0 | What is gated |
|---|---|---|
DIRECTX9 | 39 of 39 recorded (Wine + DXVK; the last consolidated dated report covers 31 scenes; later per-scene notes record the rest) | CTest D3D9_XNA_Diff runs all 39; not in CI |
SOFTWARE | 18 of 39 byte-exact, 30 of 39 within one channel value (2026-09-11 measurement) | Two line scenes (Software_XnaLineCoverage), diffed at tolerance 0; only a failure to render fails the test |
| EasyGL (the three GL profiles) | 10 of 39 in a 2026-08-11 measurement that predates later fixes; the only later count is 9 of 39 for the OPENGLES3 leg of a 2026-08-15 multi-renderer run, which predates them too | Two line scenes (EasyGL_XnaLineCoverage); any difference fails the test |
FNA3D | 10 of 39 in the same 2026-08-11 measurement (OpenGL driver, Mesa llvmpipe) | Only that every scene renders (Fna3d_XNA_Oracle); differences are reported, not failed |
"Pixel-exact" is a DIRECTX9-only statement. It is also a statement about DIRECTX9 over DXVK. It is the one renderer recorded as matching the oracle corpus exactly, which makes sense — real XNA 4.0 ran on Direct3D 9. It has not been repeated on native Windows, and none of this runs in CI. No other renderer is held to that bar, and CNA does not claim otherwise.
Cross-renderer parity fixtures and glTF conformance
Thirty-two renderer-neutral parity fixtures (modules/graphics/examples/parity/) each state their expected result themselves; they are registered as <Renderer>_Parity_<fixture> for three renderer families — EasyGL, WEBGPU and SDL_GPU — and the renderer-neutral conformance programs are also registered on SOFTWARE, FNA3D and HEADLESS. The oracle is the fixture's own assertions, not real XNA. Separately, a glTF conformance corpus has renderer-owned goldens for OPENGLES3/EasyGL and SOFTWARE; that proves each renderer against its own past output, not against a reference renderer, and only the EasyGL job runs in CI.
What CI does and does not reach
CI exists across Linux, macOS, Windows and Emscripten jobs: 18 workflow files, 16 of which run automatically. It builds and smoke-tests; it is not a full GPU-oracle gate:
| Renderer coverage | Status |
|---|---|
OPENGLES3 (the full default suite under Xvfb, and the glTF L7 corpus); SDL_GPU and WEBGPU (platform-contract and glTF stride legs on Linux, SDL_GPU on lavapipe); SOFTWARE, HEADLESS and STUB (glTF stride, multi-renderer and platform jobs); SOFTWARE on macOS with a bundle smoke app and an iOS Simulator smoke app; an SDL_GPU-on-Metal smoke leg on macOS (gating) and non-gating iOS SDL_GPU legs; multi-renderer builds (HEADLESS;SOFTWARE;STUB and the Emscripten bundle WEBGL2;WEBGPU, built and inspected, not run) | Automatic on push and pull request |
DIRECTX9 and an SDL_GPU Direct3D 12 smoke leg on native MSVC; the SDL3 platform suite on Windows | Manual dispatch only |
FNA3D, OPENGL33 | Named by no workflow |
| Android, and a build of the experimental C API | No workflow |
| All 10 identities across every valid platform/driver combination | Not exhaustively covered |
The workflow inventory is evidence of build and smoke coverage, not of universal renderer fidelity, and the macOS SDL_GPU leg had not recorded a run at this snapshot. In particular, it does not establish every graphics driver path or the full GPU pixel/oracle matrix. Platforms has the workflow grouping, and Verification & Known Issues the wider testing story.
Which renderer should I choose?
Default answer: the platform default, with one caveat. OPENGLES3 on Linux and Android, WEBGL2 on the web, SDL_GPU on Windows, macOS and iOS. The first two are the best-evidenced configurations CNA has. SDL_GPU is CNA’s chosen modern path but is qualified on Linux and under Wine only at this snapshot, so test your game on the real target.
For a 2D game wanting maximum portability: the platform default. Every pixel-producing renderer draws SpriteBatch content; SOFTWARE needs no GPU at all.
For a modern 3D desktop game: SDL_GPU (SDL chooses Vulkan, Direct3D 12 or Metal) or OPENGL33/OPENGLES3; DIRECTX9 on Windows if you need the XNA-faithful path. Remember that SDL_GPU compiles ShaderEffect out on Windows and Apple and has no occlusion queries. Check the profile at start-up rather than assuming a feature.
For measured XNA pixel fidelity: DIRECTX9, the only renderer recorded as matching the checked-in 39-scene oracle corpus exactly. It is Windows-gated; the repository provides a manual MinGW/Wine + DXVK route, not an automatic workflow.
For CI with no GPU: HEADLESS or STUB when you only need game logic exercised, or SOFTWARE when you need real pixels — read back with GetBackBufferData(), since it does not present to a window (UseNullDevice and UseReferenceDevice select HEADLESS and SOFTWARE for you).
For the web: WEBGL2 is the default and the widest path, and the one the 90 published sample builds use; WEBGPU is Supported where the browser offers WebGPU. Whichever you pick, the web caveats above apply (no video; threaded builds proxy WebGL to the main thread).
Know what you are opting into. Custom ShaderEffect shaders are not accepted by SOFTWARE or FNA3D (FNA3D supports the separate compiled Effect Framework path instead), nor by SDL_GPU outside Linux and Android builds. Compiled-effect support is an opt-in build everywhere except FNA3D. CI does not exhaustively exercise every identity and driver combination.
Deep dives on this topic
Long-form pages that explain the exact semantics, invariants and evidence behind this subject.
- Capability answers, interface defaults and draw evidence — What a GraphicsCapability answer asks and guarantees in CNA: the 17 contract questions, renderer versus device polarity, known report mismatches, the unsupported-3D policy, four interface-default failure shapes and portable draw claims.
- Compatibility levels and the evidence vector — The distinct levels of XNA compatibility CNA keeps apart, the evidence vocabulary used across the site, what each renderer class can prove, and how to state a verification claim.
- Custom HLSL ShaderEffect on DIRECTX9 — How DIRECTX9 compiles a custom HLSL ShaderEffect, resolves uniform names through the constant table, feeds the SpriteBatch path, and why a custom effect does not reach its 3D draws.
- Direct3D evidence: MinGW cross-builds, Wine translators and native Windows — How DIRECTX9, and SDL_GPU on SDL's Direct3D 12 driver, are built and tested off Windows: MinGW cross-builds, the DXVK and vkd3d-proton gates and their Wine prefixes, the manual Windows workflow and what each evidence tier proves.
- Direct3D presentation, swap interval, clears, viewport and scissor — How DIRECTX9, CNA's Direct3D 9 renderer, treats presentation modes, PresentInterval, back-buffer and depth formats, full screen, readback, viewport, scissor, clears and depth bias.
- DIRECTX9: stock-effect bytecode, device lifecycle and oracle findings — How the XNA-fidelity renderer compiles Microsoft's stock effects, enforces GraphicsProfile from D3DCAPS9, recovers lost devices, handles targets and why its sprite projection is what it is.
- easy-gl and meta-gl: the two-library GL stack beneath the EasyGL family — How meta-gl and easy-gl split loading, typed calls, ownership and failure beneath CNA's three GL identities: revisions CNA needs, feature gating, per-thread state, context loss, tests and build inheritance.
- EasyGL state, clears, targets, queries and buffers: current semantics — What the EasyGL GL-profile renderer does at this snapshot for wireframe, occlusion counts, colour masks, clears, two-sided stencil, fog, base vertex, render targets, context-loss policy and viewports.
- EasyGL: three GL profiles, one implementation, and how far evidence carries — What OPENGLES3, OPENGL33 and WEBGL2 share in EasyGL, where they differ, how far evidence carries between them, and how to choose among them.
- Evidence tiers of the native modern GPU renderers — What SDL_GPU and WEBGPU, the two renderers that drive a modern explicit GPU API, implement at this snapshot, what evidence backs each, why a capability bit is not evidence, and the defect shapes they exposed.
- Glossary of XNA and CNA terms — Checked definitions of the XNA and CNA terms used across libcna.com, grouped by subject, each correcting common older readings and linking to the page with the detail.
- Presentation modes, swap interval, native handles and back-buffer readback across renderers — What each renderer family does with the presentation mode, swap interval, formats and full-screen request, how window handles are borrowed, and exactly what GetBackBufferData returns.
- SDL_GPU shader intake, pipeline keys and draw order — Why CNA's SDL_GPU renderer uses precompiled SPIR-V in SDL_gpu's set convention, which GLSL ShaderEffect accepts, how pipelines are keyed, what state is dynamic, and how draw order and vsync are kept.
- SDL_GPU uploads, render-target lifetime and swapchain recovery — What SDL_gpu validation exposed in CNA's SDL_GPU renderer, when uploads may cycle, how render targets outlive their wrappers, what MRT writes, and how a failed swapchain acquisition keeps the frame.
- Surface formats: profile gates, renderer verdicts and format usage — How CNA decides whether a texture, cube, volume or render target may use a SurfaceFormat: per-resource profile tables, the renderer verdict, draw-time rules and usage masks.
- The renderer contract: IGraphicsRenderer defaults, factories and failure shapes — Which IGraphicsRenderer bodies a renderer family must write, what each inherited default does to a public call, how null factories fail, and the evidence ladder behind a feature.
- WebGPU renderer semantics: surfaces, targets, mips and pipeline state — Exact behaviour of CNA's WEBGPU renderer: non-sRGB surface policy, target-relative SpriteBatch coordinates, cube render targets, blit-free mip generation, dynamic and baked state, ordered clears and BC textures.
Known issues in this area
Current defects, gaps and limitations at this snapshot that touch this subject.
- CNA-BUG-012: GraphicsDeviceCapabilityTest's catch-all expectations are still wrong for STUB and for Linux SDL_GPU builds without libshaderc — ExpectedCapabilities() now has an SDL_GPU arm, but on Linux it keeps the catch-all custom-effects expectation true although an SDL_GPU build without libshaderc answers false, and STUB, which answers false to every capabi
- CNA-BUG-054: HEADLESS reports occlusion-query support and a precise pixel count while its query always answers 1 — HEADLESS inherits OcclusionQuery = true and the default isPixelCountPreciseEXT() = true, but HeadlessOcclusionQueryRenderer completes at once and returns PixelCount() == 1 whatever was drawn.
- CNA-BUG-224: A GraphicsDevice maintainer comment still says only DIRECTX9 drives the device status, although WEBGPU raises device events too — The public DeviceLost documentation and two maintainer comments were corrected, but the comment inside getGraphicsDeviceStatusProperty still says only Direct3D 9 calls the device-event callback; WebGPU calls it from its
- CNA-BUG-225: Two EasyGL comments still describe runtime GL profiles (phase P11) as future work — EasyGLRendererDescriptor.cpp's file header and the CNA_RENDERER_SHARED_EASYGL comment in RendererCombinations.cmake say a runtime GL profile is still to come, although both files implement or record it.
- CNA-BUG-254: docs/directx9-renderer.md says the DIRECTX9 custom ShaderEffect phase (D9-11) has not been started; plans/plan_dx9.md records it fully closed on 2026-07-15 — The DIRECTX9 renderer document lists custom ShaderEffect (D9-11) as not started, while the plan it points to records D9-110, D9-111 and D9-112 all closed on 2026-07-15.
- CNA-BUG-282: RendererFeature::MultiSampleMask misreports EasyGL without glSampleMaski (OPENGLES3 on an OpenGL ES 3.0 context, WEBGL2) and WEBGPU over wgpu-native's Metal driver — The feature is defined so that Unsupported means a mask has no effect and Supported means any mask is applied, but EasyGL without glSampleMaski answers Unsupported while it throws NotSupportedException for every mask oth
- CNA-GAP-064: WEBGPU does not propagate a real device loss: OnDeviceLost only logs, so DeviceLost, the device status and the draw gate react only to the debug hooks — WebGPURenderer sets its lost flag, closes CanBeginDrawEXT() and raises DeviceLost only inside DebugSimulateContextLoss; the callback registered for a real loss only writes to stderr. CNA's own plan (WEBGPU-182) records t
- CNA-PLAT-016: On Apple, SamplerState.MipMapLevelOfDetailBias does not reach the GPU on FNA3D's non-OpenGL drivers — 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.
- CNA-PLAT-017: FNA3D has no occlusion queries on its SDL_GPU driver, the driver FNA3D tries first and the one it runs on Apple — Fna3dRenderer probes queries only on FNA3D's OpenGL and Direct3D 11 drivers; on its SDL_GPU driver (FNA3D's first choice, and its Metal route on Apple) OcclusionQuery is reported unsupported and its constructor refuses,