Repository navigation
Structs passed by value through tsbindgen, not gen_nvrhi_classes.py's table - #86
Merged
Merged
Conversation
…s.py's table tslang now passes a @cpp method's record by value as each C++ ABI does, and reads small records back from registers, and its tsbindgen binds such methods instead of skipping them (TypeScriptCompiler cpp-records-by-value; needs a tslang newer than pre-alpha101). So: - tools/gen_nvrhi_classes.py loses BY_VALUE, the hand-written declarations and functions of the 11 methods tsbindgen skipped (clearTextureFloat, clearDepthStencilTexture, clearTextureUInt, beginTrackingTextureState, setTextureState, getNativeView, createHandleForNativeTexture, createHandleForNativeBuffer, createSamplerFeedbackForNativeTexture, queryCoopVecMatMulFormatSupport, queryCoopVecTrainingFormatSupport), each one per ABI; it stops if an older tsbindgen leaves one out; - core/nvrhi_classes.<os>.ts declare them as tsbindgen writes them: the TextureSubresourceSet, nvrhi::Object and std::optional<ComponentMapping> as tuples, the coop vec results as records; - core/nvrhi.ts has the nvrhi.* functions callers use, once for both ABIs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t has it Co-Authored-By: Claude Opus 5.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.
Summary
tslang pre-alpha102 (ASDAlexander77/TypeScriptCompiler#578) passes a
@cppmethod's struct by value as each C++ ABI does (MSVC x64, SysV x86-64, AAPCS64) and reads small structs back from registers. Its tsbindgen now binds such methods instead of skipping them. So:tools/gen_nvrhi_classes.pylosesBY_VALUE. That table held hand-written declarations and wrapper functions, one per ABI, for the 11 methods tsbindgen used to skip: clearTextureFloat, clearDepthStencilTexture, clearTextureUInt, beginTrackingTextureState, setTextureState, getNativeView, createHandleForNativeTexture, createHandleForNativeBuffer, createSamplerFeedbackForNativeTexture, queryCoopVecMatMulFormatSupport, queryCoopVecTrainingFormatSupport. The generator now stops if an older tsbindgen leaves one of them out.core/nvrhi_classes.<os>.tsdeclare them as tsbindgen writes them. TextureSubresourceSet, nvrhi::Object and std::optional are tuples; the coop vec results are records.core/nvrhi.tshas thenvrhi.*functions callers use, written once for both ABIs.TSLANG_VERSIONis bumped to v0.0-pre-alpha102, which these declarations need. The version mentions in the README and the generator now name it.Verification
-debug.🤖 Generated with Claude Code