VK_KHR_shader_fma

Other Extension Metadata

Last Modified Date

2025-06-10

Contributors
  • Graeme Leese, Broadcom

Description

This extension allows applications to use the SPV_KHR_fma extension to obtain correctly-rounded results for fused-multiply add (fma) operations.

Fused-multiply add is a building block of many high-precision numerical functions. It provides better accuracy than separate operations, because of the removal of the intermediate rounding step, and often costs less than the pair of separate operations.

Vulkan currently exposes an fma primitive that can give the reduced cost, but it is not guaranteed to be a fused operation, so the accuracy cannot be relied on. For applications which require the high accuracy, therefore, the operation must be emulated or the algorithm changed so as not to require fma. This is often vastly more costly, even though fma is supported in much of the underlying hardware.

New Structures

New Enum Constants

  • VK_KHR_SHADER_FMA_EXTENSION_NAME
  • VK_KHR_SHADER_FMA_SPEC_VERSION
  • Extending VkStructureType:
    • VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FMA_FEATURES_KHR

Version History

  • Revision 1, 2025-06-10 (Graeme Leese)
    • Initial draft