cpp-migration: bind table buffers, 2D texture SRVs and 3D/1D texture UAVs for natively translated compute #2974
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#2974
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?
@Leyukaka on GitHub · 2026-11-27 00:51 UTC · original
Target branch
cpp-migration. Part of #2935 (follow-up to #2934/#2958). I am taking this; please say if you already have it locally and I will drop it.Observation. I ran a local start-up capture on
cpp-migrationb260984fwithrun.ps1 -NativeShadersand kept the Python translator as the fallback. The title then does not get past its first screen. Onmainplus #2902, the same inputs get past it. One per-frame compute pipeline accounts for the difference: it was dispatched 17,408 times in that run and never translated. Its views are two table buffers, a 2D texture SRV and a 3D float texture UAV:compile_dxilproduces the DXIL), but three things stop it from reaching a Dispatch. I checked them at2b678fd3:translate_compute_nativelybinds onlyraw_vector_srvandraw_buffer_uav. It refuses this program with "view kind 0 is not bound for a natively translated program".format_compute_runtime_manifestaccepts atexture_uavonly with image dimension 1 (2D) or 5 (2D array), socompile_dxilwrites no manifest for it.tex3d/tex1dUAV line, and Dispatch refuses any output view that is notTEXTURE2D/TEXTURE2DARRAY.main, the runtime half of #2902 adds 3D and 1D UAV binding: the manifest line, the view dimension, and mip and W range checks (also in slot 19,d3d12_xs_device.cpp).cpp-migrationdoes not have it.Plan, best as two pull requests:
cpp-migration, with itsstartup_stream_consumer.cppmodes (volume, line, bad W, bad mip). The runtime hunks are taken unchanged from #2902, which is open onmain, so a later merge ofmainis a no-op there. If you would rather wait for #2902 to merge and reachcpp-migration, say so and I will do only steps 2 and 3.format_compute_runtime_manifestwrites the 3D and 1Dtexture_uavlines that the reader then accepts.translate_compute_nativelyto fill the sameComputeTranslationslots the manifest reader fills, without usingNativeRecording/NativeDispatchStates:buffer_srvmaps to the samebuf tableslot thatformat_compute_runtime_manifestalready writes for it;texture_srv(2D) andtexture_uav(2D, 2D array, 3D, 1D);Tests:
startup_compute_dispatch_native_check.pywith a source-built program that reads a table buffer and a 2D texture and stores to a 3D UAV, compared with a CPU reference.Measurement: the same start-up run before and after, with dispatch and translation counts for that pipeline and whether the title gets past its first screen.
AI-assisted.
@Leyukaka on GitHub · 2026-11-27 02:06 UTC · original
Correction to the observation above. (All the runs below also carried #2862, merged locally.)
I wrote that on
mainplus #2902 "the same inputs" get past the first screen. They were not the same inputs.cpp-migrationwith the per-frame pipeline compiled bycompile_dxil. The other was oncpp-migrationplus #2902 with the Python translator only and no C++ translation. Both stay on the first screen in the same way: no input before the script starts, and the same three compute pipelines dispatched for the whole run (the earlier run dispatched 952).What still holds:
cpp-migrationb260984fwithout these bindings.compile_dxil, it is translated and dispatched. In the later run it was dispatched about 17,400 times, all translated.Parts 1 and 2 are unchanged in scope. I have updated the matching sentence in #2975.
AI-assisted.
@sydney-0o on GitHub · 2026-11-27 11:29 UTC · original
PR #3049 combines the remaining native compute binding work from #2975 and #2993 on
main, which already contains #2902. The native offline manifest and first-Dispatch fixtures both passed on a GTX 1080 Ti (driver32.0.15.8278, Windows build 19045, app-local Agility SDK 1.620.2). The separate startup before/after measurement remains open.