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

Qt.point not properly passed to ivec2 uniform in ShaderEffect

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0
    • Quick: SceneGraph
    • None
    • macOS

    Description

      Using ShaderEffect with a shader that has an ivec2 uniform, passing Qt.point() seems to pass the wrong value, with no warning/error.

      It works properly with a vec2 uniform.

      The attached project has a fragment shader conditionally compiled with an ivec2 uniform, or a vec2 uniform. The QML then passes in a Qt.point(1, 1) property for the uniform. The shader draws red if the uniform x is >=100.0, blue if >=1.0 else green.

      It correcly draws blue when using vec2, and draws red when using ivec2.
      Possibly it is passing the floating point binary representation of 1.0 as an integer into the uniform (which I think would be 1065353216). Yeah, confirmed this - if I change the test to >=1065353216 it still draws red, but >=1065353217 now draws blue.

      Attachments

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

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            rectalogic Andrew Wason
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes