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

[shader builder] improve verification of shaders

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 6.1.0 Beta3
    • Fix Version/s: 6.1.1, 6.2
    • Component/s: Qt RHI
    • Labels:
      None
    • Commits:
      5a3ac0157c4b11d09bcbce3c59c3134ac119dd8c, 64e1ae71b35cfc3202f8dc876ca39f16207bf889

      Description

      porting one of my shaders to qt6, i found one problem by chance: my shader worked for macos/metal, but it did not work on linux/opengl. running macos/opengl i eventually got a run-time error:

      Failed to build graphics pipeline state
      Failed to link shader program: WARNING: Output of vertex shader 'vTexCoord' not read by fragment shader
      ERROR: Input of fragment shader 'texCoord' not written by vertex shader

      my vertex shader was using using the output variable vTexCoord

      layout(location = 0) in vec4 aVertex;
      layout(location = 1) in vec2 aTexCoord;
      layout(location = 0) out vec2 vTexCoord;
      

       
      while the fragment shader was using the input variable texCoord

      layout(location = 0) in vec2 texCoord;
      layout(location = 0) out vec4 fragColor;
      

      the fix for this is obviously simple, the diagnostic not so much (as the opengl driver on linux silently failed instead of giving an error message). so i wonder if rhi could verify the names without relying on the driver?

        Attachments

        For Gerrit Dashboard: QTBUG-93370
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes