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> (cherry picked from commit 67950a8)
…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 #7403.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 18b0bfb)
|
Reviewed 49b750a and tested under Wine on Linux with an RTX 3060. I found two Vulkan validation issues:
Eight of nine focused tests passed on both the PR and baseline. d3d12_clear_formats failed on both: the PR also had five A8 differences against Wine's hardware reference. An independent readback showed Leonida writing alpha and the Wine reference writing red, so I can't treat those differences as a confirmed Leonida defect. A red-for-alpha mutation failed the checked-in draw test. I did not test the stacked retail boot path. AI-assisted review and validation. |
|
A 1D A8_UNORM texture is refused. On native Windows, with this PR stacked on Only the alpha render target needs single-sampled 2D. A sampled-only A8 texture already falls through to if (desc.Format == DXGI_FORMAT_A8_UNORM) {
- if (desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || desc.SampleDesc.Count != 1 ||
- (desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)))
+ if (desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS))
+ return {};
+ // Only the alpha render target is limited to single-sampled 2D. A sampled-only A8 texture is an R8 image
+ // of any dimension (the retail title asks for a 128x1 TEXTURE1D one); its views select X into alpha.
+ if ((desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) &&
+ (desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || desc.SampleDesc.Count != 1))
return {};This is checked only by the title getting past that stop. There's no unit test for 1D A8 sampling yet, and I haven't checked the sampled values. AI-assisted (Claude Code). |
…_UNORM render targets through VK_FORMAT_A8_UNORM_KHR, again (RT-A8-TARGET) [Mumogg]
…da#441 and ProjectLeonida#444 to the repository's own checks Four standard-library tests that pass on upstream main failed after merging: - test_sad_diff: its harness canary expected `v_sad_u8 ... clamp` to be rejected; ProjectLeonida#275 translates clamp on the SAD ops now, so that canary is dropped (the qsad clamp and the two quad-operand canaries still reject). - test_gfx10_descriptors: ProjectLeonida#428's A8_UNORM row carried a note after the format name; the note moves to its own comment line so the row parses. - test_docs_env_vars: ProjectLeonida#441's LEONIDA_TITLE_MEMORY_MB is documented in docs/retail_boot_intel_host.md section 2 (the commit-limit stop it is for). - test_cmake_translator_deps: ProjectLeonida#444's cs_upload_read rule runs build.py, so it depends on ${LEONIDA_TRANSLATOR_DEPS} like the other build.py rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A small addition for this PR, found booting the retail executable on top of it: the title also asks for a sampled-only A8_UNORM if (desc.Format == DXGI_FORMAT_A8_UNORM) {
if (desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS))
return {};
// Only the alpha render target is limited to single-sampled 2D. A sampled-only A8 texture is an R8 image
// of any dimension (the retail title asks for a 128x1 TEXTURE1D one); its views select X into alpha.
if ((desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) &&
(desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || desc.SampleDesc.Count != 1))
return {};With it the allocation succeeds and boot goes on (Windows 11, RTX 4070 SUPER). Feel free to fold it in; I can open a separate PR instead if you prefer. AI-assisted (Claude Code). |
|
Confirmed the mixed-backing copy issue from the earlier review on native Windows 10 22H2 (19045), RTX 5070 / NVIDIA 610.88, and MSVC 19.51.36256. Tested #428 head The synthetic probe uses two 4x4 D3D12
The checked-in Synthetic data only; no game files or retail boot. AI-assisted (Codex). |
|
Follow-up to my Windows validation report above: I tested a local proof of concept on On Windows 10 22H2, RTX 5070 / NVIDIA 610.88 and Khronos validation 1.4.369, the four previously failing synthetic copy runs now produce zero validation errors and all texels match (16/16 for Five checked-in tests passed with validation enabled: Synthetic results only. AI-assisted (Codex). |
|
Measured a case this PR refuses that it should accept, on the retail 1.0.2.1 title (native Windows, RTX 3070, driver 32.0.16.1692, with the #432 stack this PR is part of).
Moving the limits into the render-target branch fixes it: if (desc.Format == DXGI_FORMAT_A8_UNORM) {
- if (desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || desc.SampleDesc.Count != 1 ||
- (desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)))
- return {};
+ // Only the render-target form has limits of its own (a single-sample 2D VK_FORMAT_A8_UNORM_KHR image).
+ // Any other A8_UNORM texture is an R8_UNORM image below, whatever its dimension.
+ if (desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) return {};
if (desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) {
+ if (desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || desc.SampleDesc.Count != 1 ||
+ (desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS))
+ return {};
if (!info.a8_render_target) {With that change, plus the runtime-device pipeline cache from #1308, the boot runs its frame loop for the whole 10-minute window I gave it: 13,838 |
|
This conflicts with Both conflicts were add/add. I kept both sides:
Not compiled or run here: I have no Windows SDK on this machine, so CI is the first build. To take it (maintainer edits are on): git fetch https://github.com/Mouad-Scriptz-0/leonida rebased/pr428
git push --force-with-lease=a8-render-target:49b750a95 https://github.com/Mumogg/leonida-continued FETCH_HEAD:a8-render-targetAI-assisted. |
|
Closing as carried:
Thanks to mrp1no, and to moffington and Dezmonius for the reviews. AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in #14 as
RT-A8-TARGET. Independent of my other open pull requests: it is based onmainalone and touches the Vulkan layer, not the proxy.What and why
The retail title's first native pipelines name an A8_UNORM render target, and it sizes one at 3840 x 2160 through device slot 25.
mainstores every A8_UNORM texture as R8_UNORM and refuses it as a render target: the log saysGetResourceAllocationInfo format not supported yet: 65, slot 25 answersUINT64_MAX, and a worker thread of the title stops on its ownint3.Two commits by mrp1no (
-x, authorship kept; ancestors ofmainwhose content is not in the tree):67950a8d5: where the GPU hasVK_KHR_maintenance5and can sampleVK_FORMAT_A8_UNORM_KHRand blend it as a colour attachment, an A8_UNORM texture created withALLOW_RENDER_TARGETis stored in that format; its views, the format support answers and the copy paths follow. Other A8_UNORM textures stay R8_UNORM, and a device without the format refuses A8 render targets as before.18b0bfbaf: an A8 render target's castable list takes its own format and refuses the others.The first commit conflicted in two places. In
d3d12_vulkan_device.cppit was written against the olderr9g9b9e5_as_r32_uintmember thatmainhas since replaced withuint_backed: I keptmain's member and added only the commit'sa8_as_alphanext to it, and in the render-target-view code the A8 case goes beforemain'suint_backedcases. Invk_test_device.hboth extensions are enabled.Measured
Linux (Nobara 44, kernel 7.3), Wine 11.21 staging, RTX 5070 Ti (driver 615.78.08, has
VK_KHR_maintenance5), clang-cl 22.1.8 + xwin SDK 10.0.26100, own 1.0.2.1 copy, network off. The boot runs are onmainece4ba5b3with my stacked pull requests and #142, #219, #328 and #387, because the stop is only reached that far in.--runCreatePipelineState okint3on the refused sizeSo this is what lets the title go on to create its pipelines on this path. The null call that ends the run is a queue method forwarded to the wrong PC method; that is my pull request for
RT-QUEUE-SIGNAL.Tests under Wine, the four the first commit touches:
d3d12_descriptord3d12_drawgfx10_descriptorsd3d12_clear_formatsmainunder this WineNot built with MSVC and not run on Windows, and not run on a GPU without
VK_KHR_maintenance5.AI-assisted (Claude Code); built and run on the machine above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt