Skip to content

freedreno/vulkan: enable Vulkan 1.4 on a6xx gen4 - #115

Open
subhu2008 wants to merge 2 commits into
lfdevs:dev/adreno-mainfrom
subhu2008:dev/adreno-main
Open

subhu2008 wants to merge 2 commits into
lfdevs:dev/adreno-mainfrom
subhu2008:dev/adreno-main

Conversation

@subhu2008

Copy link
Copy Markdown

Vulkan 1.4 requires storageBuffer8BitAccess and at least seven bound descriptor sets. a6xx gen4 already has 8-bit storage, but a6xx exposes only five hardware bindless descriptor-set base registers per stage, so seven usable sets require descriptor-set virtualization.

Enable storage_8bit on a6xx_gen4 and raise max_sets to 8 (seven usable sets plus one reserved for dynamic descriptors). Gate apiVersion 1.4 on storage_8bit and usable_sets >= 7, leaving older a6xx parts and reduced set counts on 1.3.

Sets at and above hw_max_sets - 1 share the last hardware base register. Program that register with the lowest non-zero set IOVA and pass shaders a per-set descriptor-index offset through the new
IR3_CONST_ALLOC_VIRTUAL_SET_OFFSETS allocation. The offset is added to the descriptor index before the bindless access and the set index is clamped to the shared register. Skip pipeline descriptor preload packets for virtualized sets and dynamic descriptors, whose offsets are only known at bind time.

Enable SSBO emulation on a6xx too; it only needs global loads/stores and the driver UBO holding per-set descriptor base addresses. Use RESINFO instead of the a7xx-only RESBASE for a6xx SSBO size lowering, and rewrite SSBO address users in place so removing the original load does not invalidate NIR's safe iterator.

X11 WSI: KGSL has no implicit sync and msm VM_BIND submissions carry no BO list, so the kernel cannot attach fences to the presented dma-bufs. Wait for the present fence before handing an image to X11 unless explicit sync or a dma-buf syncobj is available.

EGL: when zink will use kopper, the DRI3 device is not needed because presentation goes through Vulkan WSI, which imports dma-bufs directly. Do not warn about DRI3Open failures in that case; some X servers, such as Termux:X11, implement only the dma-buf import half of DRI3.

Tested on Adreno 644 (a6xx gen4):

  • vulkaninfo reports 1.4.363, maxBoundDescriptorSets = 7 and storageBuffer8BitAccess = true.
  • FD_DEV_FEATURES=max_sets=5 and storage_8bit=false still report 1.3.
  • vk7tex, vk7ssbo, vk7gfx, vk7texdyn, vk7gfxdyn, vk1dyn, vk1gfxdyn, vk8bit_set6 and vkbigssbo pass, including SSBO emulation.
  • glmark2-es2 terrain runs at ~180-190 FPS without black frames; vkcube and vkgears are clean.
  • Zink EGL no longer logs the DRI3 warning; native kgsl EGL still reports "Using DRI3".

subhu2008 and others added 2 commits November 3, 2026 18:47
Vulkan 1.4 requires storageBuffer8BitAccess and at least seven bound
descriptor sets.  a6xx gen4 already has 8-bit storage, but a6xx exposes
only five hardware bindless descriptor-set base registers per stage, so
seven usable sets require descriptor-set virtualization.

Enable storage_8bit on a6xx_gen4 and raise max_sets to 8 (seven usable
sets plus one reserved for dynamic descriptors).  Gate apiVersion 1.4 on
storage_8bit and usable_sets >= 7, leaving older a6xx parts and reduced
set counts on 1.3.

Sets at and above hw_max_sets - 1 share the last hardware base register.
Program that register with the lowest non-zero set IOVA and pass shaders
a per-set descriptor-index offset through the new
IR3_CONST_ALLOC_VIRTUAL_SET_OFFSETS allocation.  The offset is added to
the descriptor index before the bindless access and the set index is
clamped to the shared register.  Skip pipeline descriptor preload
packets for virtualized sets and dynamic descriptors, whose offsets are
only known at bind time.

Enable SSBO emulation on a6xx too; it only needs global loads/stores and
the driver UBO holding per-set descriptor base addresses.  Use RESINFO
instead of the a7xx-only RESBASE for a6xx SSBO size lowering, and
rewrite SSBO address users in place so removing the original load does
not invalidate NIR's safe iterator.

X11 WSI: KGSL has no implicit sync and msm VM_BIND submissions carry no
BO list, so the kernel cannot attach fences to the presented dma-bufs.
Wait for the present fence before handing an image to X11 unless
explicit sync or a dma-buf syncobj is available.

EGL: when zink will use kopper, the DRI3 device is not needed because
presentation goes through Vulkan WSI, which imports dma-bufs directly.
Do not warn about DRI3Open failures in that case; some X servers, such
as Termux:X11, implement only the dma-buf import half of DRI3.

Tested on Adreno 644 (a6xx gen4):
- vulkaninfo reports 1.4.363, maxBoundDescriptorSets = 7 and
  storageBuffer8BitAccess = true.
- FD_DEV_FEATURES=max_sets=5 and storage_8bit=false still report 1.3.
- vk7tex, vk7ssbo, vk7gfx, vk7texdyn, vk7gfxdyn, vk1dyn, vk1gfxdyn,
  vk8bit_set6 and vkbigssbo pass, including SSBO emulation.
- glmark2-es2 terrain runs at ~180-190 FPS without black frames;
  vkcube and vkgears are clean.
- Zink EGL no longer logs the DRI3 warning; native kgsl EGL still
  reports "Using DRI3".

Signed-off-by: Subham Nayak <fstab.subhu@gmail.com>
@lfdevs

lfdevs commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Please rebase the PR onto the dev/adreno-main branch instead of using git merge. Then reorganize the commits into multiple commits grouped by functionality.

Please try to minimize the scope of the changes. Some of the changes in the current PR may not be necessary for enabling Vulkan 1.4 on a6xx_gen4, such as:

  • Refactoring the SSBO descriptor reading functions.
  • Standalone fixes for SSBO emulation lowering.
  • Adjusting Zink/kopper EGL warnings.

@subhu2008

Copy link
Copy Markdown
Author

Ok i will do it when i get time. Busy on bringing up mainline kernel for my device lol, just got the time to reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants