What HLSL->SPIR-V compiler to use?

This page summarizes the projects mentioned and recommended in the original post on /r/vulkan

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • DirectXShaderCompiler

    This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.

    OOP features. HLSL has support for C++ like structs and classes that contain not just data but also methods. This is pretty much just syntactic sugar as it compiles down to flat functions that just take the object as the first parameter, but it might result in cleaner code. What was more useful were interfaces with which you could have some form of polymorphism, but it seems like dxc has cut that feature - https://github.com/microsoft/DirectXShaderCompiler/issues/395. I found it to be useful to define a BRDF in PBR shader code as an interface. That way I could have common lighting code, while also allowing the individual shaders to choose any BRDF they want by simply passing a different implementation, which the lighting code would then call its methods of. This still compiled down to flat code since it's all resolved statically.

  • glslang

    Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.

    From what I can tell, both glslang/shaderc and Microsoft's DirectXShaderCompiler can compile HLSL to SPIR-V code. Is there a consensus on which of these is the better compiler? (wrt to accuracy, optimisations, feature completeness, etc.)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • shaderc

    A collection of tools, libraries, and tests for Vulkan shader compilation.

    From what I can tell, both glslang/shaderc and Microsoft's DirectXShaderCompiler can compile HLSL to SPIR-V code. Is there a consensus on which of these is the better compiler? (wrt to accuracy, optimisations, feature completeness, etc.)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts