Colour images are made without a format list, which may switch off AMD's compression on RDNA 1 and 2, including the Steam Deck #1512

Open
opened 2026-11-18 01:46:01 +00:00 by mooki · 0 comments
Member

Type: measurement · Area: renderer, AMD, images · Part of: #1493

TL;DR

Every uncompressed colour image is made with the mutable-format and storage bits and no list of the formats its views will use. In AMD's Mesa driver (RADV) on RDNA 1 and 2, including the Steam Deck, such an image gets no delta colour compression (DCC) unless a format list proves its views compatible; the source says RDNA 3 and 4 do not need the list. A list may fit only part of our images, because one image here serves every format of its size. I propose to measure first: whether DCC is off today, what it is worth on an RDNA 3 card, and what share of image bytes a list could cover.

Breakdown

  • Who it affects: Steam Deck and other RDNA 1 and 2 cards on Linux (RX 5000 and 6000 series, some APUs). Windows AMD is unknown: the sources below are about RADV and a 2019 talk.
  • What is wrong: gpu/vk/vk_texture.cpp:2373-2375 sets MUTABLE_FORMAT, EXTENDED_USAGE, COLOR_ATTACHMENT and, for single-sample images, STORAGE, and the create info at :2409-2419 has no pNext. Only the swapchain chains a format list (vk_main.cpp:1154-1162).
  • What we propose: (1) count the view formats each image class actually gets; (2) check on an RDNA 2 device whether DCC is off for the scene targets; (3) if a list can cover a useful share, try it behind a switch, with the list in the target pool's key, and time it against the switch off.
  • What does not change: images stay shared by class, in GENERAL layout, with the same usage. NVIDIA and Intel ignore the list. No picture should change.
  • How we would prove it: a game-free source check that fails today, a validation-layer run with no new view-format error, picture hashes equal, then paired GPU timing on an RDNA 2 device after a null pair. No speed claim until that exists.

Evidence

What the code does, on main (310e7c9df):

  • vk_texture.cpp:2368-2375: for a colour image that is not BC or ASTC, flags MUTABLE_FORMAT | EXTENDED_USAGE, usage SAMPLED | COLOR_ATTACHMENT, and STORAGE when single-sample. The comment: "any format of the class may be a view".
  • vk_texture.cpp:194-204: format_class groups images by bytes per block (RGB10A2 apart), so one image serves every format of its size.
  • vk_texture.cpp:137-155: a storage view of a format without storage support (BGRA8, RGB10A2, 11-11-10, shared exponent) is R32_UINT; 16-bit unorm formats map to R32G32_UINT. So some images get integer views of float or normalised data.
  • vk_texture.cpp:389-396: the target pool is keyed by flags, type, format, extent, usage and tiling, not by pNext. A list would have to join the key, or two images with different lists would be reused for each other.

What the driver does (Mesa's main branch, read on 17 Nov 2026; src/amd/vulkan/radv_image.c and radv_formats.c; I did not run it):

  • radv_are_formats_dcc_compatible returns true for every format on GFX12, and for mutable images on GFX11 ("All formats are compatible on GFX11"). Below GFX11 (RDNA 1 and 2 are GFX10 and GFX10.3; the Steam Deck is GFX10.3) a mutable-format image gets DCC only if a non-empty VkImageFormatListCreateInfo is chained and every listed format is DCC compatible with the image's format.
  • radv_dcc_formats_compatible (below GFX11): same channel count, same swizzle, float against not-float equal, same channel size. A 32-bit integer view of an 8-bit RGBA image fails that.
  • For an image with STORAGE usage the same file turns DCC off when the image's format, or any format in its list, supports image atomics (the comment: atomics always decompress). So a list that names R32_UINT would not keep DCC on a storage image.
  • A comment in the same file: image stores never support DCC on GFX9 and earlier, so storage images there have none whatever the list. Surfaces of 512 x 512 pixels or less also get no DCC, and neither do arrays with mip levels. The rule for DCC with storage on GFX10 has a further condition I did not trace.
  • Mesa's documentation lists RADV_DEBUG=nodcc (disable DCC on images) and RADV_DEBUG=img (print image info).

What AMD says: the Vulkanised 2019 talk by an AMD engineer, "Optimising a AAA Vulkan title on desktop" (Khronos slides): DCC gave 5 to 10% on all tested AMD GPUs in that one game (pages 19-20); "VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT disables DCC" (page 32); DCC works for float or integer formats, not both (page 34). The Vulkan Guide says the same about lossless compression and format lists. That game is not this one, so 5 to 10% is a ceiling to test, not an expected gain.

Not known: whether DCC is off for our scene targets on any AMD card (nobody has looked); which view formats images get in play; what Windows AMD does today.

Proposed change

  1. Add a counter: per image class and per image, the set of view formats made over a session, grouped by DCC-compatible family (RGBA8 unorm, sRGB and integer; 16-bit float and so on). Log the share of colour-image bytes whose views all sit in one family. Any GPU can run this, including NVIDIA here.
  2. On an RDNA 2 device (Deck, RX 6000) with Mesa: look at the scene target's DCC state with RADV_DEBUG=img, or with Radeon GPU Profiler on Windows.
  3. If the share is large: a switch that chains a list for an image whose class has a closed set of views, and joins the list to pool_key_of. Images that need other views stay as they are.
  4. Reading the RADV_DEBUG=nodcc A/B: on RDNA 3 it measures what DCC is worth in this game (a ceiling for RDNA 2). On RDNA 2 it should change nothing for these images if DCC is already off, which is a check of the hypothesis.

How we would test it

  • Game-free, fails today: a source check that every VkImageCreateInfo in gpu/vk that sets MUTABLE_FORMAT_BIT either chains a format list or names why it does not, and that pool_key_of hashes the list. On main it finds vk_texture.cpp:2373 and :2378.
  • Possibly game-free: a small Vulkan program that makes an RGBA8 image with these flags and usage, with and without the list, and prints RADV's image info for an RDNA 2 chip through Mesa's offline driver shim, as #1377 did for shader statistics. I have not tried it; it may not work.
  • In the game: the Vulkan validation layer on a tour with the switch on: no new view-format errors. Picture hashes equal on the three scenes. Then GPU time per pass and frame (RX_VK_PASS_TIMING=2) on an RDNA 2 device, main against branch, interleaved, after a null main-against-main pair, in Kokiri Forest, Hyrule Field and the Market. The counter in step 1 needs no AMD card and can run on the RTX 4090 here.
  • Risk to measure, not assume: DCC can add work (a decompress when an image is read through an incompatible view or written through storage).
  • No issue or pull request on this forge other than #1493 mentions DCC, mutable formats or format lists (searched: DCC, format list, VkImageFormatListCreateInfo, mutable format, nodcc, delta colour compression, RADV_DEBUG, open and closed, issues and pull requests). #1493 lists "AMD's colour compression with a format list" among its experiments.
  • #1377 (open, work in progress): a Steam Deck change measured partly with Mesa's offline driver on a Deck chip; the method may serve step 2.
  • #1158 and #1339 (open): other VRAM work on small cards. This issue is about speed on AMD, not memory.

New on this forge; not opened on GitHub.

**Type:** measurement · **Area:** renderer, AMD, images · **Part of:** #1493 ## TL;DR Every uncompressed colour image is made with the mutable-format and storage bits and no list of the formats its views will use. In AMD's Mesa driver (RADV) on RDNA 1 and 2, including the Steam Deck, such an image gets no delta colour compression (DCC) unless a format list proves its views compatible; the source says RDNA 3 and 4 do not need the list. A list may fit only part of our images, because one image here serves every format of its size. I propose to measure first: whether DCC is off today, what it is worth on an RDNA 3 card, and what share of image bytes a list could cover. ## Breakdown - **Who it affects:** Steam Deck and other RDNA 1 and 2 cards on Linux (RX 5000 and 6000 series, some APUs). Windows AMD is unknown: the sources below are about RADV and a 2019 talk. - **What is wrong:** `gpu/vk/vk_texture.cpp:2373-2375` sets `MUTABLE_FORMAT`, `EXTENDED_USAGE`, `COLOR_ATTACHMENT` and, for single-sample images, `STORAGE`, and the create info at `:2409-2419` has no `pNext`. Only the swapchain chains a format list (`vk_main.cpp:1154-1162`). - **What we propose:** (1) count the view formats each image class actually gets; (2) check on an RDNA 2 device whether DCC is off for the scene targets; (3) if a list can cover a useful share, try it behind a switch, with the list in the target pool's key, and time it against the switch off. - **What does not change:** images stay shared by class, in GENERAL layout, with the same usage. NVIDIA and Intel ignore the list. No picture should change. - **How we would prove it:** a game-free source check that fails today, a validation-layer run with no new view-format error, picture hashes equal, then paired GPU timing on an RDNA 2 device after a null pair. No speed claim until that exists. ## Evidence What the code does, on main (310e7c9df): - `vk_texture.cpp:2368-2375`: for a colour image that is not BC or ASTC, flags `MUTABLE_FORMAT | EXTENDED_USAGE`, usage `SAMPLED | COLOR_ATTACHMENT`, and `STORAGE` when single-sample. The comment: "any format of the class may be a view". - `vk_texture.cpp:194-204`: `format_class` groups images by bytes per block (RGB10A2 apart), so one image serves every format of its size. - `vk_texture.cpp:137-155`: a storage view of a format without storage support (BGRA8, RGB10A2, 11-11-10, shared exponent) is `R32_UINT`; 16-bit unorm formats map to `R32G32_UINT`. So some images get integer views of float or normalised data. - `vk_texture.cpp:389-396`: the target pool is keyed by flags, type, format, extent, usage and tiling, not by `pNext`. A list would have to join the key, or two images with different lists would be reused for each other. What the driver does (Mesa's main branch, read on 17 Nov 2026; `src/amd/vulkan/radv_image.c` and `radv_formats.c`; I did not run it): - `radv_are_formats_dcc_compatible` returns true for every format on GFX12, and for mutable images on GFX11 ("All formats are compatible on GFX11"). Below GFX11 (RDNA 1 and 2 are GFX10 and GFX10.3; the Steam Deck is GFX10.3) a mutable-format image gets DCC only if a non-empty `VkImageFormatListCreateInfo` is chained and every listed format is DCC compatible with the image's format. - `radv_dcc_formats_compatible` (below GFX11): same channel count, same swizzle, float against not-float equal, same channel size. A 32-bit integer view of an 8-bit RGBA image fails that. - For an image with `STORAGE` usage the same file turns DCC off when the image's format, or any format in its list, supports image atomics (the comment: atomics always decompress). So a list that names `R32_UINT` would not keep DCC on a storage image. - A comment in the same file: image stores never support DCC on GFX9 and earlier, so storage images there have none whatever the list. Surfaces of 512 x 512 pixels or less also get no DCC, and neither do arrays with mip levels. The rule for DCC with storage on GFX10 has a further condition I did not trace. - Mesa's documentation lists `RADV_DEBUG=nodcc` (disable DCC on images) and `RADV_DEBUG=img` (print image info). What AMD says: the Vulkanised 2019 talk by an AMD engineer, "Optimising a AAA Vulkan title on desktop" (Khronos slides): DCC gave 5 to 10% on all tested AMD GPUs in that one game (pages 19-20); "VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT disables DCC" (page 32); DCC works for float or integer formats, not both (page 34). The Vulkan Guide says the same about lossless compression and format lists. That game is not this one, so 5 to 10% is a ceiling to test, not an expected gain. Not known: whether DCC is off for our scene targets on any AMD card (nobody has looked); which view formats images get in play; what Windows AMD does today. ## Proposed change 1. Add a counter: per image class and per image, the set of view formats made over a session, grouped by DCC-compatible family (RGBA8 unorm, sRGB and integer; 16-bit float and so on). Log the share of colour-image bytes whose views all sit in one family. Any GPU can run this, including NVIDIA here. 2. On an RDNA 2 device (Deck, RX 6000) with Mesa: look at the scene target's DCC state with `RADV_DEBUG=img`, or with Radeon GPU Profiler on Windows. 3. If the share is large: a switch that chains a list for an image whose class has a closed set of views, and joins the list to `pool_key_of`. Images that need other views stay as they are. 4. Reading the `RADV_DEBUG=nodcc` A/B: on RDNA 3 it measures what DCC is worth in this game (a ceiling for RDNA 2). On RDNA 2 it should change nothing for these images if DCC is already off, which is a check of the hypothesis. ## How we would test it - Game-free, fails today: a source check that every `VkImageCreateInfo` in `gpu/vk` that sets `MUTABLE_FORMAT_BIT` either chains a format list or names why it does not, and that `pool_key_of` hashes the list. On main it finds `vk_texture.cpp:2373` and `:2378`. - Possibly game-free: a small Vulkan program that makes an RGBA8 image with these flags and usage, with and without the list, and prints RADV's image info for an RDNA 2 chip through Mesa's offline driver shim, as #1377 did for shader statistics. I have not tried it; it may not work. - In the game: the Vulkan validation layer on a tour with the switch on: no new view-format errors. Picture hashes equal on the three scenes. Then GPU time per pass and frame (`RX_VK_PASS_TIMING=2`) on an RDNA 2 device, main against branch, interleaved, after a null main-against-main pair, in Kokiri Forest, Hyrule Field and the Market. The counter in step 1 needs no AMD card and can run on the RTX 4090 here. - Risk to measure, not assume: DCC can add work (a decompress when an image is read through an incompatible view or written through storage). ## Related - No issue or pull request on this forge other than #1493 mentions DCC, mutable formats or format lists (searched: DCC, format list, `VkImageFormatListCreateInfo`, mutable format, `nodcc`, delta colour compression, `RADV_DEBUG`, open and closed, issues and pull requests). #1493 lists "AMD's colour compression with a format list" among its experiments. - #1377 (open, work in progress): a Steam Deck change measured partly with Mesa's offline driver on a Deck chip; the method may serve step 2. - #1158 and #1339 (open): other VRAM work on small cards. This issue is about speed on AMD, not memory. New on this forge; not opened on GitHub.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#1512
No description provided.