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

QEglFSCompositor::render uses incorrect vertices for full-screen quad resulting in bad texture sampling

    XMLWordPrintable

Details

    Description

      The following code in QEglFSCompositor::render does not correctly map a rectangle onto the -1 to +1 range. The right-hand x value is not width, but width-1 - this results in an upper value slightly smaller than 1. In turn, this can causes texture sampling errors near the center of the screen since nearest sampling is being employed.

      GLfloat x1 = (tl.x() / sr.width()) * 2 - 1;
      GLfloat x2 = (br.x() / sr.width()) * 2 - 1;
      GLfloat y1 = ((sr.height() - tl.y()) / sr.height()) * 2 - 1;
      GLfloat y2 = ((sr.height() - br.y()) / sr.height()) * 2 - 1;
      

      I have tested the following fix which works well:

      GLfloat x1 = (tl.x() / sr.width()) * 2 - 1;
      GLfloat x2 = ((br.x() + 1) / sr.width()) * 2 - 1;
      GLfloat y1 = ((sr.height() - tl.y()) / sr.height()) * 2 - 1;
      GLfloat y2 = ((sr.height() - (br.y() + 1)) / sr.height()) * 2 - 1;
      

      The problem was very noticeable when a full screen of small text was being displayed at 1920x1080 or 1280x720. A vertical and horizontal line of sampling artifacts (showing as smudged text) was visible through the center of the screen.

      Attachments

        1. BadSampling.png
          223 kB
          Gary Sweet
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            gary_j_sweet Gary Sweet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes