Repository navigation
Conversation
…B5 has no storage
A B5G5R5A1_UNORM texture with ALLOW_UNORDERED_ACCESS was refused on a GPU whose
VK_FORMAT_A1R5G5B5_UNORM_PACK16 has no STORAGE_IMAGE (NVIDIA): GetResourceAllocationInfo answered
UINT64_MAX and creation failed. A title's boot creates a 2560x1440 render-target + UAV one and
asserts on that size.
The R9G9B9E5 route generalizes: Format::r9g9b9e5_as_r32_uint becomes Format::uint_backed, the format
a UAV texture stored as a mutable unsigned image is viewed in (E5B9G9R9 for R32_UINT, A1R5G5B5 for
R16_UINT). For B5G5R5A1 the image is R16_UINT with {R16_UINT, A1R5G5B5} listed; its storage view is
R16_UINT in the uint class, SRVs are A1R5G5B5 sampled views, and RTVs and clears go through an
A1R5G5B5 attachment view (ResourceBinding::uint_backed lets replay's color_view_format take it). The
SRV and UAV T#s keep the 1_5_5_5_UNORM format. A shader store still needs the translator to pack
the bits for that view, so CheckFeatureSupport does not advertise the typed UAV yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent check of
|
|
Independent Windows + GPU test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
AI-assisted Wine 11.22 test, RTX 4070/NVIDIA 620.73.04. I adapted 0dc7f58 onto a local boot stack with #7403. The synthetic test passed allocation, creation, clear readback and descriptor checks (validation unavailable in this Wine sandbox). In the boot A/B, the packed color allocation went from invalid to valid. The next depth-stencil + UAV allocation is refused at the same assertion. |
|
Tested
AI-assisted. |
|
Tested
AI-assisted (Claude Code); outcomes only, no game data. |
|
Tested |
|
I claimed the translator-side follow-up as SHADER-1202 in #8504. For descriptor FORMAT 134, I’m planning to pack the normalized store into the R16_UINT view while leaving sampled reads on the A1R5G5B5 view. The current backing selection looks conditional on lack of native A1R5G5B5 storage. Would you prefer always selecting the uint view for FORMAT 134 storage when the paired views are supported, or identifying the backing explicitly in the translator’s resource metadata? I’ll keep this out of your device-side PR. No game data. AI-assisted (Codex). |
|
Confirmed this is not hypothetical: RADV 26.2.6 on the Ryzen 7 9800X3D iGPU reports native optimal-tiling STORAGE_IMAGE and COLOR_ATTACHMENT for A1R5G5B5_UNORM_PACK16; RTX 5080 lacks the storage bit. Draft #8710 is intentionally not ready to merge until both paths agree on the storage class. No game data. AI-assisted (Codex). |
|
Independent Windows 11 result on an RTX 4090 (driver 32.0.16.1656, MSVC 19.44.35228, RelWithDebInfo). I compared ASTROWwwW's
Same package and shader indexes for both runs, with Xbox and Rockstar services inaccessible in the test process. Counts and API names only. AI-assisted. |
|
Tested
Synthetic tests only, no game files. AI-assisted (Claude Code). |
…storage view Where VK_FORMAT_A1R5G5B5_UNORM_PACK16 has no storage support the D3D12 layer backs a B5G5R5A1_UNORM UAV texture with a mutable R16_UINT image whose storage view is in the uint class, and its T# keeps FORMAT 134 (ItsNotRexed#7604). A translated image_store picked the float view for that format, which is then the fallback, so the store was lost. The T# does not say which image is behind it, so an image_store whose FORMAT is 134 at run time now stores twice at the same index: the float texel through the float view as before (the image itself on a GPU that stores A1R5G5B5), then the texel packed through the uint view. The view the runtime did not bind is the 1x1 fallback, as on a lookup miss. The word has the A1R5G5B5 layout (component 0 in bits 14:10, 1 in 9:5, 2 in 4:0, 3 in bit 15), each channel clamped to [0, 1] with NMax/NMin (a NaN is 0) and rounded to nearest. Other formats keep their single store. - tests/semantic/test_image_store_1555.py runs the fixture image_store_1555.asm in spirv_mini_interp, which gains OpImageWrite on bound storage images. 8 of its 9 tests fail on the translator before this change. - test_image_coherent, test_image_cube_store_glc and test_image_store_dmask count the writes of an image_store and now expect the packed one. - runtime/test/d3d12_b5g5r5a1_store_test dispatches cs_b5g5r5a1_store.asm through the layer and reads 256 texels back as packed 16-bit values (RTX 4090, validation layer, 0 errors; 248 texels differ with the translator before this change). - docs/design.md: contract row "Packed 1_5_5_5 image stores". Depends on: ItsNotRexed#7604 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit ef3eca6)
|
Retail measurement: this PR clears the repeating soft assert on NVIDIA. RTX 5070 Ti, 621.01, own 1.0.2.1 copy, base
Details: #7154 (comment) and the line after it. AI-assisted. |
Claimed in #7599 (comment)
Depends on: none (based on main).
What
On a GPU whose
VK_FORMAT_A1R5G5B5_UNORM_PACK16has noSTORAGE_IMAGEsupport (an RTX 5090 here), aB5G5R5A1_UNORMtexture withALLOW_UNORDERED_ACCESSis now a mutableVK_FORMAT_R16_UINTimage with{R16_UINT, A1R5G5B5_UNORM_PACK16}in its format list, instead of being refused.Format::r9g9b9e5_as_r32_uintbecomesFormat::uint_backed, the format a UAV texture stored as a mutable unsigned image is viewed in (E5B9G9R9forR32_UINT,A1R5G5B5forR16_UINT).probe_r9g9b9e5_uav_emulationbecomesprobe_uint_backed_uav(logical, backing), used for both. R9G9B9E5 behaves as before.R16_UINTin the uint class. SRVs areA1R5G5B5sampled views. Unlike R9G9B9E5, render targets are kept: RTVs and clears go through anA1R5G5B5attachment view, andResourceBinding::uint_backedlets replay'scolor_view_formattake that format.1_5_5_5_UNORM(134), not16_UINT.CheckFeatureSupportdoesn't advertise the typed UAV yet: a shader store through this view needs the translator to pack the 5-5-5-1 bits, which is a follow-up.Why
The retail boot under
LEONIDA_D3D12=vulkanasks device slot 25 for the size of a 2560×1440B5G5R5A1_UNORMtexture withALLOW_RENDER_TARGET | ALLOW_UNORDERED_ACCESS, and asserts when the answer isUINT64_MAX. The layer refused it because the image would need storage usage in a format this GPU can't store to. Measured on my copy; reported on #7333.Tested
Windows 11, MSVC 2022 (14.44, RelWithDebInfo, Ninja), RTX 5090, Vulkan SDK 1.4.363.0:
d3d12_b5g5r5a1_uav_test, run withLEONIDA_VK_VALIDATION=1: OK, 0 validation errors. It checks the following:ClearRenderTargetViews (whole view red, a rectangle green) read back as packed0xFC00/0x03E0texels.A1R5G5B5storage, or withoutR16_UINTstorage orA1R5G5B5sampling and attachment.d3d12_r9g9b9e5_uav_test(with validation, 0 errors),d3d12_uav_clear_test,d3d12_descriptor_testandd3d12_clear_testpass.d3d12_vulkan_device_testexits 1 here with and without this change (itsB5G5R5A1_UNORMcopy case matches the host).AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code