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

Devise a simple, cross-API way to expose driver strings and IDs in the (private) QRhi API

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • 6.1
    • None
    • Qt RHI
    • None

    Description

      Below are snippets from the rhi backends that log relevant information about the graphics API implementation during QRhi::create().

      A subset of these could be placed into a simple struct queriable from the QRhi instance. This would then allow doing the traditional blacklisting or feature branching, when absolutely necessary, especially when it comes to less-than-stellar OpenGL implementations in the embedded/mobile space. (even though we should try staying away from such hacks as much as possible in Qt 6+, leaving it as a last resort solution for critical cases only)

      Finding a common subset of information is not necessarily straightforward, given that the only common thing here is a single string, with some APIs providing additional strings, whereas others providing additional ID numbers for various things.

          qCDebug(QRHI_LOG_INFO, "Physical device %d: '%s' %d.%d.%d (api %d.%d.%d vendor 0x%X device 0x%X type %d)",
      	    i,
      	    physDevProperties.deviceName,
      	    VK_VERSION_MAJOR(physDevProperties.driverVersion),
      	    VK_VERSION_MINOR(physDevProperties.driverVersion),
      	    VK_VERSION_PATCH(physDevProperties.driverVersion),
      	    VK_VERSION_MAJOR(physDevProperties.apiVersion),
      	    VK_VERSION_MINOR(physDevProperties.apiVersion),
      	    VK_VERSION_PATCH(physDevProperties.apiVersion),
      	    physDevProperties.vendorID,
      	    physDevProperties.deviceID,
      	    physDevProperties.deviceType);
      
      const char *vendor = reinterpret_cast<const char *>(f->glGetString(GL_VENDOR));
      const char *renderer = reinterpret_cast<const char *>(f->glGetString(GL_RENDERER));
      const char *version = reinterpret_cast<const char *>(f->glGetString(GL_VERSION));
      if (vendor && renderer && version)
          qCDebug(QRHI_LOG_INFO, "OpenGL VENDOR: %s RENDERER: %s VERSION: %s", vendor, renderer, version);
      
                  qCDebug(QRHI_LOG_INFO, "Adapter %d: '%s' (vendor 0x%X device 0x%X flags 0x%X)",
                          adapterIndex,
                          qPrintable(name),
                          desc.VendorId,
                          desc.DeviceId,
                          desc.Flags);
      
          qCDebug(QRHI_LOG_INFO, "Metal device: %s", qPrintable(QString::fromNSString([d->dev name])));
      

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            lagocs Laszlo Agocs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes