Repository navigation
Conversation
…_maintenance5) The retail title's first native pipelines name an A8_UNORM render target (@KkelebekK's RT-5 measurements). The layer stored every A8_UNORM texture as R8_UNORM with a swizzled SRV and refused render targets. Where the GPU has VK_KHR_maintenance5 and can sample VK_FORMAT_A8_UNORM_KHR and blend it as a colour attachment, gta6rt enables the extension and its feature (VulkanDeviceInfo::a8_render_target), and an A8_UNORM texture created with ALLOW_RENDER_TARGET is stored in that format: - its RTVs and the PSO's RTVFormats use it, so draws, blends and clears write the alpha channel (the clear quantizes alpha like the other UNORM formats); - its SRVs view the image in the same format. Vulkan puts A8 in a compatibility class of its own, so it cannot share an image with an R8 view: gfx10's format table gains an 8_UNORM row for it whose one channel X is alpha (channels_a), and the T#'s (0, 0, 0, X) becomes (ZERO, ZERO, ZERO, A) on that view; - CheckFeatureSupport adds RENDER_TARGET and BLENDABLE for A8_UNORM; - the copy paths know its one-byte texel. Other A8_UNORM textures stay R8_UNORM, and devices without the format refuse A8 render targets as before. Depth-stencil and UAV stay refused. Tests (both on an RTX 3060 and an Intel UHD 750, with Vulkan validation): - d3d12_clear_formats: A8_UNORM joins the WARP comparison (was "not exposed"); - d3d12_descriptor_test: format support and creation follow the device; an A8 render target's default and remapped SRVs sample like the R8-backed ones; - d3d12_draw_test: a full-screen draw and two alpha blends into an A8 target; - gfx10_descriptors_test: the A8 row and its view mapping. vk_test_device.h enables maintenance5 like gta6rt, so the whole suite runs with it: ctest gives the same failures as main on both GPUs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows + GPU test of Setup: Windows 11 x64, MSVC 19.44.35220 (
AI-assisted review/test. |
|
Independent native Windows 11 dual-GPU review of Environment
Results (
|
|
Retail A/B on CachyOS / Wine 11.22, RTX 4070 (620.73.04), runtime delta from |
…th older Vulkan headers KarolKurzyna found two header gaps on ItsNotRexed#7403. VK_KHR_maintenance5 was added to the device extensions inside the maintenance8 #ifdef, so headers with maintenance5 but not maintenance8 (1.3.262 to 1.4.305) chained its feature without enabling the extension; the two #ifdefs are now separate. texture_format and the PSO named VK_FORMAT_A8_UNORM_KHR unguarded; they now use kA8UnormFormat, which is UNDEFINED (and never used, since a8_render_target stays false) without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @MartinIndra02 and @KarolKurzyna. Both of KarolKurzyna's header findings were real, fixed in |
|
Thanks @jlric, that matches what this PR targets: the A8_UNORM refusal and the breakpoint behind it. The remaining resource-state breakpoint comes from a different path, and this PR doesn't touch it. |
|
Windows GPU check on AMD: Radeon RX 9060 XT, driver 32.0.32015.7029, Windows 11 x64, MSVC 14.44, RelWithDebInfo, Vulkan SDK 1.4.363.0, All four touched targets pass on the AMD driver, exit 0 each:
Third-vendor confirmation (after RTX 3060 and UHD 750) that |
|
Tested on the retail executable: pass. Windows 11, i7-14700K, RTX 4070 SUPER, MSVC RelWithDebInfo, |
|
Thanks @byPreaZy and @jacksonslab. That's three vendors now (NVIDIA, Intel, AMD RDNA) plus the retail slot-25 size assert gone on an RTX 4070 SUPER. |
tupacfan04
left a comment
There was a problem hiding this comment.
The retail A8 path is confirmed on three vendors, but the pCastableFormats path still has a real defect.
-
An A8 RT’s own format is rejected.
vulkan_format()has noDXGI_FORMAT_A8_UNORMcase (d3d12_vulkan_device.cpp:270-377), andcastable_view_formats()calls it at:1404. SyntheticCreateCommittedResource3(..., castable={DXGI_FORMAT_A8_UNORM}, ...)returnsE_INVALIDARGwithcastable format not supported yet: 65, before any Vulkan image. The resource’s own format should be a no-op;create_texture()even documents that own-format views are always allowed (:2018). -
An R8 castable list is passed into an A8 image.
castable={DXGI_FORMAT_R8_UNORM}maps toVK_FORMAT_R8_UNORM, passes the 1-byte block-size check (:1409-1413), and is added to the A8 image’sVkImageFormatListCreateInfo(:2020-2033). A8 and R8 are not compatible Vulkan classes (the PR’s own comment at:248-251), sovkCreateImagefails or validation reports it. Reject it cleanly before Vulkan. -
No A8 castable test.
d3d12_draw_test.cpp:1010-1057covers castable lists only for RGBA8/BGRA8; the A8 descriptor/clear tests use the legacyCreateCommittedResourcepath. Addcastable={A8_UNORM}and{R8_UNORM}cases: own A8 succeeds; R8 is cleanly rejected or supported, never passed as an A8 image’s view format.
Secondary: a8_render_target at :9235-9246 does not include TRANSFER_SRC/DST, while TextureCreateInfo always requests transfer usage (:520). A device with A8 sample/color/blend but no transfer can advertise RENDER_TARGET while copies fail. Require transfer in the gate or report the intersection.
#7403 has the A8 PSO/draw/clear coverage and avoids the #7593 image_descriptor R8-alias bug; #7593 can be closed in its favour. Synthetic only; no game files. AI-assisted (OpenCode).
…efuses the others
castable_view_formats() mapped every castable format through vulkan_format(), which has no
A8_UNORM case, so CreateCommittedResource3/CreatePlacedResource2 with castable={A8_UNORM}
failed with E_INVALIDARG ("castable format not supported yet: 65"). The resource's own format
is always viewable (create_texture adds the image's format), so naming A8_UNORM on an A8
texture is now a no-op.
An A8 render target's VK_FORMAT_A8_UNORM_KHR image is in a compatibility class of its own,
so an R8_UNORM castable entry (same texel size) would have reached its
VkImageFormatListCreateInfo. Any format other than A8_UNORM is now refused with E_INVALIDARG
before Vulkan.
The A8 gate (runtime and vk_test_device.h) also requires TRANSFER_SRC/DST, since every
texture is created with transfer usage.
d3d12_draw_test runs the A8 clear/draw/blend cases on a second target made through
CreateCommittedResource3 with castable={A8_UNORM}, and checks castable={R8_UNORM} returns
E_INVALIDARG. Without the shim change it fails with the reported message.
Reported by tupacfan04 on ItsNotRexed#7403.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @tupacfan04, all four were real. Fixed in
Ran with
AI-assisted (Claude Code). |
|
Found a gap in the sampled (non-render-target) A8 form while running the retail 1.0.2.1 boot on AMD (RX 7900 XTX, the 26-PR boot stack): the title sizes a 2D 128x1 Reading the current head: the RT branch returns the maintenance5 alpha image, but a flags-0 A8 falls through to the second A8 check and on to the tail — and on this run the fall-through refused it (the desc passes every written guard, so whatever refuses it is below the visible checks). The fix that works here is the one the code's own comment already documents ("A8_UNORM is an R8_UNORM image in 1D, 2D and 3D, as the host makes all three"): return The second refused desc in the same batch differs only in Formats, dimensions and counts only; no game data. AI-assisted. |
…t 64 KiB and 4 KiB alignment The shape bobcatchris reports from the retail boot on ItsNotRexed#7403 (2D 128x1, no flags, one sample, the full mip chain), with Alignment 0 and 4096. On this head it takes texture_format's existing path (an R8 image, as on main) and GetResourceAllocationInfo sizes it at the default 64 KiB and the 4 KiB small-resource alignment. Passes on an RTX 3060 and a UHD 750 with Vulkan validation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @bobcatchris. I couldn't reproduce this on the PR head, so I added your shape as a test ( On this head a non-RT A8 2D texture falls through So the refusal you see probably comes from another PR in the 26-PR stack, or from a field I haven't matched. Could you post the exact description from the refused call: |
|
A41 Windows reference measurements for the dimensional guard at On the RTX 4070 Ti SUPER (617.14, Vulkan 1.4.351), |
|
Thanks @akimfomin, useful references. The 2D-only guard for sampled A8 is |
|
checked: #7403 | with: merge of PR head onto main, then
AI-assisted. |
|
checked: #7403 | with: merge of PR head onto main, then
agent: yes |
|
checked: #740314a459b | with: merged onto main@867d922f0 (clean, 11 files, +345/-23), cmake -DLEONIDA_VULKAN_HEADERS_FETCH=ON, ctest -R "^(d3d12_clear_formats|d3d12_descriptor|d3d12_draw|gfx10_descriptors)$", tests/test_gfx10_descriptors.py, check_no_game_data.py | on: Windows 11, MSVC 19.51.36263.0, AMD Radeon RX 9060 XT (26.11.2) | result: pass (4/4 ctest targets + 5/5 Python tests passed; agent: yes |
d3d12: A8_UNORM render targets through VK_FORMAT_A8_UNORM_KHR (VK_KHR_maintenance5) Fork integration. AI-assisted (Codex).
|
checked: #740314a459b | with: head-vs-forge-main comparison of the Import status:
Runs (base
Audit: agent: yes |
|
checked: #7403 | with: applied the diff on main 6312c05, built d3d12_clear_formats_test, d3d12_descriptor_test, d3d12_draw_test, gfx10_descriptors_test (MSVC 14.44, Ninja RelWithDebInfo) | on: Windows 11, AMD Radeon RX 9060 XT (RDNA4) | result: PASS, first AMD check of this PR
The RX 9060 XT exposes VK_FORMAT_A8_UNORM_KHR with colour attachment and blend, so the maintenance5 path is confirmed on RDNA4, the GPU family this port targets. AI-assisted check. |
…VK_FORMAT_A8_UNORM_KHR (VK_KHR_maintenance5) Squashed from ItsNotRexed#7403 by mrp1no, head 18b0bfb (security scan PASS). Conflict in vk_test_device.h only: the test device enables both VK_EXT_external_memory_host (ItsNotRexed#7218) and VK_KHR_maintenance5 (this PR) when asked.
…as the host makes them Squashed from ItsNotRexed#7755 by NiiRoZz, head 952be9b (security scan PASS). Conflict with ItsNotRexed#7403 in texture_format: A8_UNORM takes 1D, 2D and 3D as this PR does, and a render target stays 2D only through ItsNotRexed#7403's VK_FORMAT_A8_UNORM_KHR path; depth-stencil and UAV flags and multisampling are refused as before.
Claimed in the coordination issue: #7049 (comment) (new D3D item from @KkelebekK's RT-5 finding, #7049 (comment))
What and why
The retail title's first native pipelines name an
A8_UNORMrender target. The layer stored everyA8_UNORMtexture asR8_UNORMwith a swizzled SRV, and refused render targets.Where the GPU has
VK_KHR_maintenance5and can sampleVK_FORMAT_A8_UNORM_KHRand blend it as a colour attachment,gta6rtnow enables the extension and its feature (VulkanDeviceInfo::a8_render_target). AnA8_UNORMtexture created withALLOW_RENDER_TARGETis then stored in that format:RTVFormatsuse it, so draws, blends and clears write the alpha channel. The clear quantizes alpha like the other UNORM formats.gfx10_descriptors.h's format table therefore gains an8_UNORMrow for it whose one channel X is alpha (channels_a), and the T#'s (0, 0, 0, X) becomes (ZERO, ZERO, ZERO, A) on that view.CheckFeatureSupportaddsRENDER_TARGETandBLENDABLEforA8_UNORM.Other
A8_UNORMtextures stayR8_UNORM, and devices without the format refuse A8 render targets as before. Depth-stencil and UAV stay refused.docs/d3d12_vulkan.mdsays all of this.Tested
Windows 11, MSVC RelWithDebInfo, base
main8575d36e, on an NVIDIA RTX 3060 (610.88) and an Intel UHD Graphics 750 (32.0.101.7088). Both reportA8_UNORMwith colour attachment, blend and storage. All withLEONIDA_VK_VALIDATION=1, no validation messages:d3d12_clear_formats:A8_UNORMjoins the byte-for-byte WARP comparison (it was "not exposed"). All 5 cases match on both GPUs (256/256 on NVIDIA).d3d12_descriptor_test: format support and creation now follow the device. An A8 render target filled throughCopyTextureRegionis sampled through its default and remapped SRVs: 64/64 texels each, the same as the R8-backed A8 texture.d3d12_draw_test: a full-screen draw into an A8 target cleared to 0.25, then two alpha blends (ZERO, ONEkeeps 64;INV_DEST_ALPHA, ZEROgives 191). All 16 texels match.gfx10_descriptors_test: the A8 row, its8_UNORMcode and its view mapping.ctestsuite:vk_test_device.hnow enables maintenance5 the waygta6rtdoes, so the whole suite runs with it. It gives the same failures asmainbuilt at the same commit: NVIDIA 3 (d3d12_vulkan_device,d3d12_indirect_dispatch_count,d3d12_indirect_rt); Intel 5 (those minusd3d12_indirect_rt, plusd3d12_buffer_tiles,d3d12_dxr_validation_khrandd3d12_clear_formats, whose sRGB rounding differs from WARP on this Intel driver).I wasn't able to run the retail boot up to this point: on
mainit stops long before the native pipelines. No game data. AI-assisted (Claude Code).🤖 Generated with Claude Code