It Me, Maintenance5

After a long week of what-even-happened, it’s finally time to talk about maintenance5.

This long-awaited maintenance extension has a number of great and zinkful features:

  • VK_FORMAT_A8_UNORM_KHR for native A8 handling
    • totally works all the time and doesn’t at all need any workarounds for cases where the driver only supports a certain subset of the required format features
      • hahaha
        • ahahahahahahahahahahahahaha
  • a property to detect Intel hardware
  • default value of 1.0 for gl_PointSize
  • deprecating shader modules
    • still gonna keep using them
  • Clarification that copies between images of any type are allowed, treating 1D images as 2D images with a height of 1.
    • already been doing it since 2018

But who can guess which one is the topic of this blog post?

Hell Yeah

Finally a default value for gl_PointSize.

Long-term fans of the blog will recall that I’ve previously raged against the insane concept that pointsize must be written many times prior. In fact, it remains the second most blogged about topic in SGC history right behind Big Triangledescriptor management, the topic that modern graphics-related blogs must cover above all others.

Finally with maintenance5 we can be freed from these unjust shackles that have bound us for so long. No more* shall complex logic be unnecessarily injected into the compiler stack to add senseless writes to this output.
* except all that code still has to exist and run to handle drivers that don’t support maintenance5

Beyond the obvious benefit of having a fixed default pointsize (sanity), let’s check out some other benefits.

Shader Reduction

Previously all zink-emitted shaders would have a pointsize write, even those that were never used for drawing points. This resulted in unnecessary shader i/o at the hardware level. Nobody wants unnecessary shader i/o at the hardware level.

Now, however, it’s possible to use heuristics during linking to delete all unnecessary pointsize writes any time there is no XFB emission.

How much performance improvement will this yield?


Six improvement units of performance.

Complexity Reduction

Everyone remembers that time I discovered that huge flaw in nir_assign_io_var_locations where shader interfaces would break due to psiz injection.

With maintenance5 all of that can be handwaved away, meaning fewer shader variants are needed.

Code Deletion



Maintenance extensions are best extensions, prove me wrong.

Written on August 18, 2023