runtime: bind four-channel and half4 texture UAVs on the native compute route #3398
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3398"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T20:24:05Z.
Change
Takes over #3049 (sydney-0o, co-author), which carried #2975 and #2993, onto current
main. Relative tomain:X2W_NATIVE_SHADERS): four-channel float texture UAVs in 1D, 2D and 2D-array (3D was already bound) and packed half4 texture UAVs in 1D, 2D, 2D-array and 3D, next tomain's exact-width channels (#3243). Exact-width kinds outside 2D, 2D-array and 3D are now refused instead of bound as 2D. Native 2D texture inputs now setsrv_dimension, whichmainadded in #3306 and which defaults to unknown.texture_uavandhalf4_texture_uavat dimension 0 now publishtex1d, andhalf4_texture_uavat dimension 2 publishestex3d, with four channels; other dimensions refuse with #3268's reason, as onmain.revision.txtin the cache; the newstartup_compute_dispatch_texture_native_(warp|hardware)runs the 1D and 3D cases throughcompile_dxil, and new native cases cover a scalar-buffer plus 2D-texture input feeding a 3D store, a sampler control, zero-W, 1D, 2D-array and half4 2D.Refs #3049, #2975, #2993, #2974.
Verification
Windows Sandbox, network off, release build of
11e1a06donmain8ecd30fe(the headdfd8cb2chas the same tree; only the commit message changed). Adapters: NVIDIA GeForce RTX 5080, driver 32.0.16.2101 (shader model 6.6, wave32), and WARP 10.0.26100.9818 (no wave32).15 pass and 2 skip (77): on WARP
startup_compute_dispatch_native_warpandstartup_compute_dispatch_texture_native_warpexit 77 after checking the named capability refusal.Mutants, each applied alone, rebuilt and run with the same suite:
case 0: tex = "tex1d"→"tex2d":native_compute_manifest_reasons,startup_compute_dispatch_texture_native_hardwareand_warpfail.case 2: tex = "tex3d"→"tex2d": the same three fail.case 0(1D UAV) dropped:startup_compute_dispatch_native_hardwareand_warpfail.srv_dimensionassignment dropped:startup_compute_dispatch_native_hardwarefails.texture_inputaccepting any SRV dimension: not caught.Evidence and follow-up
Fixtures are source-built with the same generators as the existing dispatch checks. Not covered: a refusal case for a non-2D texture SRV on the in-process route; in-process fixtures for four-channel float 2D and half4 1D, 2D-array and 3D; manifest lines for
half4_texture_uavat dimensions 0 and 2; thecopy_tokenpath for descriptor increments above 32 bytes, which is not exercised if both adapters report 32 (not logged). The matched original-program comparison asked for in #3049 (same cache and inputs, with and without this branch) is next.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T20:33:45Z.
Review: APPROVED
LGTM — clean, well-tested.
Adds 1D, 2D, 2D-array, and 3D four-channel float / half4 texture UAV support to the native compute dispatch path. Manifest formatter emits tex1d/tex2d/tex3d/tex2da lines; dispatch stub resolves dimensions, validates UAV shape, and checks format support. New adapter capability helpers (wave32, shader model 6.6) with descriptive refusal messages. Test fixture covers table views with volume inputs, sampler/zero-WSize controls, and texture outputs (line, array, packed D16). Docs updated throughout.
Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:02:30Z.
Review: APPROVED
LGTM — clean extension of the native compute dispatch path with proper capability checks.
Binds 1D, 2D, 2D-array, and 3D four-channel float and half4 texture UAVs in the in-process route. Manifest formatter now emits tex1d/tex2d/tex3d/tex2da with a switch over image_dimension. Capability checks (adapter_32_lane_waves, adapter_reports_shader_model_below_6_6) are factored out with better refusal messages for published PSO failures.
Table views fixture exercises volume with texture input, sampler control, and zero-WSize control. Texture outputs cover 1D float, 2D-array float, and packed D16 stores. Consumer supports packed guest tables with descriptor increment. Documentation updated accurately.
Ready to land.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:12:09Z.
Review: APPROVED
LGTM — expands native compute to bind 2D texture inputs and four-channel float / packed half4 texture outputs (1D, 2D, 2D-array, 3D).
Manifest formatter now uses a switch for UAV dimension names instead of the inline ternary. Runtime reader handles tex1d/tex2d/tex2da/tex3d float channels 4. In-process path binds 2D texture SRV inputs, four-channel and exact-width float UAV outputs with proper dimension mapping, and checks shader model 6.6 + wave32 via extracted helper functions. Pipeline creation failure appends adapter capability notes.
New test fixture covers table views (volume with texture input, sampler control, zero WSize), texture outputs (1D float, 2D-array float, packed D16), and capability refusals. Manifest reasons test verifies all dimension/channel combinations.
Documentation updated for the expanded binding set and new fixture.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-28T21:56:45Z.
Review: APPROVED
LGTM — expands native compute to bind 2D texture inputs and four-channel float / packed half4 texture outputs (1D, 2D, 2D-array, 3D).
Manifest formatter now uses a switch for UAV dimension names instead of the inline ternary. Runtime reader handles tex1d/tex2d/tex2da/tex3d float channels 4. In-process path binds 2D texture SRV inputs, four-channel and exact-width float UAV outputs with proper dimension mapping, and checks shader model 6.6 + wave32 via extracted helper functions. Pipeline creation failure appends adapter capability notes.
New test fixture covers table views (volume with texture input, sampler control, zero WSize), texture outputs (1D float, 2D-array float, packed D16), and capability refusals. Manifest reasons test verifies all dimension/channel combinations.
Documentation updated for the expanded binding set and new fixture.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T21:57:50Z.
Review: COMMENTED
Windows check of head
dfd8cb2c(dev and release,--regex 'compute_dispatch_(native|texture)|native_compute_manifest_reasons|startup_stream_consumer'): 4 of 10 selected tests failed. Two of them (startup_compute_dispatch_native_warpand_hardware) also fail on current main without this PR, so they are not caused by it. The twotexture_nativefailures remain.startup_compute_dispatch_texture_native_warpandstartup_compute_dispatch_texture_native_hardware:AssertionError: ('volume', 64)fromtests/startup_compute_dispatch_texture_check.pyline 612.startup_compute_dispatch_native_warpandstartup_compute_dispatch_native_hardware:AssertionError: word=0 got=c5c5c5c5 expected=00000400 (288 words differ)intests/startup_compute_dispatch_native_check.py.native_compute_manifest_reasonspassed.Please check these three on a fresh build of the head. We did not compare against main for this report.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T12:40:43Z.
Re-review of head
59f60121againstmain77d1ba4d.git merge-tree --write-tree origin/main 59f60121exits 0, and none of the 53maincommits since the merge-base touches the runtime files. The source diff reads correctly against the repo'sComputeViewKindenum. Kind 3 istexture_uav.mainbinds it natively only at dimension 2, and that is why "view kind 3 is not bound for a natively translated program" shows up in start-up runs. The 0/1/2/5 → TEXTURE1D/2D/3D/2DARRAY switch fixes that. The formatter keeps the #3268 reason (default: return refuse(view_shape("UAV", b));). Exact-width kinds at dimension 0 are now refused instead of being bound as 2D, which matches the published writer.MUST
dfd8cb2cis still unanswered.startup_compute_dispatch_texture_native_{warp,hardware}failed there withAssertionError: ('volume', 64), raised byassert got == expectedinstore_3d1dafterDispatch(2, 1, 1) translated. That code is unchanged at the head: per file,git diff 8ecd30fe dfd8cb2c -- tests/startup_compute_dispatch_texture_check.py | git patch-idequalsgit diff 740ffdf1 1bb1c859 -- <same file> | git patch-id. On that WARP the pipeline was created, so the capability skip did not fire and 64 words were wrong. Could you runctest -R '^startup_compute_dispatch_texture_native_(warp|hardware)$' -Von the head and post the result? If you can't reproduce it, please name the adapter or WARP difference. If the WARP build in that report has 32-lane waves, it would explain why the skip didn't fire, but it would not explain the wrong words.SHOULD
1990fead),run.shandrun.ps1setX2W_NATIVE_SHADERSandX2W_NATIVE_SHADERS_ONLY=1by default, andload_compute_translationreturns early atif (native_shaders_only()) {. So the default path never runs the published-route wave and shader-model notes this PR adds.store_3d1dalso clears the variable (env.pop('X2W_NATIVE_SHADERS', None)), sotexture_nativetests the published route. The default route is the new switch intranslate_compute_natively, and onlystartup_compute_dispatch_native_*covers it. In the same report, that test failed onmaintoo (word=0 got=c5c5c5c5). Could you say whetherstartup_compute_dispatch_native_hardwarepasses on currentmainplus this head? A short note in the body on which route each new test exercises would help as well.NIT
adapter_reports_shader_model_below_6_6()returns false whenCheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL)fails. A runtime that does not know 6.6 returnsE_INVALIDARG, so the named refusal is skipped and a generic PSO failure follows. This is harmless, but the comment could say so.Merge order for this group: #2975 and #2993 are closed in favour of this PR. This PR carries #3049 as well. #3386, then #3397, merge cleanly after it once they resolve their own
mainconflict (identity_dst_sel). Adding this PR first leaves that conflict at 1 hunk per file, the same count as onmainalone.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T13:18:02Z.
Re: re-review of
59f60121.1 and 2: run on the head plus current
main.59f60121merged withmainc04e0dd6(no conflict),devpreset with-DX2W_WITH_OPUS=OFF, one command per test:startup_compute_dispatch_native_hardwarenative table views: volume words match, and the sampler and zero WSize controls leave them untouched;native texture-line: all 128 output values match;native texture-array: all 6144 ...;native texture-store: all 1024 ...startup_compute_dispatch_native_warpSKIP on warp (not translated natively: the adapter has no 32-lane waves)startup_compute_dispatch_texture_native_hardwareline: 128 mip-one words match;volume: 6144 ...;volume-nsa: 6144 ...startup_compute_dispatch_texture_native_warpline,volume,volume-nsa:native DXIL and manifest verified; dispatch skipped (adapter has no 32-lane waves)startup_compute_dispatch_native_hardwarepasses onmainc04e0dd6plus this head, on a hardware adapter. Theword=0 got=c5c5c5c5failure does not reproduce there.('volume', 64)does not reproduce on the hardware adapter:texture_native_hardwarematches all 6144 volume words._warplegs are capability skips, not passes. The WARP here is the inbox one and reports no 32-lane waves, so the pipeline is never created. This run is no evidence for a WARP that has 32-lane waves, which is the configuration where the report shows the pipeline created and 64 words wrong. I can't reproduce that case here.2: route per test (paths at
59f60121):startup_compute_dispatch_native_*(tests/startup_compute_dispatch_native_check.py): in-process route. Each case setsX2W_NATIVE_SHADERS(:98,:173,:249,:303,:349). The new casestable_views(:247) andtexture_outputs(:301) asserttranslated natively: ...(:273,:334) and that nothing is published to the cache (:284-286,:339-341). These are the cases that reach the new dimension switch intranslate_compute_natively(src/startup_stubs/d3d12_compute_dispatch.inl:316).X2W_NATIVE_SHADERS_ONLY=1is set only inscalar_window_case(:98) and the final read-write dispatch (:416), not in the two new cases, so they match the launcher default in the translation route but not in that variable.startup_compute_dispatch_texture_native_*(tests/startup_compute_dispatch_texture_check.py, registered atCMakeLists.txt:4971): offline/published route, as you read it.store_3d1dremovesX2W_NATIVE_SHADERS(:241), runscompile_dxil ... --requests(:270), checks theuav 0 tex1d|tex3d float table 1 64 channels 4manifest line (:275-277), and the stand-in then loads<key>.txtand.cs.csothroughload_compute_translation(d3d12_compute_dispatch.inl:143). It covers the formatter'stex1d/tex3dlines and the PSO-failure capability notes (:280-286), and does not run underX2W_NATIVE_SHADERS_ONLY.I can add this route note to the PR body if that is the form you want.
Not addressed in this reply: NIT 3 and 4.
Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-29T13:35:34Z.
Re-review of head
59f60121after the 13:18 reply (read only, on Linux; no build or run here).git merge-tree --write-tree origin/main(17b662a2) 59f60121exits 0. Main's two newer commits ind3d12_compute_dispatch.inlanddirect_compute_cache.cpp(d13a3353,297f260e) add the separatepacked_d16_xkind and don't touch the texture-UAV dimension switch. CI is green at head.Resolved
('volume', 64)report): you posted a fresh run of this head merged withc04e0dd6.startup_compute_dispatch_texture_native_hardwarematches all 6144 volume words, andstartup_compute_dispatch_native_hardwarepasses too. The report atdfd8cb2calso hadstartup_compute_dispatch_native_*failing onmainwithout this PR (word=0 got=c5c5c5c5, output untouched). So that environment failed outside this change as well, and the hardware result doesn't reproduce on a fresh build.texture_nativecovers the published route throughload_compute_translation. The newtable_viewsandtexture_outputscases instartup_compute_dispatch_native_check.pyreach the dimension switch intranslate_compute_nativelyon the in-process route. Adding the route note to the body would help, but it doesn't block.Still open, not blocking
_warplegs here are capability skips (77), not passes. If a report from that configuration comes in, it needs its own issue.0 MUST, mergeable, no change request. Merging.
AI-assisted.