Repository navigation
GPU: mirror placed unordered texture views - #1273
Conversation
|
Independent check on
In the second case the fixture checked that the placed SRV resolved to a different host texture from the one the first dispatch wrote. A comparison build that resolves the placed SRV to the matching live object returned [64, 0, 255, 255] in both cases. This gives the explicit-object case its own regression target. Title use and address reuse remain open. One separate portability result: the format matrix stopped at case 7 ( |
|
@fuzeofficlal The original placed-Hi-Z UAV comparator independently confirmed #921 on AMD, NVIDIA and WARP. Base binds a UINT null UAV for a FLOAT write and keeps the previous Hi-Z result even after the aliased input refreshes correctly. Your exact |
Adapt Marvisak#1273 (62946e6). Preserve the existing depth UAV twins, packed-format substitutes, and linear/sRGB views. Check typed UAV device support once per format and execute the placed texture write and subsequent SRV read on Linux through DXC and Vulkan.
|
Automated triage for the maintainers. Recommended for a maintainer's look (not an approval). Rebased onto current Generated by Claude Code |
62946e6 to
4af9623
Compare
|
Thanks @MichaelSmithAI for the two-dispatch empirical test and the Wine/GE report — pushed
|
4af9623 to
d7ac61d
Compare
|
Independent WARP check of d7ac61d against 940d32f. I added the same existing guest image_store regression to both local builds. It creates the placed UAV, records and submits through VIctory, then reads back two RGBA32_FLOAT texels. Main returned two zero texels. Your updated head returned [1, 0.5, -0.25, 2] in the target and kept its neighbor zero. The full WARP GPU suite with the diagnostic fixture was 146 passed, 1 failed (that regression), 2 ignored on main and 150 passed, 0 failed, 2 ignored on your head. The four creation-order cases in explicit_and_placed_rgba8_textures_at_one_address_share_compute_writes also passed with GPU-based validation enabled. |
|
I packaged the independent guest image_store regression as one test-only commit directly on d7ac61d. 7d1a491 This adds guest shader translation, placed UAV creation and State::dispatch before RGBA32_FLOAT texture readback. On WARP, 940d32f left the target texel zero. Your head wrote [1, 0.5, -0.25, 2] and kept its neighbor zero. The full GPU suite on your head plus this fixture passed 150 tests with two ignored. GPU Clippy with diagnostics and staged asset policy passed. If you take the commit, please keep andrewpozdnakov7-jpg as its author. If you fold the test into another commit, please use: Co-authored-by: andrewpozdnakov7-jpg andrewpozdnakov7-jpg@users.noreply.github.com |
|
Thanks @andrewpozdnakov7-jpg — this is the end-to-end coverage #921 was missing: a translated guest shader writing through a placed texture UAV, read back on the host. It fails on main (the texel stays zero) and passes on this branch on hardware and WARP. Your commit 7d1a491 is on the branch unchanged with your authorship; the only follow-up (52d210c) moves the |
Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs.
52d210c to
b5ea728
Compare
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
Upstream now refuses typed unordered views in formats the host cannot store to (Marvisak#2462) and mirrors placed unordered texture views (Marvisak#1273); Marvisak#1832's permission drop on top of that left placed UAV textures without their host views (placed_uav_textures_create_real_host_uavs, placed_unordered_textures_write_and_read_back_through_placed_views).
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
…his line has them placed_uav_textures_create_real_host_uavs (main's, Marvisak#1273): Marvisak#2294 (96f6894) makes a typed depth format in a shader resource view in its readable colour format (fits, DEPTH_READABLE), so an SRV of an R32_TYPELESS or R16_TYPELESS texture in D32_FLOAT or D16_UNORM is now a real R32_FLOAT or R16_UNORM view, not the null fallback. The debug layer logs nothing for it, as the test checks. SRV cases 0 and 1 now expect a real view. The unordered-access cases stay null. query_resolves_after_unordered_access_to_destination (Marvisak#159's): main's clamp (315cea1) reads the title's records through a root view and writes into the list's own argument buffer, so the destination's copy is never written or left in unordered access. The test checks the title's records stay as written and that the resolve lands, and is renamed query_resolves_after_a_clamp_reads_destination. This is the author-branch fix gpu/host-queries ba872ae2 with this line's bound() arguments. PLAY-MAIN-781E846.md: both traced and fixed in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
* GPU: mirror placed unordered texture views (Marvisak#921) Resolve `View::Placed(true, ...)` texture descriptors through `placed_texture` to `View::Unordered` on the shared host texture for that memory so placed unordered texture views bind real D3D12 UAVs and transition to `UNORDERED_ACCESS` instead of falling back to null UAVs. Refresh an already-mirrored placed texture slot when a later unordered or renderable view upgrades that memory's `HostTexture`, and apply `alias_source` copies to explicit SRVs superseded in `MEMORY` as well as placed SRVs so compute writes at one guest address stay visible regardless of view creation order. Also resolve `DXGI_FORMAT_UNKNOWN` (`0`) view descriptions from `resource::view_format` when the host copy is typeless or castable, and check `typed_store` as well as typed-depth/typeless view exclusions in `fits` before creating host SRVs/UAVs. * GPU tests: dispatch a guest shader through a placed texture UAV * GPU tests: declare the placed UAV tests beside the other pipeline modules --------- Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
Fixes #921
Summary
descriptor/host.rs::placed_texture()previously matched onlyView::Placed(false, ...), causing allView::Placed(true, ...)placed texture UAVs to fall back to null descriptors (silently dropping shader writes and skippingUNORDERED_ACCESSstate transitions indraw::readable()), while placed buffer UAVs (resource[0] == 1) already worked.This change mirrors placed unordered texture views and guards the newly reachable D3D12 view/format combinations:
crates/victory-gpu/src/descriptor/host.rs,draw.rs):placed_texture()to matchView::Placed(unordered, resource, desc)and emitView::Unordered(texture as usize, 0, view_desc)whenunorderedis true (View::Shaderwhen false)."placed unordered texture view not mirrored"shortcut while retaining theresource[0] != BUFFERguard inmake()whenplaced_texture()returnsNone.View::Unorderedreturned byplaced_texture(),draw::readable()automatically transitions placed texture UAVs toD3D12_RESOURCE_STATE_UNORDERED_ACCESSand subsequent placed SRV reads back toSHADER_RESOURCEwithout CPU upload clobbering (!title_written).crates/victory-gpu/src/descriptor/host.rs):supports_typed_uav(device, format)queryingD3D12_FEATURE_FORMAT_SUPPORT(D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) and applied it infits()for bothDXGI_FORMAT_UNKNOWN(0) and concrete effective formats, preventing device removals on unsupported view formats (e.g.B8G8R8X8_TYPELESS->B8G8R8X8_UNORM(_SRGB)).fits()to rejectDEPTH_FORMATSon the requestedviewformat as well as the underlyingownresource format, and to reject(typeless && is_typeless(view)).desc.Format == DXGI_FORMAT_UNKNOWN(0) viacrate::resource::view_format(resource)inmake()forView::ShaderandView::Unorderedbeforefits(), keepingR8G8B8A8_UNORM_SRGB/B8G8R8A8_UNORM_SRGB(29/91) +ALLOW_UNORDERED_ACCESSviews working as linear UAVs (28/87).Verification
main(ffe310e): synthetic compute dispatch writing a placed texture UAV returned[0, 0, 0, 0](UNORDERED_ACCESStransition also skipped).62946e6, synthetic tests indescriptor/host.rs&draw.rscovering 16 placed UAV / 4 placed SRV descriptor cases,D3DCompilecs_5_1per-texel placed texture + placed buffer UAV readback, andUNORDERED_ACCESS->SHADER_RESOURCEstate transitions):cargo xtask policy: pass (154 files ok)cargo clippy --workspace --all-targets --locked -- -D warnings(default &--all-features): 0 warningscargo test --workspace --locked(NVIDIA GeForce RTX 5090, solo): pass (victory-gpu:53 passed, 0 failed, 1 ignored; all workspace crates pass)VICTORY_D3D12_DEBUG=1 cargo test -p victory-gpu --features diagnostics --locked:56 passed, 0 failed, 1 ignoredVICTORY_D3D12_DEBUG=1 VICTORY_D3D12_GBV=1 cargo test -p victory-gpu --features diagnostics --locked(placed_uav&compute_dispatch_writes_placed_texture_and_buffer_uavs):2 passed+1 passedVICTORY_D3D12_WARP=1 cargo test -p victory-gpu --features diagnostics --locked(with & withoutVICTORY_D3D12_DEBUG=1):56 passed, 0 failed, 1 ignoredmain-based checkout (upstreammaindoes not yet have an adapter-selection env var).