Skip to content

fix(gpu): preserve pixels outside texture readback regions - #1

Closed
jeremygold02 wants to merge 1 commit into
alessiodeia:feat/texture-to-buffer-copyfrom
jeremygold02:codex/preserve-partial-readbacks
Closed

jeremygold02 wants to merge 1 commit into
alessiodeia:feat/texture-to-buffer-copyfrom
jeremygold02:codex/preserve-partial-readbacks

Conversation

@jeremygold02

Copy link
Copy Markdown

The texture-to-buffer path introduced in Marvisak#67 can copy pixels outside the requested destination rectangle. The GPU fills only part of its staging buffer, then the host copies the whole footprint into title memory. This change uses the source box or selected subresource extent and destination coordinates to copy back only the affected rows of each depth slice.

On a physical RTX 5070 (driver 621.01), I copied a 2×2 box into a prefilled 4×4 RGBA8 destination. At b5c38fa, all 4 requested pixels were correct and 0 of the 12 neighboring pixels retained their values. With this change, all 4 requested pixels were correct and all 12 neighbors retained their values. A whole 4×4 source copied to (1,1) in a packed 6×6 destination also matched all 36 expected pixels.

The added checks exercise the existing synthetic GPU fixture. On Windows, all 37 victory-gpu library tests passed in the default configuration. cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings and git diff --check passed. AI-assisted.

Copy only the rows, columns and depth slices written into the staging footprint. Preserve surrounding texels for boxed and whole-subresource copies into larger destinations.

Refs: Marvisak#67
@jeremygold02

Copy link
Copy Markdown
Author

I moved the follow-up review to Marvisak#137. That upstream draft depends on Marvisak#67 and links the one-commit fix.

alessiodeia pushed a commit that referenced this pull request Nov 25, 2026
Exercise the descriptor cursor regression on the actual heap capacity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant