Skip to content
 
 

Repository files navigation

bcn_layer

A Vulkan layer that can decompress on the fly BC1-7 textures on unsupported hardware using Granite compute shaders.

External Projects

Granite: https://github.com/Themaister/Granite/tree/master

bcn_layer is designed to compose safely with other Vulkan layers in the following order: compat_layer (outermost) → descriptor_buffer_layer → bcn_layer → Mali ICD driver (innermost) Why this order matters? Both bcn_layer and descriptor_buffer_layer intercept vkUpdateDescriptorSets:

  • bcn_layer redirects image views for BCn-marked textures to their ASTC shadows
  • descriptor_buffer_laye handles push descriptors / null descriptors / etc. If descriptor_buffer_layer runs before bcn_layer, it processes descriptor writes that bcn_layer hasn't redirected yet. The result is descriptors pointing to the original BCn image instead of the ASTC shadow, which means black textures or corruption depending on the game. bcn_layer needs to be closer to the driver than descriptor_buffer_layer, so it can redirect image views before descriptor_buffer_layer processes the writes. How to enforce? In projects like Bannerlator, this is enforced via VK_LAYER_PATH ordering. Other projects should ensure the same ordering. Tested with
  • leegao_bcn layer + descriptor_buffer_layer
  • Mali-G57 MC2 (Valhall 1st gen )

About

A Vulkan Layer that adds BCn texture decompression using Granite compute shaders

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages