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

QRhiMetal asserts when a given sampleCount is not supported by a device

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.2.1, 6.3.0 Alpha
    • Component/s: Qt RHI
    • Labels:
      None
    • Environment:
      Macbook Pro 13 (mid-2014)
      Model: MacBookPro11,1, BootROM 430.0.0.0.0, 2 processors, Dual-Core Intel Core i5, 2,6 GHz, 8 GB, SMC 2.16f68
      Graphics: kHW_IntelIrisItem, Intel Iris, spdisplays_builtin
      OS Version: macOS 11.2 (20D64)
    • Platform/s:
      macOS
    • Commits:
      cef788f398568b07c28e2e4f364c84d7006d9ab9 (qt/qtbase/dev) d8ea4448dfc8650f31e1c87e93a99c2ac85176bb (qt/qtbase/6.2)

      Description

      On macos, if an app enables multisampling with 2x, it crashes if the device does not support this sample count

      For example, the attached project (an empty ApplicationWindow) crashes when it runs on a Macbook Pro 13 (mid-2014, MacbookPro11,1) with an Intel Iris graphic card

      -[MTLTextureDescriptorInternal validateWithDevice:]:1248: failed assertion `Texture Descriptor Validation
      MTLTextureDescriptor sampleCount (2) is not supported by device.

       

      ----------

      Thread 8 Crashed:: QSGRenderThread
      0 libsystem_kernel.dylib 0x00007fff204b5462 __pthread_kill + 10
      1 libsystem_pthread.dylib 0x00007fff204e3610 pthread_kill + 263
      2 libsystem_c.dylib 0x00007fff20436720 abort + 120
      3 libsystem_c.dylib 0x00007fff204359d6 __assert_rtn + 314
      4 com.apple.Metal 0x00007fff28567fe4 MTLReportFailure.cold.1 + 43
      5 com.apple.Metal 0x00007fff285561b2 MTLReportFailure + 538
      6 com.apple.Metal 0x00007fff2854ff6a _MTLMessageContextEnd + 987
      7 com.apple.Metal 0x00007fff284b8151 -[MTLTextureDescriptorInternal validateWithDevice:] + 2220
      8 com.apple.driver.AppleIntelHD5000GraphicsMTLDriver 0x00007fff62c5a976 validateTextureDescriptor(MTLTextureDescriptor*, id<MTLBuffer>, MTLIGAccelDevice*) + 81
      9 com.apple.driver.AppleIntelHD5000GraphicsMTLDriver 0x00007fff62c5b949 -[MTLIGAccelDevice newTextureWithDescriptor:] + 41
      10 org.qt-project.QtGui 0x0000000108ad76ee 0x108629000 + 4908782
      11 org.qt-project.QtGui 0x0000000108ade3b1 0x108629000 + 4936625
      12 org.qt-project.QtQuick 0x00000001060c29d2 0x105e00000 + 2894290
      13 org.qt-project.QtQuick 0x00000001060c3b51 0x105e00000 + 2898769
      14 org.qt-project.QtCore 0x00000001097376a8 0x10950c000 + 2274984
      15 libsystem_pthread.dylib 0x00007fff204e3950 _pthread_start + 224
      16 libsystem_pthread.dylib 0x00007fff204df47b thread_start + 15

      ---------

       

      Metal supports 1x and 4x on all devices. 2xand 8x are only supported on some devices (see https://developer.apple.com/documentation/metal/mtldevice/1433355-supportstexturesamplecount?language=objc)

      QRhiMetal should check if a device can support the given sample count by calling supportsTextureSampleCount

       

        Attachments

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

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            lemortalexandre Alexandre Lemort
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes