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
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1512
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
gpu/vk/vk_texture.cpp:2373-2375setsMUTABLE_FORMAT,EXTENDED_USAGE,COLOR_ATTACHMENTand, for single-sample images,STORAGE, and the create info at:2409-2419has nopNext. Only the swapchain chains a format list (vk_main.cpp:1154-1162).Evidence
What the code does, on main (
310e7c9df):vk_texture.cpp:2368-2375: for a colour image that is not BC or ASTC, flagsMUTABLE_FORMAT | EXTENDED_USAGE, usageSAMPLED | COLOR_ATTACHMENT, andSTORAGEwhen single-sample. The comment: "any format of the class may be a view".vk_texture.cpp:194-204:format_classgroups 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) isR32_UINT; 16-bit unorm formats map toR32G32_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 bypNext. 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.candradv_formats.c; I did not run it):radv_are_formats_dcc_compatiblereturns 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-emptyVkImageFormatListCreateInfois 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.STORAGEusage 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 namesR32_UINTwould not keep DCC on a storage image.RADV_DEBUG=nodcc(disable DCC on images) andRADV_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
RADV_DEBUG=img, or with Radeon GPU Profiler on Windows.pool_key_of. Images that need other views stay as they are.RADV_DEBUG=nodccA/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
VkImageCreateInfoingpu/vkthat setsMUTABLE_FORMAT_BITeither chains a format list or names why it does not, and thatpool_key_ofhashes the list. On main it findsvk_texture.cpp:2373and:2378.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.Related
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.New on this forge; not opened on GitHub.