shader: size queries of writable images read their size, not 0 #247
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!247
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-247"
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?
@marcus-4 on GitHub · 2026-11-27 04:34 UTC · original
marcus-4:fix/uav-size-query-level→main· +126 −6 · 3 files · 1 commits · merged 2026-11-27 04:56 UTCWhat this changes
A program that asks a writable image (UAV) for its size gets 0x0 on the native host.
image_get_resinfoon a UAV wrote the query's level as DXIL's undefined value, as DXC does for anRWTexture, and Metal through the Shader Converter answers that with 0. Sizes the host rebuilds into an image descriptor's own dwords (Lower::descriptor_data, when a program reads a width or height from the descriptor's bits instead of querying it) came from the same query and read 0 too.Under Wine, D3DMetal's same answer gave the title's sun-shadow min/max program (
07f451a14b13fecb) a 0x0 image, so whole 16x16 tiles were lit or shadowed together (halfwave50/VIctory-macOS-halfwave50@0f3ed38, opt-in per program there). This is the native-host side of it. It will only show once the lighting compute translates (#182).image_get_resinfotakes the level in the program's first address for every image, as it already did for SRVs. Level 0 is the view's own size.How it was tested
New GPU test
heap_tests::a_size_query_of_a_writable_image_reads_its_size. A hand-assembled program queries a 16x8 texture UAV declared in a table (metadata kind 3) and reads its height from the descriptor's bits, on Metal. Writable-ness comes from that table record; animage_storealone on a heap-loaded descriptor does not make it a UAV, which a control run showed.main[0, 0, 16383][16, 8, 16383][16, 8, 7]M1 Pro, 16 GB, macOS 27.2.1, Xcode 27.2, Metal Shader Converter 4.0.3, Homebrew
llvm/lld23.1.6 andmingw-w6414.0.0, at3b7bc7a:cargo test --target x86_64-apple-darwin -p victory-hle -p victory-loader -p victory: 378 passed, 1 failed, 4 ignored. All native probe tests pass. The one failure isvictory-loadermalformed_relocations_return_error_and_release_mapping, which fails only under parallel load (onmaintoo) and passes alone.victory-hle,victory,victory-gpu,xtask,victory-shader,victory-metal,victory-platform,victory-loader,victory-formats,victory-backend,victory-core): 929 passed, 1 failed, 13 ignored. The one failure istexture_tests::a_texture_rewritten_whole_is_read_whole_only_now_and_then, which likewise fails only under parallel load, onmaintoo, and passes alone.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings: clean.cargo xtask policy: 369 files ok.Checklist
VICTORY_*variable and documented (none added)@LakshanSivakumar on GitHub · 2026-11-27 04:56 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!