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

QOpenGLTexture::isStorageAllocated returns true although allocateStorage failed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.3.2
    • GUI: OpenGL
    • None
    • Arch Linux

    Description

      When requesting a texture that is too big to reside in GPU memory the allocateStorage function fails to actually allocate storage on the GPU. However, at the end of this function the member storageAllocated is unconditionally set to true resulting in isStorageAllocated() returning true incorrectly.

      Either this is intended or not. Depending on this there are several possibilities to fix this:

      It is intended:
      Give this behavior better documentation (e.g. the documentation on allocateStorage and isStorageAllocated should mention this)

      In this case the documentation should also offer a solution to the problem like:
      Check if the texture can be allocated before calling allocateStorage. (There could be a helper function QOpenGLTexture::canBeAllocated to make this easier)

      A bit uglier would be to incorporate calling glGetError after allocateStorage (which would also require to clear the errors before the call) to see if the GL call succeeded.

      It is not intended:
      IMHO the best way would be to automatically check if the request can be fullfilled and if it can't raise an exception or at least let isStorageAllocated return false afterwards. However, the latter might be silently ignored.

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            spynacker Martin Schulze
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes