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

Single QSGRenderNode-based element in the scene with "clip" property enabled is not rendered

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.15.7
    • 5.12.1, 5.15.2, 6.1.3, 6.2.0 Beta4
    • Quick: Other
    • None
    • Windows
    • 383b70aba1e27adb3e836db6f41edd2c8b6275ef (qt/tqtc-qtdeclarative/5.15)

      While using a custom render item based on QSGRenderNode which has the clip property enabled (setClip(true)), the clip/scissor  rectangle seems to be calculated wrongly in a rare case when this element is the only element in the scene.

      Debugging & looking into the 5.12 sources (qsgbatchrenderer.cpp) it seems that in that in this case the renderRenderNode() call is used to draw the scene instead of the usual "render(Un)MergedBatch".

      Inside the renderRenderNode () call is a call to updateClip() which jumps to updateStencilClip() and calculates the clip rectangle using the variable "m_current_projection_matrix", but it is not initialized in this code path and the calculation seems wrong.

       

      This is alleviated and "m_current_projection_matrix" is initialized correctly in the "typical" render(Un)MergedBatch code path by a piece of code below:

       

          m_current_projection_matrix = projectionMatrix();

          // updateClip() uses m_current_projection_matrix.

          updateClip(gn->clipList(), batch);

                     

      Such initialization is missing in the renderRenderNode() before calling updateClip() - which leads to the error I believe.

       

      After adding a simple rectangle to the scene the clip values get a proper initialization and the element is rendered correctly.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            miloszlazurek Milosz Lazurek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes