1. 15 Apr, 2021 1 commit
  2. 13 Apr, 2021 1 commit
    • Adam Jackson's avatar
      glx: Lift sending the MakeCurrent request to top-level code · 80b67a3b
      Adam Jackson authored
      Somewhat terrifyingly, we never sent this for direct contexts, which
      means the server never knew the context/drawable bindings. To handle
      this sanely, pull the request code up out of the indirect backend, and
      rewrite the context switch path to call it as appropriate.  This
      attempts to preserve the existing behavior of not calling unbind() on
      the context if its refcount would not drop to zero.
      
      Of course, you can't just do this indiscriminately, because this is GLX
      and extant X servers have bugs and everything is terrible. To wit:
      
      - For 1.20.x prior to 1.20.6, you can bind a direct context once, but
      the second time you try to modify the context's binding you will get
      GLXBadContextTag. This includes unbinding the context. And "deleting"
      the context will leak memory, because it will still appear to be
      current.
      
      - For 1.19 and earlier, glXMakeCurrent(dpy, None, ctx) should be legal
      for GL 3.0+ contexts, but the server will throw BadMatch.
      
      To guard against this, we only send the request for indirect contexts
      unless the server is known good, and only mention one context at a time
      in such a request; if switching between contexts, we first unbind the
      old, and then bind the new. Note that the second VendorRelease() version
      is to catch XFree86 4.x and Xorg [67].x, which almost certainly have the
      above bugs. Other servers might report different version numbers here,
      but we can't do direct rendering against them, so this should be safe.
      
      Fixes: mesa/mesa#4418
      
      Acked-By: Mike Blumenkrantz's avatarMike Blumenkrantz <michael.blumenkrantz@gmail.com>
      Part-of: <mesa/mesa!9992>
      80b67a3b
  3. 26 Sep, 2019 1 commit
  4. 24 Sep, 2019 2 commits
    • Adam Jackson's avatar
      glx: Lift sending the MakeCurrent request to top-level code · 999c2aed
      Adam Jackson authored
      Somewhat terrifyingly, we never sent this for direct contexts, which
      means the server never knew the context/drawable bindings. To handle
      this sanely, pull the request code up out of the indirect backend, and
      rewrite the context switch path to call it as appropriate.  This
      attempts to preserve the existing behavior of not calling unbind() on
      the context if its refcount would not drop to zero.
      
      Of course, you can't just do this indiscriminately, because this is GLX
      and extant X servers have bugs and everything is terrible. To wit:
      
      - For 1.20.x prior to 1.20.6, you can bind a direct context once, but
      the second time you try to modify the context's binding you will get
      GLXBadContextTag. This includes unbinding the context. And "deleting"
      the context will leak memory, because it will still appear to be
      current.
      
      - For 1.19 and earlier, glXMakeCurrent(dpy, None, ctx) should be legal
      for GL 3.0+ contexts, but the server will throw BadMatch.
      
      To guard against this, we only send the request for indirect contexts
      unless the server is known good, and only mention one context at a time
      in such a request; if switching between contexts, we first unbind the
      old, and then bind the new. Note that the second VendorRelease() version
      is to catch XFree86 4.x and Xorg [67].x, which almost certainly have the
      above bugs. Other servers might report different version numbers here,
      but we can't do direct rendering against them, so this should be safe.
      
      Fixes glx-make-context, glx-multi-window-single-context and
      glx-query-drawable-glx_fbconfig_id-window. Sufficiently old piglit will
      regress on glx-make-glxdrawable-current (throwing BadMatch), which is
      fixed by mesa/piglit!116.
      999c2aed
    • Adam Jackson's avatar
      glx: Move vertex array protocol state into the indirect backend · 01e43798
      Adam Jackson authored
      Only relevant for indirect contexts, so let's get that code out of the
      common path.
      01e43798
  5. 03 Aug, 2019 1 commit
  6. 09 Jul, 2018 1 commit
  7. 01 Dec, 2017 1 commit
  8. 08 Jul, 2016 1 commit
    • Colin McDonald's avatar
      glx: Call __glXInitVertexArrayState() with a usable gc. · d57c85c1
      Colin McDonald authored
      For each indirect context the indirect vertex array state must be initialised
      by __glXInitVertexArrayState in indirect_vertex_array.c.  As noted in the
      routine header it requires that the glx context has been setup prior to the
      call, in order to test the server version and extensions.
      
      Currently __glXInitVertexArrayState is called from indirect_bind_context in
      indirect_glx.c, as follows:
      
         state = gc->client_state_private;
         if (state->array_state == NULL) {
            glGetString(GL_EXTENSIONS);
            glGetString(GL_VERSION);
            __glXInitVertexArrayState(gc);
         }
      
      But, the gc context is not yet usable at this stage, so the server queries
      fail, and __glXInitVertexArrayState is called without the server version and
      extension information it needs.  This breaks multi-texturing as
      glXInitVertexArrayState doesn't get GL_MAX_TEXTURE_UNITS.  It probably also
      breaks setup of other arrays: fog, secondary colour, vertex attributes.
      
      To fix this I have moved the call to __glXInitVertexArrayState to the end of
      MakeContextCurrent in glxcurrent.c, where the glx context is usable.
      
      Fixes a regression caused by commit 4fbdde88
      
      . Fixes ARB_vertex_program
      usage in the arbvparray Mesa demo when run with indirect GLX and also
      the tex-skipped-unit piglit test when run with indirect GLX.
      Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
      Acked-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61907
      d57c85c1
  9. 30 May, 2016 1 commit
    • Kyle Brenneman's avatar
      glx: Implement the libglvnd interface. · 22a9e00a
      Kyle Brenneman authored
      With reference to the libglvnd branch:
      
      https://cgit.freedesktop.org/mesa/mesa/log/?h=libglvnd
      
      
      
      This is a squashed commit containing all of Kyle's commits, all but two
      of Emil's commits (to follow), and a small fixup from myself to mark the
      rest of the glX* functions as _GLX_PUBLIC so they are not exported when
      building for libglvnd. I (ajax) squashed them together both for ease of
      review, and because most of the changes are un-useful intermediate
      states representing the evolution of glvnd's internal API.
      
      Co-author: Emil Velikov <emil.velikov@collabora.com>
      Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      22a9e00a
  10. 11 Mar, 2015 2 commits
  11. 06 Mar, 2015 4 commits
  12. 23 May, 2014 1 commit
    • Jon Turney's avatar
      Fix build of appleglx · 5a459a03
      Jon Turney authored
      Define GLX_USE_APPLEGL, as config/darwin used to, to turn on specific code to
      use the applegl direct renderer
      
      Convert src/glx/apple/Makefile to automake
      
      Since the applegl libGL is now built by linking libappleglx into libGL, rather
      than by linking selected files into a special libGL:
      
      - Remove duplicate code in apple/glxreply.c and apple/apple_glx.c.  This makes
      apple/glxreply.c empty, so remove it
      
      - Some indirect rendering code is already guarded by !GLX_USE_APPLEGL, but we
      need to add those guards to indirect_glx.c, indirect_init.c (via it's
      generator), render2.c and vertarr.c so they don't generate anything
      
      Fix and update various includes
      
      glapi_gentable.c (which is only used on darwin), should be included in shared
      glapi as well, to provide _glapi_create_table_from_handle()
      
      Note that neither swrast nor indirect is supported in the APPLEGL path at the
      moment, which makes things more complex than they need to be.  More untangling
      is needed to allow that
      
      v2: Correct apple/Make...
      5a459a03
  13. 05 Mar, 2014 1 commit
    • Brian Paul's avatar
      mesa: remove remaining uses of _glthread_GetID() · 02cb04c6
      Brian Paul authored
      
      
      It was really only used in the radeon driver for a debug printf.
      And evidently, libGL.so referenced it just to work around some sort
      of linker issue.
      
      This patch removes the two calls to the function and the function
      itself.
      
      Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'.
      Though, the missing symbol doesn't cause any issues on my system but
      it does cause glxinfo to fail on one of our test systems.
      Reviewed-by: Jose Fonseca's avatarJose Fonseca <jfonseca@vmware.com>
      02cb04c6
  14. 08 Oct, 2013 1 commit
    • Adam Jackson's avatar
      glx: Generate fewer errors in MakeContextCurrent · e166a58c
      Adam Jackson authored
      
      
      For a few reasons.
      
      1: In the (current) common case, these conditionals are never true. All
      we're doing by checking them is slowing down MakeCurrent.  The server
      does these checks already anyway.
      
      2: GLX >= 3.0 contexts may legally be made current without a bound
      framebuffer.
      
      This does not fix piglit/glx-create-context-current-no-framebuffer, but
      is a prerequisite for fixing it.
      
      Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
      Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
      Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
      e166a58c
  15. 01 Oct, 2012 1 commit
  16. 21 Jun, 2011 1 commit
  17. 20 Jun, 2011 2 commits
  18. 17 Jun, 2011 1 commit
  19. 08 Jun, 2011 1 commit
  20. 06 Jun, 2011 2 commits
  21. 10 Mar, 2011 1 commit
    • Brian Paul's avatar
      glx: fix null pointer deref in __glXGenerateError() · 76a43c5f
      Brian Paul authored
      The gc var would be NULL if called from line 238.  Instead, get
      the opcode from __glXSetupForCommand(dpy) as done in other places.
      And remove the unused gc parameter.
      
      Fixes a bug reported by "John Doe" on 3/9/2011.
      
      NOTE: This is a candidate for the 7.10 branch.
      76a43c5f
  22. 26 Feb, 2011 1 commit
    • Emma Anholt's avatar
      mesa: Add new MESA_multithread_makecurrent extension. · 49d7e48b
      Emma Anholt authored
      This extension allows a client to bind one context in multiple threads
      simultaneously.  It is then up to the client to manage synchronization of
      access to the GL, just as normal multithreaded GL from multiple contexts
      requires synchronization management to shared objects.
      49d7e48b
  23. 09 Sep, 2010 1 commit
  24. 08 Sep, 2010 2 commits
  25. 07 Sep, 2010 1 commit
  26. 29 Jul, 2010 1 commit
  27. 28 Jul, 2010 6 commits