1. 01 Oct, 2019 - 3 commits
  2. 30 Sep, 2019 - 7 commits
    • Laszlo Agocs's avatar
      rhi: Speed up buffer and texture tracking · 9e59024b
      Laszlo Agocs authored
      
      Task-number: QTBUG-78862
      Change-Id: If278bd55530081cbbdbab8dd6e14d86e28da558e
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      9e59024b
    • Laszlo Agocs's avatar
      Remove QVector in the API of QRhiResource subclasses · 7000b66f
      Laszlo Agocs authored
      
      Forcing users to go through a QVector, when in practice they almost
      always want to source the data from an initializer list, a QVarLengthArray,
      or a plain C array, is not ideal. Especially since we can reason about
      the maximum number of elements in the vast majority of use cases for all
      the affected lists. QRhiResource is also not copyable so we do not need
      the usual machinery offered by containers. So switch to a
      QVarLengthArray.
      
      Note that a resource is not a container. The only operations we are
      interested in is to be able to source data either via an initializer
      list or by iterating on something, and to be able to extract the data,
      in case a user wishes to set up another resource based on the existing
      one.
      
      In some cases a QVector overload is kept for source compatibility with
      other modules (Qt Quick). These may be removed in the future.
      
      Also do a similar QVector->QVarLengthArray change in the srb-related
      data in the backends.
      
      Change-Id: I6f5b2ebd8e75416ce0cca0817bb529446a4cb664
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      7000b66f
    • Laszlo Agocs's avatar
      De-d-pointer QRhiShaderResourceBinding · d4c17725
      Laszlo Agocs authored
      
      Sad to see this go since the d pointer pattern with implicit sharing
      would have been perfect for this class, had this been a public API.
      
      However, as binary compatibility will not be a concern for QRhi classes,
      it is wasteful to allocate memory on every QRhiShaderResourceBinding.
      This allows users, such as Qt Quick, to use QRhiShaderResourceBinding as
      a cheap, simple, value class, without having to invent their own
      alternatives in performance critical places.
      
      The change brings a not insignficant improvement in certain qmlbench scenes
      (the ones with thousands of unbatched geometry nodes).
      
      Change-Id: I6d1dced6498d9ad625f90ead78bc0a417ea99ed8
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      d4c17725
    • Laszlo Agocs's avatar
      Share and enable shader disk cache in QRhi OpenGL backend · e1ed2c38
      Laszlo Agocs authored
      
      The expectation for it is to function identically to what we get with
      QOpenGLShaderProgram. (same environment variables, same logging
      categories, etc.).
      
      QOpenGLProgramBinaryCache is now shared between the QOpenGL convenience
      classes (like QOpenGLShaderProgram) and QRhi. To achieve more modularity
      and to prepare for QOpenGLShaderProgram and friends moving out of QtGui,
      this class cannot depend on QOpenGLShader* anymore. This involves adding
      some minor conversions between QRhi and QOpenGL enums for example.
      
      Change-Id: I2f4664e074823ea536281aea8006a6db159a7381
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      e1ed2c38
    • Liang Qi's avatar
    • Edward Welbourne's avatar
      Featurize support for signaling NaN · 4bd6cd19
      Edward Welbourne authored
      
      One of our compilers for emscripten coerces all signaling NaNs to
      quiet ones, so won't do any actual signaling. Anyone relying on them
      to do so shall be disappointed, so it's better that they know about it
      at compile-time - or, at least, have the ability to find it out.
      
      Put the signaling NaN producers (and remaining (test) code using them)
      under the control of a feature that's disabled when numeric_limits
      claims double has no signaling NaN. Assume the bootstrap library
      doesn't need signaling NaNs. Sadly, until C++20 <bit>, there's no
      contexpr way to test that alleged signalling and quiet NaNs are
      actually distinct.
      
      Added some auto-tests for signaling NaN, including that it's distinct
      from quiet NaN. Any platform on which the last fails should disable
      this feature.
      
      Task-number: QTBUG-77967
      Change-Id: I57e9d14bfe276732cd313887adc9acc354d88f08
      Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@qt.io>
      4bd6cd19
    • Liang Qi's avatar
      Merge remote-tracking branch 'origin/5.13' into 5.14 · 99cdd5fc
      Liang Qi authored
       Conflicts:
      	src/corelib/global/qrandom.cpp
      	src/corelib/io/qfileinfo.cpp
      	src/corelib/kernel/qeventdispatcher_win.cpp
      	src/corelib/kernel/qeventdispatcher_win_p.h
      	src/gui/text/qfontdatabase.cpp
      	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
      	src/plugins/platforms/windows/qwindowsglcontext.cpp
      	src/testlib/qtestcase.cpp
      
      Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
      Done-With: Edward Welbourne <edward.welbourne@qt.io>
      Change-Id: I4893212471aa24be804c989a581810e2f714545c
      99cdd5fc
  3. 29 Sep, 2019 - 1 commit
    • Laszlo Agocs's avatar
      Ensure drawable size atomicity within a frame · 86876744
      Laszlo Agocs authored
      
      Revert surfacePixelSize() to be a getter only. With Metal this will
      mean returning the "live" layer size (and so not the
      layer.drawableSize), which is in line with what we expect with other
      backends.
      
      Instead, we leave it to the swapchain's buildOrResize() to "commit"
      the size by setting drawableSize on the layer. With typical
      application or Qt Quick logic this ensures that layer.drawableSize is
      set once and stays static until we get to process the next resize - on
      the rendering thread.
      
      This of course would still mean that there was a race when a client
      queries surfacePixelSize() to set the depth-stencil buffer size that
      is associated with a swapchain. (because that must happen before
      calling buildOrResize() according to the current semantics)
      
      That can however be solved in a quite elegant way, it turns out,
      because we already have a flag that indicates if a QRhiRenderBuffer is
      used in combination with (and only in combination with) a
      swapchain. If we simply say that setting the UsedWithSwapChainOnly
      flag provides automatic sizing as well (so no setPixelSize() call is
      needed), clients can simply get rid of the problematic
      surfacePixelSize() query and everything works.
      
      Task-number: QTBUG-78641
      Change-Id: Ib1bfc9ef8531bcce033d1f1e5d4d5b4984d6d69f
      Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@qt.io>
      86876744
  4. 28 Sep, 2019 - 12 commits
  5. 27 Sep, 2019 - 9 commits
  6. 26 Sep, 2019 - 8 commits
    • Dmitry Kazakov's avatar
      Fix QRandomGenerator initialization on AMD CPUs · 5839714d
      Dmitry Kazakov authored
      
      Some AMD CPUs (e.g. AMD A4-6250J and AMD Ryzen 3000-series) have a
      failing random generation instruction, which always returns
      0xffffffff, even when generation was "successful".
      
      This code checks if hardware random generator generates four consecutive
      equal numbers. If it does, then we probably have a failing one and
      should disable it completely.
      
      Change-Id: I38c87920ca2e8cce4143afbff5e453ce3845d11a
      Fixes: QTBUG-69423
      Reviewed-by: default avatarEdward Welbourne <edward.welbourne@qt.io>
      5839714d
    • Laszlo Agocs's avatar
      rhi: gl: Fix not resetting color write bits when switching pipeline · fc8d6d3e
      Laszlo Agocs authored
      
      This was visible in the triquadcube test when enabling transparent window
      background: the cube on the left was rendered incorrectly because alpha
      was not written out due to not setting glColorMask() back to the defaults
      when switching to another pipeline.
      
      Change-Id: I7a8c94072e0b68a58fffcc8c1a200e3940dcad44
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      fc8d6d3e
    • Laszlo Agocs's avatar
      Move cache key calculation to QOpenGLProgramBinaryCache · 0628932f
      Laszlo Agocs authored
      
      This class will likely be used by the OpenGL backend of QRhi as well.
      Therefore, we need to make it more self-contained and independent.
      
      Change-Id: If046ed41e25c70cc9abb45219b451f9179feaa1c
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      0628932f
    • Laszlo Agocs's avatar
      rhi: metal: Eliminate redundant setCullMode and setFrontFaceWinding calls · c06627a2
      Laszlo Agocs authored
      
      Task-number: QTBUG-78605
      Change-Id: Icc3a9636055b5f45418da28cc05aa02e19370c02
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      c06627a2
    • Laszlo Agocs's avatar
      rhi: Add a --transparent option to manual tests · 22d22eb2
      Laszlo Agocs authored
      
      This will also cause clearing to 0,0,0,0.
      
      Essential in order to allow fast testing of window transparency
      issues in combination with QRhi and the various backends.
      
      Change-Id: Iee2763c1d06f1d3e5d59a9142abaf30fab1dc543
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      22d22eb2
    • Laszlo Agocs's avatar
      rhi: Unify handling of special cases for scissor and viewport rects · 30e27328
      Laszlo Agocs authored
      
      With OpenGL a scissor (or viewport) rectangle is not allowed to have a negative
      width or height. Everything else is allowed. This is also the semantic we wish to
      keep for QRhiViewport and QRhiScissor.
      
      This raises some problems. For instance, when we do bottom-left - top-left
      rectangle conversion, the case of partially out of bounds rects needs to be
      taken into account.
      
      Otherwise, Qt Quick ends up in wrong scissoring in certain cases, typically when
      the QQuickWindow size is decreased so the content does not fit because that will
      then start generating negative x, y scissors for clipping (which is perfectly
      valid but the QRhi backends need to be able to deal with it)
      
      Then there is the problem of having to clamp width and height carefully, because
      some validation layers for some APIs will reject a viewport or scissor with
      partially out of bounds rectangles.
      
      To verify all this, add a new manual test, based on the cubemap one. (cubemap was
      chosen because that is an ideal test scene as it fills the viewport completely, and
      so it is visually straightforward when a scissor rectangle is moving around over it)
      
      Fixes: QTBUG-78702
      Change-Id: I60614836432ea9934fc0dbd0ac7e88931f476542
      Reviewed-by: default avatarChristian Strømme <christian.stromme@qt.io>
      30e27328
    • Eskil Abrahamsen Blomfeldt's avatar
      iOS: Fix fallback fonts on iOS 13+ · d5abda31
      Eskil Abrahamsen Blomfeldt authored
      Since iOS 13, the cascade list for the default UI font contains
      meta-families for several writing systems, such as CJK. Since
      these font families were never populated to the database, we ignored
      them in Qt, and thus got missing glyphs for the characters in question.
      
      The fix is to make sure these fonts are populated in the database.
      It contains a partial backport of 922d1950
      
      ,
      which adds the qt_isFamilyPopulated() accessor to allow us to check
      if the family has been populated in the font database. In Qt 5.14,
      there is public API for this in QPlatformFontDatabase, so this is
      a temporary resolution until then.
      
      Fixes: QTBUG-77467
      Change-Id: Ia9ebb8a19ad2367eb764ae1496a52966b465336b
      Reviewed-by: default avatarTor Arne Vestbø <tor.arne.vestbo@qt.io>
      d5abda31
    • Edward Welbourne's avatar
      Fix QCalendar::isValid(): make it const · 06a7aba7
      Edward Welbourne authored
      
      Spotted in API change review, thanks to Albert Astals Cid.
      Also added documentation of this method.
      
      Change-Id: I2ef2c526a98b571a3cb3bb5f93d1952b1b0d63a9
      Reviewed-by: default avatarAlbert Astals Cid <albert.astals.cid@kdab.com>
      06a7aba7