Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74406 Abstract away the graphics APIs in Qt
  3. QTBUG-78593

Shadertools: generate intermediate formats for D3D and Metal at shader processing time and include those in the .qsb packages



    • Technical task
    • Resolution: Duplicate
    • P2: Important
    • 6.0
    • Qt RHI
    • None


      Qt Shader Tools: how to expand the pre-compilation story.

      qsb can be requested to invoke fxc or the Metal command-line tools to include DXBC or .metallib binaries instead of source in the .qsb. This only works when building on Windows/macOS of course.

        -c, --fxc                    In combination with --hlsl invokes fxc to store
                                     DXBC instead of HLSL.
        -t, --metallib               In combination with --msl builds a Metal library
                                     with xcrun metal(lib) and stores that instead of
                                     the source.

      The Metal and D3D11 backends of QRhi are already prepared for picking the intermediate format from the QShader package, if such a version of the shader is available in it.

      When manually doing the processing and calling qsb this is not ideal (because one may want to do it on Linux where the external tools are not available). If the build system integration happens however, that is a great opportunity because we can then invoke the right tools (so we could always include DX bytecode in the .qsb instead of HLSL sources)

      The goal here is to ensure that the build system integration runs qsb with the parameters that are best suited for the platform we are building for. May also tie in to QTBUG-78592 to some extent (as post-processing the SPIR-V binary output by glslang is conceptually the same from shadertool's perspective as post-processing the GLSL/HLSL/MSL source output by SPIRV-Cross)

      Note: This does not include the vendor-specific mess APIs like OpenGL. Only the well-tooled, vendor-controlled APIs are in scope here: Metal and Direct3D. Vulkan does not need this by nature.


        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.



              lagocs Laszlo Agocs
              lagocs Laszlo Agocs
              0 Vote for this issue
              1 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes