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.

Continue reading “New Automatic Relaxed Precision White Paper for SPIR-V”

Vulkan GPU-Assisted Validation

LunarG updates the GPU-Assisted Validation white paper to reflect new validation available for situations when the VK_EXT_descriptor_indexing extension is enabled. LunarG originally released GPU-Assisted validation with the Vulkan 1.1.97.0 SDK.  Read on for more information about this new validation and its description in the updated LunarG GPU-Assisted Validation white paper.

Continue reading “White paper update available for new Vulkan GPU-assisted validation”

LunarG updates spirv-opt white paper

LunarG has updated its white paper that describes using spirv-opt to reduce SPIR-V size. This revision includes many changes made since the last update in December 2017.

Continue reading “LunarG updates spirv-opt white paper”

LunarG is pleased to announce the release of a new option in spirv-opt, which was designed to reduce SPIR-V size. This new option, -Os, allows developers to reduce SPIR-V size without specifying individual passes of spirv-opt.

Continue reading “A Simpler Way to Reduce Vulkan SPIR-V Size with New spirv-opt -Os”

Use SPIR-V tools for Vulkan compliant shaders

Vulkan developers: Are you generating SPIR-V shaders from HLSL using glslangValidator built from https://github.com/KhronosGroup/glslang?

In order to guarantee that your SPIR-V is legal for Vulkan, you must now include spirv-tools when building glslang. This can be done by running update_glslang_sources.py located in the glslang home directory before the configuration cmake step. This clones the latest “known-good” version of spirv-tools into the glslang/External directory.

If spirv-tools is not included in glslang, a warning is printed during the configuration cmake call stating that illegal SPIR-V may be generated for HLSL shaders.

Starting with the next LunarG Vulkan SDK release, the glslangValidator executable included in the SDK will be built with spirv-tools included.

The SPIR-V is made legal by using spirv-opt, the optimizer from spirv-tools. The HLSL shading language requires certain optimizations to allow for generation of SPIR-V that is legal for Vulkan.

The optimizer in glslang can be disabled with the -Od option, although the resulting SPIR-V may not be legal for Vulkan if generated from HLSL.

Note that the optimizer in glslang is not invoked for GLSL shaders by default. If you wish to optimize SPIR-V for size, glslang now offers the -Os option. This can be invoked when compiling from both HLSL and GLSL shaders. This option is only available if spirv-tools was included during the glslang build.

Complete instructions for building glslang can be found in the README.md file in the glslang home directory.

Reduce SPIR-V size with spirv-opt enhancements

LunarG is pleased to announce the release of new options in spirv-opt designed to reduce SPIR-V size.

We have introduced passes to spirv-opt that use classic code optimization techniques to address code inefficiencies in a SPIR-V module. Combined with spirv-remap , which we use to remove module-level dead types and functions, these passes can reduce raw SPIR-V size by over 60%, and bring SPIR-V sizes within 40% of DX Byte Code.

Continue reading “Reduce SPIR-V size with spirv-opt enhancements”