Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-667

QOpenGLShaderProgram.setUniformValue doesn't work with 1 float

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:

      Description

      When calling a shader program setUniformValue with a single float value, the binding seems to convert it to int or uint and it fails to apply in the associated shaders.**

      Example:

      shader.vs
      
      uniform float param = 1.0;
      
      test.py
      
      program.setUniformValue("param", 5.0)
      

      In this situation, the value of param stays at the default (1.0) instead of being updated to 5.0.

      Another example using vectors works fine:

      shader.vs:
      
      uniform vec2 param2 = vec2(1.0, 1.0);
      
      test.py:
      
      program.setUniformValue("param2", 5.0, 6.0);
      

      In the latest case, the signature is unambiguous (only multiple floats are accepted, not uint or int) and it works.

      Looking at the generated binding, it seems that uint check is done before float check. Maybe that is the problem. How to prioritize the checks from the xml when multiple signatures are grouped in a single function?

       

       

        Attachments

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

          Activity

            People

            • Assignee:
              crmaurei Cristian Maureira-Fredes
              Reporter:
              nitrotm Antony Ducommun
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes