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

    XMLWordPrintable

Details

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

    Description

      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.
       

      Attachments

        Issue Links

          Activity

            People

              lagocs Laszlo Agocs
              lagocs Laszlo Agocs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: