GPU: real 1D textures sampled by 2D image instructions (GPU-based validation id=940) #1714
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#1714
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Bullet18x on GitHub · 2026-11-24 21:08 UTC · original
GPU-based validation reports, in pixel shaders during the menus:
#205 fixed the UAV case of this and noted that this SRV case "is a separate issue and is not addressed here". #568 covers 1D null placeholders in slots a later draw reads as 2D. This issue is about real 1D textures.
Evidence (RTX 5090, driver 621.40, Windows 11 10.0.28000,
mainffe310e, diag build, menus; a temporary log indescriptor/host.rsmake()for shader views whose titleViewDimensionis 2, not part of any PR):ViewDimension2 (TEXTURE1D) on resources withDimension2 (TEXTURE1D), in the first ~55 s:null_like(#568's case): mostly format 65.VICTORY_D3D12_GBV=1, 5× id=940 in the menus (Asm Instruction Range 0x46 / 0x4e).So the title makes 1D textures and 1D views, and at least one of its pixel shaders reads them with an image instruction whose
dimis 2D. The console hardware goes by the descriptor's type and ignores the extra coordinate; D3D12 requires the declared resource type to match the view, so the read is undefined on the host (and GBV flags it).Proposed fix (I'm happy to write it, unless someone already is or you prefer another way):
null_like/null_forlikewise).dim1D / 1D_ARRAY image instructions as 2D / 2D_ARRAY with y = 0 (the slice moving to the third coordinate), andimage_get_resinfokeeps reporting the 1D sizes.Then every 1D read, whichever
dimthe instruction names, matches a 2D view. Questions before I start: is anyone on this already, and is "1D as 2D, height 1" the direction you want (vs. something narrower)?No game data, title-content log lines or screenshots attached. AI use: Claude Code (Claude Opus 5.5) traced this and wrote the issue; I checked it.
@Calvix2k on GitHub · 2026-11-24 21:08 UTC · original
No one here is on it (checked #1633/CLAIMS.md and the open PRs), so please go ahead with the proposed 1D-as-2D direction. The three parts (host textures, views including null_like/null_for, and the shader dim lowering with get_resinfo unchanged) read coherently; happy to review the PR or run its synthetic checks on an RX 7800 XT.
@BastienRodz on GitHub · 2026-11-24 21:08 UTC · original
For coordination with #568 (mine): its
4b4d504already covers the null side of this for annotated reads. A title view the host can't make (an SRV with no resource) takes the typed null the reading draw annotates, Texture2D here, instead ofnull_for's 1D one.b2a6bd2keeps that from flipping between kinds while earlier draws are in flight. So your step 2 fornull_for/null_likewould mostly matter for unannotated (dynamically indexed) reads, and it touches the same lines indescriptor/host.rs. If yours lands first I'll rebase #568 onto it, and if #568 lands first the conflict is small. Steps 1 and 3 (real 1D textures as 2D with height 1, and thedimlowering) don't overlap at all.@fiestorra on GitHub · 2026-11-24 21:15 UTC · original
On the "1D as 2D" direction: one constraint that decides the shape of it
I looked at what the fix meets in the code rather than at the report, and there is one thing worth settling before writing it, because it decides between two very different implementations.
crates/victory-gpu/src/resource.rs::host_texturepasses the title's description toCreateCommittedResourcealmost unchanged (it zeroeslayoutandalignment, masks the flags, maps the format). So a title 1D texture becomes aD3D12_RESOURCE_DIMENSION_TEXTURE1Dcopy withLayout: 0— tiled — while the console's own layout for a 1D texture is linear:resource.rsmapsTEXTURE_1DtoDimension::Tex1dand thenSwizzle::LINEARfor it, and the upload path intexture.rswrites the console bytes accordingly.Which means: if the host copy becomes a plain 2D texture, it is a tiled 2D texture of height 1, and the linear bytes the title uploads no longer map onto it — you would need a new linear→tiled conversion for 1D uploads, which is a much bigger change than the report implies.
The way that avoids it: create the host copy as
TEXTURE2DwithHeight = 1andLayout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR. Row-major keeps the console's bytes in the same order (GetCopyableFootprintsthen gives a row pitch that matches), and the crate already uses row-major resources in five places (resource.rs:1713,host.rs:805,host.rs:1411,host.rs:1786,capture.rs:136), so the pattern is established. With that, the SRV description becomesTEXTURE2DwithHeight1 and the reading pixel shader's 2D instruction is correct by construction, andget_resinfostill reports the 1D dimensions the console's shader expects (as your proposal says).Two limits of that route, from D3D12's side rather than from the title:
host_textureladder stay as they are; only the description changes, so the checkThe host has no sRGB unordered accessand the depth/UAV masking further down do not need to move.One coordination note, since it is the same function: the fallback ladder in #1630 also edits
host_texture's description before creation (it retries a refused description without the clear value, without the UAV permission, and so on). Whichever of the two merges second will rebase in that function; the two changes are independent in intent, but if you want to avoid the conflict entirely, building the 1D-as-2D description first and then handing it to the ladder is the arrangement that keeps both.I am not claiming this one — it is yours and you already have the evidence — and I cannot test it here: my machine has no presentable desktop (the agent runs in session 0), and the menus in a headless run take about 55 s to reach the point where the 17
16×1views exist, which is fine, but the GPU-based validation part needs the debug layer to stay clean, and I would rather not send you numbers from a run I cannot fully verify.No game data is involved: descriptions, layouts and offsets only.
Written with an AI assistant.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 21:24 UTC · original
I checked the upload part of the proposed 1D-as-2D change on WARP at
ffe310eb2098e52169f4c44db5ffdabf43a72622. A synthetic guest texture was 16×1 RGBA8 with two mips and two array slices. The guest description and its linear layout stayed the same. The only prototype change was to create the DEFAULT-heap host resource as Texture2D, height 1, with the existingD3D12_TEXTURE_LAYOUT_UNKNOWN.The existing
texture::uploadpath took the guest layout, populated the placed upload footprints and recordedCopyTextureRegion. All 192 bytes read back exactly across the four host subresources. The original SHA's host resource was Texture1D, as expected. All sevenresource::testspassed with the prototype.This verifies the upload side of the change. The remaining pieces are descriptor conversion and shader sampling. The buffer footprint carries the linear bytes while D3D12 manages the destination texture's layout. Microsoft's upload documentation
@DesertGamer on GitHub · 2026-11-24 21:32 UTC · original
Heads-up: VIctory V2, a community integration fork
Hi everyone!
I want to help get community contributions into the project faster, so I've started VIctory V2, an integration fork of this repository:
https://github.com/DesertGamer/VIctory-V2
What it does
build.rs, git hooks, scripts, new dependencies)Please note
main.If your PR has been sitting unreviewed, feel free to point me to it. Feedback and bug reports are welcome in the V2 repo.
If this post doesn't belong in this section, let me know and I'll remove it.
@Marvisak on GitHub · 2026-11-25 12:48 UTC · original
Automated triage for the maintainers. Confirmed by reading
main(940d32f). A title TEXTURE1D keeps its 1D dimension on the host, because the host copy's description incrates/victory-gpu/src/resource.rstakes the title'sDimensionas is. Its shader views keep the title's 1DViewDimensiontoo:srv_descincrates/victory-gpu/src/descriptor/host.rscopies the title's view words unchanged apart from the format, andmakehands them toCreateShaderResourceView. A pixel shader that reads such a view with a 2D image instruction therefore declares a Texture2D over a 1D view, which GPU-based validation reports as id=940. Nothing changes the 1D case on the shader side either.Open PR #1727 (1D textures are 2D on the host, one texel high) addresses this. The comments above settle the upload side (andrewpozdnakov7-jpg's WARP check: a 2D height-1 host texture with the existing layout takes the linear upload byte for byte) and the overlap with #568's typed nulls.
Generated by Claude Code