New Automatic Relaxed Precision White Paper for SPIR-V

LunarG releases new RelaxedPrecision white paper for SPIR-V developers. This functionality is available along with the Vulkan 1.1.122.0 SDK release.  Read on for more information about this new feature or read the details in the Automatic Relaxed Precision Decoration and Conversion in Spirv-opt white paper.

Two new passes have been added to spirv-opt to automatically convert SPIR-V shaders to utilize RelaxedPrecision semantics. These passes allow the developer to take advantage of lower precision computations without having to make changes to the shader source. The first pass can be used to automatically convert a whole SPIR-V shader to use RelaxedPrecision, which can be advantageous on both mobile and desktop GPUs. The second pass can be used to automatically convert a RelaxedPrecision-decorated shader to explicitly use 16-bit precision on devices which do not support RelaxedPrecision, but do support the VK_KHR_shader_float16_int8 extension, such as iOS/MoltenVK.

When a 32-bit floating point (float32) SPIR-V executable instruction is decorated with RelaxedPrecision, the result is still a float32 value, but the driver has permission to only compute 16-bits of precision. This can improve performance and/or reduce power consumption if the application does not require the full precision for that instruction. 

However, some Vulkan drivers such as MoltenVK ignore the RelaxedPrecision directive, usually because the underlying implementation (in the case of MoltenVK, Metal), does not support the RelaxedPrecision semantics.

If it is the situation, however, that the underlying implementation does support a true 16-bit floating point type (as it is with Metal), benefits of RelaxedPrecision semantics can be achieved by emulating the RelaxedPrecision instructions using the true 16-bit instructions.

To this end, the –convert-relaxed-to-half pass has been added to spirv-opt. This pass translates all arithmetic float32 instructions decorated with RelaxedPrecision to 16-bit floating point (float16) instructions, adding additional conversion instructions for operands and results where needed.

The –relax-float-ops pass was also added to allow the user to quickly and easily apply the RelaxPrecision decoration to all float32 instructions in a SPIR-V file.

Info about LunarG, Inc.

LunarG’s software engineering experts create software solutions for open source and commercial customers using leading-edge 3D graphics and compute technologies, including Vulkan, OpenXR, SPIR-V, and OpenGL. We have strengths in performance analysis and tuning, runtime and tools development, shader optimizations, driver development, new feature development, and porting engines and applications to Vulkan. Our software engineering team is based in Fort Collins, Colorado. LunarG was founded by software experts who are passionate about 3D graphics.

For more information about LunarG, check out our website.

Featured Post

  • All Posts
  • Announcements
  • Blog
  • Presentations
  • White Papers

Latest Posts

  • All Posts
  • Announcements
  • Blog
  • Presentations
  • White Papers

LunarG Email List

Join our email list to receive important news about Vulkan SDK releases, ecosystem surveys, and more.

You have been successfully subscribed! Oops! Something went wrong, please try again.
Edit Template

Partner with LunarG to do impossible things.

The complexity of GPU software development is relentless, but every “unsolvable” problem that comes up is really an opportunity to create a stronger product.

We believe collaboration is one of the great benefits and opportunities of being part of the visual computing community, and our strength is in our shared expertise. While we focus on your GPU coding issues, you can focus on creating unforgettable visual experiences.

Together, we’ll unlock the full power and potential of today’s GPU’s to surpass your customers’ expectations. 
Successful Software Project
Edit Template

GPU software development teams often run into roadblocks they can’t move on their own. LunarG is the industry’s leading problem-solving partner for GPU programming. We provide the tools, expertise, and passion you need to keep moving forward and deliver innovative, quality products. Let us know how we can help your next project succeed.

LunarG Email List

Join our email list to receive important news about Vulkan SDK releases, ecosystem surveys, and more.

You have been successfully subscribed! Oops! Something went wrong, please try again.

© 2025 LunarG, Inc. All Rights Reserved.   |   Privacy   |   Terms   |    Follow LunarG