Repository navigation
fix(rtx): support CUDA-backed texture arrays and preserve mapping pointer - #395
Merged
jeffamstutz merged 4 commits intoNov 17, 2026
Merged
Conversation
Remove private helpers with no callers to avoid MDL C225 warnings during device initialization. Preserve exported input types and constructors.
CUDA-backed shared and captured arrays have no host allocation, so the host-only mapping lookup returned null. Return the supplied CUDA pointer without uploading or exposing an internal device copy of host storage. Exercise repeated mapping and captured-memory lifetime; reject mapping state warnings without coupling the test to unrelated device warnings.
Host-only source lookup prevented CUDA-backed arrays from reaching image samplers. Select the copy direction from the source allocation and prefer host storage when an internal device copy may be stale. Reject foreign-GPU pointers before copying or launching work on the current device. Cover rendered updates through unmap and safe foreign-pointer rejection.
Avoid downloading RGB input or allocating an intermediate RGBA buffer. Thrust surface writes populate the final texture array while preserving component bits and opaque alpha. Only device RGB needs surface support. Translate Thrust failures to CUDA status without attributing earlier thread-local errors to the expansion. Share the compiled production kernel with a focused unit test covering native formats, offsets, repeated writes, and unrelated CUDA errors.
tarcila
force-pushed
the
cuda-texture-array-interop
branch
from
November 17, 2026 22:24
c0a1618 to
23add40
Compare
jeffamstutz
approved these changes
Nov 17, 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.
Summary
Fix CUDA-backed array mapping and texture uploads, and expand RGB data directly into CUDA texture arrays without a host round trip.
Testing
Passed the existing build-mdl test binaries on one GPU:
Coverage includes mapping ownership and pointer identity, repeated texture updates, RGB expansion across component types and dimensions, windowed arrays, and upload-failure recovery.
The foreign-device rejection test was skipped because only one GPU was allocated. No clean rebuild or full test-suite run was performed during review.