vk: fix BC format query and raw storage image view creation on AMD #1052

Merged
1conver merged 1 commit from fix/amd-bc-encoder-optimization into main 2026-11-09 15:15:29 +00:00
1conver commented 2026-11-09 08:07:47 +00:00 (Migrated from github.com)

On AMD proprietary Windows drivers (tested on Radeon RX 6600 XT with amdvlk64.dll), kGetPhysicalDeviceImageFormatProperties rejects VK_IMAGE_USAGE_STORAGE_BIT when queried directly on compressed BC formats (BC1..BC7), returning VK_ERROR_FORMAT_NOT_SUPPORTED. Consequently, compressed textures never received STORAGE_BIT, preventing raw block-texel storage image views from being created. When compute encoders attempted to write compressed blocks, the operations failed or dropped, causing texture corruption (e.g. Link's clothes displaying stale blocks or black textures).

Changes

  1. Map compressed BC formats (BC1..BC7) to raw texel formats (VK_FORMAT_R32G32_UINT and VK_FORMAT_R32G32B32A32_UINT) in storage_view_format().
  2. Query kGetPhysicalDeviceImageFormatProperties with base x.usage instead of x.usage | STORAGE_BIT against compressed formats, checking optimal tiling storage capability on the raw format.
  3. In make_view(), support block-texel views with fallback to a single layer if multi-layer views are rejected by the driver (Vulkan 1.1 block-texel view rules).
  4. Add safe image creation fallback without STORAGE_BIT if image allocation is rejected.

Tested on AMD Radeon RX 6600 XT (Windows 10/11) with Hookshot v2.0.6.

On AMD proprietary Windows drivers (tested on Radeon RX 6600 XT with amdvlk64.dll), kGetPhysicalDeviceImageFormatProperties rejects VK_IMAGE_USAGE_STORAGE_BIT when queried directly on compressed BC formats (BC1..BC7), returning VK_ERROR_FORMAT_NOT_SUPPORTED. Consequently, compressed textures never received STORAGE_BIT, preventing raw block-texel storage image views from being created. When compute encoders attempted to write compressed blocks, the operations failed or dropped, causing texture corruption (e.g. Link's clothes displaying stale blocks or black textures). ### Changes 1. Map compressed BC formats (BC1..BC7) to raw texel formats (VK_FORMAT_R32G32_UINT and VK_FORMAT_R32G32B32A32_UINT) in storage_view_format(). 2. Query kGetPhysicalDeviceImageFormatProperties with base x.usage instead of x.usage | STORAGE_BIT against compressed formats, checking optimal tiling storage capability on the raw format. 3. In make_view(), support block-texel views with fallback to a single layer if multi-layer views are rejected by the driver (Vulkan 1.1 block-texel view rules). 4. Add safe image creation fallback without STORAGE_BIT if image allocation is rejected. Tested on AMD Radeon RX 6600 XT (Windows 10/11) with Hookshot v2.0.6.
Commenting is not possible because the repository is archived.
No description provided.