Commit Graph

20 Commits

Author SHA1 Message Date
Yonggang Luo 9caa6bb71a glx: Convert tab to space in applegl_glx.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Adam Jackson 01ba8a8d02 glx: Implement GLX_EXT_no_config_context
This is the GLX counterpart to EGL_KHR_no_config_context. Contexts may
now be created without reference to an fbconfig, in which case it is
treated as compatible with any fbconfig (and thus any GLX drawable).

Khronos: https://github.com/KhronosGroup/OpenGL-Registry/pull/102

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8999>
2021-04-23 21:15:19 +00:00
Adam Jackson a2b474c333 glx: Move {Bind,Release}TexImage from context to screen vtable
All the other operations on drawables live there, be consistent.

Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9992>
2021-04-13 22:58:58 +00:00
Adam Jackson 621b3a4041 glx: Pull get_proc_address out of the context vtable
One, only applegl needs this. Two, this isn't a function of the context
in any way so it doesn't belong in the context vtable. Just special-case
applegl for now, we can revisit applegl's dispatch later.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9690>
2021-03-19 11:13:07 -04:00
Adam Jackson cba1d6de22 glx: Pull use_x_font out of the context vtable
The client-side implementation of this operates entirely in terms of the
GL and X client APIs. There's nothing DRI-specific about it, evidenced
by apple and windows using it unchanged. Save a little code size by
handling the direct/indirect difference directly.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9690>
2021-03-19 11:13:07 -04:00
Adam Jackson a14e3b43be Revert "glx: Implement GLX_EXT_no_config_context"
This reverts commit 0d635ccc91.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1207
2019-09-26 11:07:13 -04:00
Adam Jackson 0d635ccc91 glx: Implement GLX_EXT_no_config_context
This is the GLX counterpart to EGL_KHR_no_config_context. Contexts may
now be created without reference to an fbconfig, in which case it is
treated as compatible with any fbconfig (and thus any GLX drawable).

Khronos: https://github.com/KhronosGroup/OpenGL-Registry/pull/102
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2019-09-23 20:39:01 -04:00
Jon TURNEY 5a459a036e Fix build of appleglx
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/Makefile.am for srcdir != builddir

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-05-23 15:24:07 +01:00
Emil Velikov 31a3b58cb7 glx/apple: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set applegl_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Matt Turner 6bda027e01 Use calloc instead of malloc/memset-0
This patch has been generated by the following Coccinelle semantic
patch:

@@
expression E;
identifier I;
@@
- I = malloc(E);
+ I = calloc(1, E);
...
- memset(I, 0, sizeof *I);

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner 7c7b7b068b Remove Xcalloc/Xmalloc/Xfree calls
These calls allowed Xlib to use a custom memory allocator, but Xlib has
used the standard C library functions since at least its initial import
into git in 2003. It seems unlikely that it will grow a custom memory
allocator. The functions now just add extra overhead. Replacing them
will make future Coccinelle patches simpler.

This patch has been generated by the following Coccinelle semantic
patch:

// Remove Xcalloc/Xmalloc/Xfree calls

@@ expression E1, E2; @@
- Xcalloc (E1, E2)
+ calloc (E1, E2)

@@ expression E; @@
- Xmalloc (E)
+ malloc (E)

@@ expression E; @@
- Xfree (E)
+ free (E)

@@ expression E; @@
- XFree (E)
+ free (E)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:49 -07:00
Jeremy Huddleston 5c44c1348e apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24 16:21:28 -07:00
Jeremy Huddleston 559e4f8ebc glx: Allow a context-specific fallback for glXGetProcAddress
In applegl, GLX advertises the same extensions provided by OpenGL.framework
even if such extensions are not provided by glapi.  This allows a client
to get access to such API.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-20 16:54:58 -07:00
Jeremy Huddleston a128355ecb apple: Set the glapi dispatch table on context bind
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-14 00:48:20 -07:00
Jeremy Huddleston c6cf82fb55 apple: applegl_destroy_context: Pass along the correct display
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston e903cc17bb apple: Dead code removal
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-13 14:51:01 -07:00
Jeremy Huddleston 2ee5272e16 apple: Finish build fixes for applegl_glx.c
libGL.dylib now *builds* on darwin.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:27:19 -04:00
Jeremy Huddleston 7c5f37c032 apple: More fixes for compilation failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-06 11:17:38 -04:00
Jeremy Huddleston 5d35343d12 apple: Fix multiple build failures in applegl_glx.c
It is still not building, but this gets us many steps closer

See https://bugs.freedesktop.org/show_bug.cgi?id=29162

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-05 21:25:27 -04:00
Kristian Høgsberg 6849916170 glx: Split indirect and applegl implementations into different files 2010-07-28 16:45:25 -04:00