GPU: a render or depth view description with an unknown format names the resource's on a typeless host copy #2279
No reviewers
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!2279
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2279"
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?
@denkencar-sketch on GitHub · 2026-11-25 09:29 UTC · original
denkencar-sketch:fix/desc-002→main· +36 −12 · 1 files · 1 commits · openSummary
A render or depth view description with an unknown format was passed to a typeless host copy with that format, which the host refuses. Only descriptionless views were given the format; a described view with an unknown format now takes the resource's.
Testing
Test
an_unknown_format_in_a_view_description_is_the_resourcesfails without the substitution and passes with this change.cargo test --workspace --lockedpasses apart from the known flakes:modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo, and so does a parallel-run flake invictory-gpu's lib tests (watch::anddescriptor::host::tests, 2 of 40 runs on pristinemain).Not tried: a real typeless depth view, and a run in the game.
AI-assisted.
@DesertGamer on GitHub · 2026-11-25 09:37 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 10:14 UTC · original · edited 2026-11-25 10:22 UTC
I tested the real typeless-depth case called out in the PR. 9b1a21f adds one test directly on 132472838c090346c18b3af5dd1df4c04ba33689.
A guest D32_FLOAT resource creates an R32_TYPELESS host texture. With the main descriptor code from
940d32f69b, the same test receives DXGI_FORMAT_UNKNOWN from the view decoder and stops before creating the DSV. On this PR it receives D32_FLOAT, records a host clear and reads back 0.375 from all 16 depth values on WARP. The full GPU suite on WARP passed with 148 passed and 2 ignored. Strict Clippy in both modes and the repository policy check passed.Please preserve the test's Git author if you take it. If you fold it into another commit, please add:
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted. Synthetic tests only.
@Marvisak on GitHub · 2026-11-25 13:32 UTC · original · edited 2026-11-26 01:22 UTC
Automated triage for the maintainers.
Merge candidate. Rebased; it merges cleanly again. In
crates/victory-gpu/src/descriptor.rs,RtvRecord::host_descnow goes throughhost_words: a view that has a description but names the unknown format (0) gets the format fromresource::view_format, just as a view without a description already did. A typeless host copy cannot take an RTV/DSV with an unknown format. Views with a typed host copy, and views that name a format, are unchanged. The new testan_unknown_format_in_a_view_description_is_the_resourcescovers those cases and thepc_formatmapping (118 -> 20).CI: passing (
check).Generated by Claude Code
@catminou4 on GitHub · 2026-11-25 09:35 UTC · original · reviewed
A render/depth view description with an unknown format resolves through the typeless host copy's own format (host_words). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
@DenRakEiw on GitHub · 2026-11-25 09:42 UTC · original · approved these changes
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib descriptor::tests::— 6 passed, 0 failed (includingan_unknown_format_in_a_view_description_is_the_resources)cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean fallback using the resource's own format when an RTV/DSV description specifies
DXGI_FORMAT_UNKNOWNon a typeless host copy. Looks good.AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 19:27 UTC · original · requested changes
Tested
bda54f776620b7bcbdaf04efaafcba9b9ad20110merged ontoorigin/main(63bcca43c6a00a758510398fa43096ce7e4f7df0) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + Microsoft WARP,--features diagnosticswithVICTORY_D3D12_DEBUG=1, Rust 1.98.1 MSVC).The typeless-host cases (typeless
D32_FLOAT,D16S8mapped to20,R8G8B8A8_UNORM_SRGBwithALLOW_UNORDERED_ACCESS, and shared-memory format aliases) all passCreateRenderTargetView/CreateDepthStencilViewwith zero debug-layer errors on both RTX 5090 and WARP.Blocking Issue:
Format = DXGI_FORMAT_UNKNOWN (0)on typed castable colour render targets triggers D3D12 device removal (0x887A0001)In
crates/victory-gpu/src/descriptor.rs:369,RtvRecord::host_descresolvesownviacrate::resource::view_format(self.resource), sohost_words(L383-385) leaveswords[0] == 0(DXGI_FORMAT_UNKNOWN) whenever the host copy has the same typed format as the title resource (also asserted inL909).However,
crates/victory-gpu/src/resource.rs:1317-1381(make_texture) creates every non-depth colour texture onID3D12Device10throughCreatePlacedResource2/CreateCommittedResource3with an explicitpCastableFormatslist (e.g.DXGI_FORMAT_R8G8B8A8_UNORMhas 21 castable formats). In D3D12, passing a non-nullD3D12_RENDER_TARGET_VIEW_DESCwithFormat = DXGI_FORMAT_UNKNOWN (0)for a resource created with a castable format list is illegal and immediately removes the device — even though the host texture's own format is typed (28) andpDesc = NULL(described == 0) succeeds.Hardware Repro (RTX 5090 & WARP, both default and diagnostics builds)
TEXTURE2DwithFormat = DXGI_FORMAT_R8G8B8A8_UNORM (28)andFlags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET (1).create_rtvwith a non-null description[0, 4, 0, 0, 0, 0](Format = DXGI_FORMAT_UNKNOWN,ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D).host.rtv(©.texture, rec.desc().as_ref())(asdraw.rs:430andlist.rs:1025do).Observed on both RTX 5090 and WARP:
resource::view_formatreturnsNone, sorec.desc()returnsSome(D3D12_RENDER_TARGET_VIEW_DESC { Format: DXGI_FORMAT(0), ViewDimension: TEXTURE2D, .. }).ID3D12Device::GetDeviceRemovedReason()immediately transitions fromOk(())toErr(DXGI_ERROR_INVALID_CALL)(0x887A0001).--features diagnosticsandVICTORY_D3D12_DEBUG=1,ID3D12InfoQueuelogs:D3D12_MESSAGE_ID(38):ID3D12Device::CreateRenderTargetView: The view format (0, UNKNOWN) was not specified in the list of castable formats. The resource ... was created with an explicit format cast listD3D12_MESSAGE_ID(38):ID3D12Device::CreateRenderTargetView: The Format (0, UNKNOWN) cannot be used, when creating a View of a Texture2D.D3D12_MESSAGE_ID(232):ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_INVALID_CALL: ...)Suggested Fix
When
self.described != 0andwords[0] == 0, resolve the unknown format to the resource's title format (crate::resource::title_format(self.resource)) beforepc_format, while keepingcrate::resource::view_format(self.resource)for theself.described == 0branch so descriptionless views on typed host copies still returnNone(pDesc = NULL):Locally tested this change on both RTX 5090 and WARP (
--features diagnostics,VICTORY_D3D12_DEBUG=1) across 8 RTV/DSV cases — typed castableR8G8B8A8_UNORM(Format = 0,described = 0, and explicit cast to29), typedD32_FLOAT(DEPTH | DENY_SHADER_RESOURCE), typelessD32_FLOAT, typelessD16S8(118 -> 20), typelessR8G8B8A8_UNORM_SRGB(RT | UAV), and a shared-memory alias (29on a28host copy): all 8 pass withGetDeviceRemovedReason() == Ok(())and 0 debug-layer messages. (Updating the doc comment and unit test atdescriptor.rs:909to reflect resolving unknown formats on castable/typed resources as well would keep the test suite aligned.)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.