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

unable to share texture in two offscreen glcontext

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P0: Blocker
    • None
    • 5.15.8
    • GUI: OpenGL
    • None
    • win10 64 bit
    • Windows

    Description

      Project Require:

      I have 3 threads in my project:

         thread 1 product a texture (call A) then push to thread 2

         thread 2 recieve the texture A from thread 1 and render to a new texture create by  thread 2(call B),then delete texture A and  push texutre B to thread 3

         thread 3(ui thread ) recieve texture B and display

      My Struct:

         I create 2 thread with each one has a (QOffscreenSurface+QOpenGLContext) and makeCurrent it when thread run() start,and I use QOpenGLContext::setSharedContext() by:

         thread 1 -> setSharedContext(thread 2);

         thread 2 -> setSharedContext(thread 3);

       

      however I can run normal on mac ,but failed on windows;

       

      then I create a simple demo just create texture in texture 1 then delete it on thread 2,it also not work and I got this error:

       

      ARB::createContext: wglCreateContextAttribsARB() failed (GL error code: 0x502) for format: QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile QSurfaceFormat::NoProfile), shared context: 0x30000 (操作成功 完成。)
      GDI::createContext: wglShareLists() failed. (请求的资源在使用中。)
      context=0000000000020001,surface=0000000072010AAC,display=00000000001405B0

       

      Demo can also run normal on mac,and I search google somebody tell me use QT_OPENGL=angle ,but in my project other module use wgl so I cann't use this function

       

      I post my demo below,I can run normal on mac ,but on windows it seem shareContext failed,when I glDeleteTextures I seem no work and memory group very fast

       

      My Environment:

      Windows 10 Enterprise LTSC 2019 64 bit   

      Qt:5.15.8

      GPU: NVIDIA GTX 970  driver version:497.29

       

      Mac OSX 10.15  Qt:5.18.8

       

      please help me .

       

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            xvjinkun xv jinkun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes