diff options
| author | mrp1no <137657338+mrp1no@users.noreply.github.com> | 2026-11-23 17:42:36 +0100 |
|---|---|---|
| committer | mrp1no <137657338+mrp1no@users.noreply.github.com> | 2026-11-23 17:42:36 +0100 |
| commit | 67950a8d5159912fa9403549a924d92cda9d7db4 (patch) | |
| tree | 65e5d779c4c36f1b17d6801c7d1ce9bd33d1fb48 /runtime/src/vulkan_aftermath.cpp | |
| parent | 8575d36edc479218972497a7bded8651a42856c0 (diff) | |
d3d12: A8_UNORM render targets through VK_FORMAT_A8_UNORM_KHR (VK_KHR_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>
Diffstat (limited to 'runtime/src/vulkan_aftermath.cpp')
0 files changed, 0 insertions, 0 deletions