fix: make the Null graphics backend compile again - #3371
Open
sasvdw wants to merge 2 commits into
Open
Conversation
The shared signatures moved to ref readonly and ReadOnlySpan, and the Null implementations did not follow. Three query members the runtime needs were never added at all, and one file uses ReadOnlySpan without a using. No CI job builds Null, which is why the drift went unseen. main.yml now builds it beside Direct3D11, Direct3D12 and Vulkan. The bodies stay NullHelper.ToImplement stubs. This backend ships no renderer; compiling it is what keeps the shared API honest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
xen2
reviewed
Aug 25, 2026
| uses: ./.github/workflows/build-windows-runtime.yml | ||
| with: | ||
| build-type: Release | ||
| graphics-api: Null |
Member
There was a problem hiding this comment.
I think Null is treated as a special value for github CI, and is considered same as Direct3D11 (default)
We can see it in that job: https://github.com/stride3d/stride/actions/runs/32655466218/job/97960577627?pr=3371 (null but it actually try to launch D3D11, which is detected as a duplicate).
Anyway, adding Null to CI is OK to pursue if easy, but maybe not a priority as we need a decision on if a Null platform is worth keeping at all.
Member
There was a problem hiding this comment.
Note: it seems the fix might be to quote it: graphics-api: "Null"
xen2
reviewed
Aug 25, 2026
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.
PR Details
Summary — The Null graphics backend does not compile. This makes it compile again, and adds the CI
leg whose absence let it drift.
What was wrong
StrideGraphicsApi=Nullfails to build onmaster. Nine problems in three shapes.Shared signatures moved and the stubs did not follow.
CommandListnow declaresSetScissorRectangleImpl(ref readonly Rectangle)andSetScissorRectanglesImpl(ReadOnlySpan<Rectangle>),while Null still had
ref Rectangleand(int, Rectangle[]).SetRenderTargetsImplstill took(Texture, int, Texture[])and had lost itspartialkeyword entirely.SwapInternalwas declared as the wrong kind of method.Texture.Null.cshadinternal partial void SwapInternal(Texture), but it is not a partial method: it isinternal virtual void SwapInternal(GraphicsResourceBase)onGraphicsResourceBase, overridden pertype. Null never declared the base, so the override had nothing to attach to.
Three members the runtime calls were missing.
QueryManagerusesQueryPool.TryGetData,GraphicsDevice.TimestampFrequencyandCommandList.WriteTimestamp. None existed in Null, so thefailure only appeared once something compiled against the backend rather than in the backend itself.
Also
GraphicsOutput.Null.csusesReadOnlySpan<GraphicsProfile>with nousing System;— a signaturethat was updated at some point and never compiled since.
Why it went unnoticed
No CI job builds Null.
main.ymlhasWindows-Runtime-D3D11,-D3D12and-Vulkan, andbuild-windows-runtime.ymloffered only those three. Nothing has compiled this backend in a long time.This adds a fourth
Windows-Runtime-Nulljob beside the others. That is the part that stops ithappening again; without it the same drift returns the next time a shared signature changes.
What this does not change
Every body stays a
NullHelper.ToImplement()stub. Null ships no renderer and this does not make itone. The value is that compiling it keeps the shared API honest across backends — the same reason the
now-disabled
TestGraphicsApiCheckused Null as its reference.Related Issue
Found while verifying #3370. It also means the
GraphicsBackend.Null.cspartial added in #3368 hasnever been compiled; once this lands, that becomes checkable.
Types of changes
Checklist
Validation status
Every build below used
-t:Rebuild. An incremental build reports success without compiling, which ishow this was missed in the first place and how I first mis-reported it as working.
build/Stride.Runtime.slnfclean with the exact arguments the new CI job uses(
Release,StridePlatforms=Windows,StrideGraphicsApis=Null, skipping unit tests and autopack).Stride.GraphicsandStride.Enginealso clean on their own.Stride.Engineclean under each. Every change here sits inside#if STRIDE_GRAPHICS_API_NULL, but that is checked rather than assumed.not compile.