Repository navigation
perf(agc): build check failure messages only when a check fails - #444
Merged
oneandonlydean merged 1 commit intoOct 3, 2026
Merged
Conversation
Require takes its reason as a std::string, so a check whose message is built with std::to_string and concatenation formatted that message on every call, even when the check passed. The checks on per-draw and per-descriptor paths (sampler and texture format decoding, descriptor binding roles, storage formats, detiling, float registers) now build their message only on the failing branch. Behaviour is unchanged.
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.
What
The message argument of
Requireis built before the call, so a check written asRequire(ok, "... " + std::to_string(x))formats its message (ato_stringand one or more concatenations, so heap allocations) on every call, even when the check passes. Several of these sit on per-draw and per-descriptor paths:DecodeSamplerResource: mip filter and anisotropy ratioShaderResources::buildPrepareandaddImageBinding: descriptor role and kindreadFloat(State.cpp): non-finite registerStorageFormatFor,findFormatEntry: storage and guest texture formatTextureDetiler::pipelineandDispatch: swizzle equation and detiling windowEach one now tests the condition first and calls
Require(false, ...)with the same message on the failing branch only, the formState.cppalready uses. Messages and behaviour are unchanged.I left
BdaResources::markWrittenPagesalone because #390 rewrites the message on that line; I can do it after #390 lands.Tested
BUILD_TESTING=ONandctestpass. The failing branches keep their existing coverage:agc_driver_graphics_testschecks the sampler messages ("unknown anisotropy ratio", "unknown mip filter"), the descriptor role and kind messages, andTextureFormat.cppthe "unsupported guest texture format" message.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)