Home » Blogs » Pre-condition block compressed textures with Brotli-G

Pre-condition block compressed textures with Brotli-G

Shashank Ranjan
Shashank Ranjan

Shashank Ranjan is a senior Software Development Engineer in the DirectML team at AMD. His work primarily focuses on GPU performance and stability of DirectML applications.

Brotli-G (v1.1 onwards) now supports pre-conditioning of block compressed textures, which is designed to improve the compression ratio of these files by on average between 10% to 15% and in some cases as much as 20%. The BrotliG::BrotligDataconditionParams option of Brotli-G Encoder API allows the user to enable pre-conditioning for supported texture types and provides information about the texture that is required for pre-conditioning, such as width, height, pitch, and number of mip levels.

Copied!

brotlig.exe -precondition -texture-width 256 -texture-height 256 -row-pitch 2048 -num-mip-levels 5 abc.DDS

Pre-conditioning employs block swizzling and delta encoding of color. These can be enabled or disabled by setting BrotliG::BrotligDataconditionParams::swizzle and BrotliG::BrotligDataconditionParams::delta_encode flags, providing additional control.

If the texture is ill-formatted, compression is applied without pre-conditioning and a warning is displayed if the appropriate feedback function is provided.

Brotli-G currently supports pre-conditioning of BC1-5 textures. Supported texture formats are listed in the enum BROTLIG_DATA_FORMAT (common/BrotligCommon.h). Textures with multiple mip levels are supported. Limits on textures sizes and mip levels can be found in common/BrotligConstants.h. For more usage details, refer to the help section of the sample application.

Note, a known issue on AMD Renoir causes the GPU Decoder to fail intermittently if pre-conditioning is applied.

The latest release of Brotli-G SDK is available on GitHub.

Related links

AMD Brotli-G SDK

Brotli-G SDK

Brotli-G is an open-source compression/decompression standard for digital assets (based on Brotli) that is compatible with GPU hardware.

Shashank Ranjan
Shashank Ranjan

Shashank Ranjan is a senior Software Development Engineer in the DirectML team at AMD. His work primarily focuses on GPU performance and stability of DirectML applications.

Enjoy this blog post? If you found it useful, why not share it with other game developers?

You may also like...

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

AMD GPUOpen videos

Words not enough? How about pictures? How about moving pictures? We have some amazing videos to share with you!

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

AMD GPUOpen publications

Discover our published publications.