Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120112

ShaderEffect on WebAssembly doesn't work if it accesses `coord`

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 6.5.2
    • Qt Shader Tools
    • None
    • WebAssembly

    Description

      I am building the following project on a Windows 11 host.

      When built with msvc it works.

      When built with wasm_singlethread it doesn't work, however if you comment out the "kaboom" line, it does work.

      (By "works" I mean: renders a "lightsteelblue" rectangle.)

       

      Note that I also saw lines like the following in the compile log, but it occurs whether or not the "kaboom" line is commented out, and doesn't seem to affect the behaviour of the application:

       [7/20 14.6/sec] Generating .qsb/shaders/solidcolor.frag.qsb
      Failed to run spirv-opt -O C:\Users\chris\AppData\Local\Temp\qsb-CHRmUj\qsb_spv_temp -o C:\Users\chris\AppData\Local\Temp\qsb-CHRmUj\qsb_spv_temp_out: Process failed to start: The system cannot find the file specified.
      [8/20 16.1/sec] Running moc --collect-json for target appshadereffectbug
      [9/20 18.0/sec] Running rcc for resource shaders

       

      EDIT: note that a workaround exists: instead of naming the fragment shader's input "coord" call it "qt_TexCoord0" as that apparently matches what Qt's default texture shader produces for older GLSL versions.  With this workaround in place, it seems to work - but this should at the very least be prominently documented somewhere.

      Attachments

        1. solidcolor.frag
          0.3 kB
        2. Main.qml
          0.3 kB
        3. main.cpp
          0.4 kB
        4. CMakeLists.txt
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            chrisadams Christopher Adams
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes