AMD releases Vulkan support for Dense Geometry Format

Originally posted:
Stuart Smith's avatar
Stuart Smith

In our Solving the Dense Geometry Problem blog we described Dense Geometry Format (DGF), a block-based geometry compression technology developed by AMD, which will be directly supported by future GPU architectures.

We are now releasing a provisional Vulkan® extension VK_AMDX_dense_geometry_format that enables DGF data to be provided directly to the acceleration structure build, removing the performance and memory costs imposed by a separate decoding step. On hardware with native DGF support, the extension will significantly improve BLAS build time, and sharply reduce BLAS memory footprint.

The extension is very simple. When an application wants to build an acceleration structure using pre-compressed DGF data it sets the geometryType member of VkAccelerationStructureGeometryKHR to VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX

typedef enum VkGeometryTypeKHR {
VK_GEOMETRY_TYPE_TRIANGLES_KHR = 0,
VK_GEOMETRY_TYPE_AABBS_KHR = 1,
VK_GEOMETRY_TYPE_INSTANCES_KHR = 2,
...
// Provided by VK_AMDX_dense_geometry_format
VK_GEOMETRY_TYPE_DENSE_GEOMETRY_FORMAT_TRIANGLES_AMDX = 1000478000,
...
} VkGeometryTypeKHR;

and then extends VkAccelerationStructureGeometryKHR by attaching a VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX to its pNext chain.

// Provided by VK_AMDX_dense_geometry_format
typedef struct VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX {
VkStructureType sType;
const void* pNext;
VkDeviceOrHostAddressConstKHR compressedData;
VkDeviceSize dataSize;
uint32_t numTriangles;
uint32_t numVertices;
uint32_t maxPrimitiveIndex;
uint32_t maxGeometryIndex;
VkCompressedTriangleFormatAMDX format;
} VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX;

The members of VkAccelerationStructureDenseGeometryFormatTrianglesDataAMDX can be filled out either by saving off the values when compressing the data using e.g. the sample encoder (DGFTester.exe) in the DGF SDK:

c:\DGFSDK\build\DGFSDK\DGFTester\Debug>DGFTester.exe teapot.obj --dump-bin teapot.dgf
DGFBaker configuration:
Cluster face limit: 128
Cluster vert limit: 256
Bit width : 16
Packer : SAH
Loading obj file: teapot.obj
Model size: 4690 verts 9128 tris 0 materials
Input size: 0.16MB
Baking DGF blocks...
Conversion took: 47.50ms
491 DGF blocks (0.00% palette)
6.8852 B/tri (2.64:1)
8953 block vertices, 9128 block triangles (0.98 V/Tri)
18.59 Tris/Block
18.23 Verts/Block
Vertex duplication factor: 1.91
Vertex duplication cost per byte: 0.47B/Tri
SAH is: 2.016384
Blocks per cluster: Min: 2 Max: 9 Mean: 4.63
Tris per cluster: Min: 50 Max: 127 Mean: 86.11
Validating DGF blocks...
Dumping...
Wrote: teapot.dgf
Clean exit

or at runtime using something like this code snippet from the DGF SDK to extract the values from the DGF data:

{
m_sumBlockTris = 0;
m_sumBlockVerts = 0;
m_maxPrimIndex = 0;
m_maxGeomIndex = 0;
const auto numBlocks = GetNumDGFBlocks();
for (size_t block = 0; block < numBlocks; block++) {
const uint8_t* pBlock = m_blocks.data() + block * DGF::BLOCK_SIZE;
DGF::MetaData meta;
DGF::DecodeMetaData(&meta, pBlock);
uint8_t opaqueFlags[DGF::MAX_TRIS];
uint32_t geomID[DGF::MAX_TRIS];
DGF::DecodeGeomIDs(geomID, opaqueFlags, pBlock);
for (size_t i=0; i<meta.numTris; i++)
m_maxGeomIndex = std::max(m_maxGeomIndex, geomID[i]);
m_maxPrimIndex = std::max(m_maxPrimIndex, meta.primIDBase + (meta.numTris - 1));
m_sumBlockTris += meta.numTris;
m_sumBlockVerts += meta.numVerts;
}
}

Support for this extension is initially available in the AMD Software: Adrenalin Edition™ 25.10.25.02 preview driver and then in an upcoming AMD Software: Adrenalin Edition driver.

There is also a simple sample app showing the extension’s usage:

Basic sample

Resources

To get started using the extension, check out the following resources:

Join the AMD Developer Community Discord Server to connect with fellow developers and AMD staff to discuss this release in the “GAME DEV BOARDS_”.

Disclaimers

Links to third-party sites are provided for convenience and unless explicitly stated, AMD is not responsible for the contents of such linked sites, and no endorsement is implied. GD-98

Khronos and Vulkan are registered trademarks of the Khronos Group Inc.

Stuart Smith's avatar

Stuart Smith

Stu Smith is a senior member of technical staff at AMD, working on Vulkan software architecture. Prior to that he wrote drivers for mobile GPUs.

Related news and technical articles