Commit Graph

1452 Commits

Author SHA1 Message Date
Yonggang Luo 62a68481fa mapi: Remove usage of USE_ELF_TLS
After commit c47fd3dc00 ("windows: Use TLS context/dispatch with shared-glapi")
USE_ELF_TLS are always defined by
pre_args += '-DUSE_ELF_TLS'
So we can remove it safety

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
2022-07-29 23:59:11 +00:00
Yonggang Luo 6bde428c0a mapi: Trim trailing spaces in stub.c and u_current.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
2022-07-29 23:59:11 +00:00
Jesse Natalie ddbbe96c88 Fix static glapi on Windows
On Linux, the static glapi path sees libGL.so implementing the static
glapi, and the drivers (libgallium_dri.so) updating/reading the TLS
vars.

On Windows, to allow libgallium_wgl.dll to be a full ICD, it's
responsible for implementing the actual static glapi. However, before
this change, OpenGL32.dll was also implementing the static glapi,
meaning that GL API calls from OpenGL32.dll didn't route to the driver
correctly because the TLS vars were never actually set - the driver set
its copy, and OpenGL32.dll read its own copy.

Now, always build a bridge and static version of glapi when not using
shared. The bridge version is linked into OpenGL32.dll, and the static
version is linked into the driver on Windows. GLES only builds with
shared glapi - but after this, shared glapi is not really needed on
Windows for GLES, since the driver has all of the data.

Fixes: f36921ef ("wgl: Refactor drivers to a libgallium_wgl.dll")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6560
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16713>
2022-07-14 20:01:22 +00:00
Jesse Natalie 8f11c0553c mapi: Add more EXT_external_objects_win32 functions/enums
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Adam Jackson 81b0862642 mesa: Stub out GL_APPLE_object_purgeable
There's slots in the glapi static dispatch table (which is still
arguably ABI) which we need to preserve, but we can stop exposing the
extension string or doing anything in the added functions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17425>
2022-07-11 16:37:34 -04:00
Yonggang Luo 1173c0f33a meson: Using get_argument_syntax as the `--compiler_id` option for gen_vs_module_defs.py
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17065>
2022-06-16 19:59:58 +00:00
Yonggang Luo b2ddec4e98 c11: Implement c11/time.h with c11/impl/time.c
Create c11/time.h instead of put timespec_get in `c11/threads.h`

Creating impl folder is used to avoid `#include <time.h>` point the c11/time.h file

Detecting if `struct timespec` present with meson
Define TIME_UTC in `c11/time.h` instead `c11/threads.h`
Define `struct timespec` in `c11/time.h` when not present.
Implement timespec_get in c11/impl/time.c instead threads.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15497>
2022-06-09 17:23:34 +00:00
Qiang Yu 90b34c9184 mapi: add api setup header for hw select mode
Used by GL_SELECT mode dispatch table setup.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15765>
2022-06-06 18:23:49 +00:00
Erik Faye-Lund 75f3373b34 mapi: remove needless c99_compat.h includes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16812>
2022-06-02 13:09:16 +00:00
Sidney Just e1f6273763 mapi: added EXT_external_objects_win32 definitions
Includes implementation stubs

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15504>
2022-05-15 19:56:49 +00:00
Yonggang Luo a3a43e5fa8 win32: Do not use BUILD_GL32, we use def file to export win32 dll symbols.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14041>
2022-04-19 19:38:47 +00:00
Yonggang Luo 4ead2f6579 win32: Fixes 32 bits visual studio module definition files by add script gen_vs_module_defs.py
Getting opengl32*.def consistence with Windows SDK.
Getting osmesa.mingw.def's gl* functions consistence with Windows SDK.
stw_* functions are cdecl, not stdcall, so there is no need mangling the symbol.
Fixes egl.def for x86
d3d10sw: Move the place of d3d10_sw.def to d3d10_sw.def.in
Fixes vulkan_lvp.def for x86
Fixes #5552
Remove stdcall-fixup

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14041>
2022-04-19 19:38:47 +00:00
Chia-I Wu 4fa24747b9 glthread: call _mesa_glthread_BindBuffer unconditionally
_mesa_marshal_GetIntegerv expects those states to be tracked.  I am not
sure if this covers all states that _mesa_marshal_GetIntegerv needs, but
this fixes Civ5 for virgl at least.

Fixes: e48f676835 ("glthread: don't sync for more glGetIntegerv enums for glretrace")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14659>
2022-02-01 06:11:22 +00:00
Dave Airlie ad2902cbbe mapi: generate correct dispatch for EXT_draw_instanced
These APIs can be exposed in GLES2.0 via EXT_draw_instanced,
they were incorrectly being stuck on GLES 3.0 only.

Fixes piglit ext_draw_instanced-drawarrays

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14338>
2022-01-03 21:37:34 +00:00
Qiang Yu e1cecd8964 mesa: add ARB_sparse_texture extension
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14223>
2021-12-30 16:11:19 +08:00
Qiang Yu bcaf9704ad glapi: should not add alias function to static_data.py
Alias function should not be assigned an offset, otherwise new added
function will get error:

  Exception: entries are not ordered by slots

Fixes: 757bc6d37a ("mesa: Add support for EXT_clear_texture")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14223>
2021-12-30 16:11:19 +08:00
Marek Olšák ae4065f0b2 mesa: use nop dispatch for ColorTable/Convolution/Histogram
The nop dispatch generates GL_INVALID_OPERATION too.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:29:00 -05:00
Marek Olšák 4c91c6162b glapi: add missing no_error settings for implemented functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:28:49 -05:00
Marek Olšák 7b123ad16a glthread: set marshal functions in dispatch only if they exist in the API
We now have proper nop dispatch for the unset functions.

The autogenerated code looks like this:

   if ((ctx->API == API_OPENGLES2 && ctx->Version >= 31)) {
      if (_gloffset_DepthRangeArrayfvOES >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_DepthRangeArrayfvOES] = (_glapi_proc)_mesa_marshal_DepthRangeArrayfvOES;
      if (_gloffset_DepthRangeIndexedfOES >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_DepthRangeIndexedfOES] = (_glapi_proc)_mesa_marshal_DepthRangeIndexedfOES;
   }
   if (_mesa_is_desktop_gl(ctx)) {
      if (_gloffset_AlphaToCoverageDitherControlNV >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_AlphaToCoverageDitherControlNV] = (_glapi_proc)_mesa_marshal_AlphaToCoverageDitherControlNV;
      if (_gloffset_AttachObjectARB >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_AttachObjectARB] = (_glapi_proc)_mesa_marshal_AttachObjectARB;
      if (_gloffset_BeginQueryIndexed >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_BeginQueryIndexed] = (_glapi_proc)_mesa_marshal_BeginQueryIndexed;
      if (_gloffset_BindBufferOffsetEXT >= 0)
         ((_glapi_proc *)(ctx->MarshalExec))[_gloffset_BindBufferOffsetEXT] = (_glapi_proc)_mesa_marshal_BindBufferOffsetEXT;
   ...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:42 -05:00
Marek Olšák e93a9b422c glthread: add nop dispatch
so that glthread behaves the same as the main dispatch.

Also fix the SetError function for GLES 1.0.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:40 -05:00
Marek Olšák bade2407fa mesa: remove GLvertexformat
Function pointers were first set in GLvertexformat, and then
GLvertexformat was copied to the dispatch.

This just sets the function pointers in the dispatch directly,
skipping the intermediate GLvertexformat structure.

The code with SET_* calls is autogenerated by api_vtxfmt_init_h.py.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:35 -05:00
Marek Olšák a87e5d437e glapi: autogenerate install_vtxfmt with python
This is a prerequisite for the GLvertexformat removal.

The autogenerated file looks like this:

if (_mesa_is_desktop_gl(ctx) || (ctx->API == API_OPENGLES2 && ctx->Version >= 30)) {
   SET_VertexAttribI4iEXT(tab, NAME(VertexAttribI4iEXT));
   SET_VertexAttribI4ivEXT(tab, NAME(VertexAttribI4ivEXT));
   SET_VertexAttribI4uiEXT(tab, NAME(VertexAttribI4uiEXT));
   SET_VertexAttribI4uivEXT(tab, NAME(VertexAttribI4uivEXT));
}
if (ctx->API == API_OPENGLES2) {
   SET_VertexAttrib1fARB(tab, NAME_ES(VertexAttrib1fARB));
   SET_VertexAttrib1fvARB(tab, NAME_ES(VertexAttrib1fvARB));
   SET_VertexAttrib2fARB(tab, NAME_ES(VertexAttrib2fARB));
   SET_VertexAttrib2fvARB(tab, NAME_ES(VertexAttrib2fvARB));
   SET_VertexAttrib3fARB(tab, NAME_ES(VertexAttrib3fARB));
   SET_VertexAttrib3fvARB(tab, NAME_ES(VertexAttrib3fvARB));
   SET_VertexAttrib4fARB(tab, NAME_ES(VertexAttrib4fARB));
   SET_VertexAttrib4fvARB(tab, NAME_ES(VertexAttrib4fvARB));
}
if (ctx->API == API_OPENGL_COMPAT) {
   SET_ArrayElement(tab, NAME_AE(ArrayElement));
   SET_Begin(tab, NAME(Begin));
   SET_CallList(tab, NAME_CALLLIST(CallList));
   SET_CallLists(tab, NAME_CALLLIST(CallLists));
   SET_Color3b(tab, NAME(Color3b));
   SET_Color3bv(tab, NAME(Color3bv));
   ...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:29 -05:00
Marek Olšák 1f33948733 glapi: autogenerate all _mesa_* forward declarations in api_exec_decl.h
We could remove them from other header files now.

This purposefully omits "_exec" in _mesa_exec such as _mesa_exec_Begin
to make it pretty. Later commits will remove _exec from names, e.g. it
will become _mesa_Begin. The only other variants are really just
save_Begin (dlist) and _save_Begin (vbo).

The autogenerated file looks like this:

void GLAPIENTRY _mesa_NewList(GLuint list, GLenum mode);
void GLAPIENTRY _mesa_EndList(void);
void GLAPIENTRY _mesa_CallList(GLuint list);
void GLAPIENTRY _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists);
void GLAPIENTRY _mesa_DeleteLists(GLuint list, GLsizei range);
GLuint GLAPIENTRY _mesa_GenLists(GLsizei range);
void GLAPIENTRY _mesa_ListBase(GLuint base);
void GLAPIENTRY _mesa_Begin(GLenum mode);
void GLAPIENTRY _mesa_Bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
void GLAPIENTRY _mesa_Color3b(GLbyte red, GLbyte green, GLbyte blue);
void GLAPIENTRY _mesa_Color3bv(const GLbyte * v);
...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:25 -05:00
Marek Olšák 5603d3e42c mesa: remove api_exec.h and move its contents into context.h
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:24 -05:00
Marek Olšák 898649c145 glapi: autogenerate api_save.h with save_* function declarations
This is planned to be used by glthread for its own dispatch mechanism.

The autogenerated file looks like this:

void GLAPIENTRY save_NewList(GLuint list, GLenum mode);
void GLAPIENTRY save_ListBase(GLuint base);
void GLAPIENTRY save_Bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
void GLAPIENTRY save_RasterPos2d(GLdouble x, GLdouble y);
void GLAPIENTRY save_RasterPos2dv(const GLdouble * v);
void GLAPIENTRY save_RasterPos2f(GLfloat x, GLfloat y);
void GLAPIENTRY save_RasterPos2fv(const GLfloat * v);
void GLAPIENTRY save_RasterPos2i(GLint x, GLint y);
void GLAPIENTRY save_RasterPos2iv(const GLint * v);
...

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:20 -05:00
Marek Olšák df3447c331 glapi: autogenerate _mesa_initialize_save_table with python
The generated file looks like this:

SET_NewList(table, save_NewList);
SET_ListBase(table, save_ListBase);
SET_Bitmap(table, save_Bitmap);
SET_RasterPos2d(table, save_RasterPos2d);
SET_RasterPos2dv(table, save_RasterPos2dv);
SET_RasterPos2f(table, save_RasterPos2f);
SET_RasterPos2fv(table, save_RasterPos2fv);
SET_RasterPos2i(table, save_RasterPos2i);
SET_RasterPos2iv(table, save_RasterPos2iv);
SET_RasterPos2s(table, save_RasterPos2s);
...

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:19 -05:00
Marek Olšák d7c5161242 glapi: move reusable glapi printing code to apiexec.py
This will be used by all new scripts.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:18 -05:00
Marek Olšák 77c2a7c2e4 glapi: replace dispatch.h inline functions with macros for faster compilation
A change in dispatch.h now takes 11.7% less user+sys time to compile.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:11 -05:00
Marek Olšák 1aa0b587cd glapi: move apiexec API condition determination to common code
it will be used elsewhere

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:10 -05:00
Marek Olšák 6e4238f99a glapi: rename gl_genexec.py to api_exec_init.py, api_exec.c to api_exec_init.c
this seems cleaner

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:09 -05:00
Marek Olšák 12b1feb03e mesa: don't set CallList* redundantly in _mesa_initialize_save_table
It's set by _mesa_install_save_vtxfmt.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 12:00:07 -05:00
Marek Olšák b8ad4fd59d glapi: rename exec="dynamic" to exec "vtxfmt" to make it self-explanatory
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14000>
2021-12-14 11:59:58 -05:00
Jesse Natalie 36425c43c9 glapi: Never use dllimport/dllexport for TLS vars on Windows
Fixes: c691149f ("win32: Fixes thread local on win32 with clang/mingw")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14162>
2021-12-13 16:56:06 +00:00
Alex Xu (Hello71) 3aab34171d Fix TSD stubs for non-initial-exec case (fixes #5667).
ppc64le TSD disabled for now since I am insufficiently familiar with ppc
asm. x86 pthread stubs deleted because adding USE_ELF_TLS to the #if is
isn't worth the effort since it only saves a single function call on
initial entry (TSD stubs are not used for read-only text now). also
potentially fix non-pthread TSD builds (_glapi_Dispatch was undefined),
but untested (could still be broken).

Tested-by: Jesse Natalie <jenatali@microsoft.com>
Tested-by: Jan Beich <jbeich@freebsd.org>
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13935>
2021-12-08 00:10:29 -05:00
Adam Jackson b713fca495 glapi: Remove remnants of EXT_paletted_texture and the imaging subset
The GLX code had to special case these for uninteresting reasons, but we
don't support them anymore in Mesa so all this would do is keep them
sorta-working over GLX protocol. Given that Mesa hasn't supported them
on the renderer side since ~2011 let's stop pretending they're real. If
we get around to modernizing the indirect GLX code (hah) we can revisit
these then.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14085>
2021-12-08 03:42:44 +00:00
Yonggang Luo c691149f3e win32: Fixes thread local on win32 with clang/mingw (!14062)
The mingw compiling error:
```
../../src/mapi/glapi/glapi.h:86:66: error: '_glapi_tls_Dispatch' cannot be thread local when declared 'dllimport'
_GLAPI_EXPORT extern __THREAD_INITIAL_EXEC struct _glapi_table * _glapi_tls_Dispatch;
                                                                 ^
../../src/mapi/glapi/glapi.h:88:51: error: '_glapi_tls_Context' cannot be thread local when declared 'dllimport'
_GLAPI_EXPORT extern __THREAD_INITIAL_EXEC void * _glapi_tls_Context;
```

Fixes: c47fd3dc ("windows: Use TLS context/dispatch with shared-glapi")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14062>
2021-12-06 14:55:54 +00:00
Jesse Natalie c47fd3dc00 windows: Use TLS context/dispatch with shared-glapi
However they have to be called via _glapi_get_dispatch/context. This
would be safe to do on any platform, but the extra indirection is only
necessary on Windows since TLS vars can't be exported from a DLL.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13634>
2021-12-02 03:03:14 +00:00
Marek Olšák e48f676835 glthread: don't sync for more glGetIntegerv enums for glretrace
This makes glretrace faster with glthread.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13970>
2021-11-29 14:28:12 +00:00
Alex Xu (Hello71) 8570a2a280 Use initial-exec TLS for glibc only, enable TLS elsewhere
It is not portable to use initial-exec TLS in dlopened libraries. glibc
and FreeBSD allocate extra memory for extra initial-exec variables
specifically for libGL, but other libcs including musl do not.

Keep initial-exec disabled on FreeBSD since it is apparently broken for
some reason:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/966#note_394512
81dbdb15d5

Enable TLS on OpenBSD and Haiku based on the u_thread.h comment that
emutls is better than pthread_getspecific, which seems plausible given
that emutls has strictly more information to work with.

Fixes #966.

Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722>
2021-11-20 11:56:34 -05:00
Marek Olšák c14d755f3d glthread: add an option to make glCheckFramebufferStatus a no-op
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13403>
2021-10-27 01:24:03 +00:00
Marek Olšák f4348ef60d glthread: don't sync for glIsEnabled with a few enums
viewperf benefits

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13403>
2021-10-27 01:24:03 +00:00
Dylan Baker e73096bd6d meson: use gtest protocol for gtest based tests when possible
With the `gtest` protocol meson will add some extra arguments to the
test to generate better junit results, which may be useful. This
protocol is only available in meson 0.55.0+, so keep using the default
`exitcode` protocol for meson older than that.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8484>
2021-10-16 03:22:24 +00:00
Tapani Pälli 205b684725 mesa: GL_ARB_ES3_2_compatibility GL compat profile support
Patch removes 'desktop=false' from aliased function, otherwise
glPrimitiveBoundingBox[ARB] cannot be retrieved via GetProcAddress.
This was seen with new OpenGL 4.5 tests that utilize
GL_ARB_ES3_2_compatibility and bounding box API.

v2: fixes to display list support (Ilia Mirkin)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12846>
2021-09-23 11:10:23 +00:00
Jesse Natalie 2a76c976d1 static-glapi: Fix MSVC preprocessor definitions
Previously, any DLL which links any function from libglapi-static would
end up exporting the entire GL API surface area, due to the dllexport
introduced by BUILD_GL32. This fix allows DLLs to internally include
definitions of gl* APIs without having to export the entire surface.

Also, remove unreachable with_shared_glapi branch already in an else block.

Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:21:53 -07:00
Jesse Natalie 03006926de wgl: Fix unit test when using shared glapi
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:21:48 -07:00
Jesse Natalie 92f515ad6e mapi: Fix shared-glapi build with MSVC
Reviewed By: Bill Kristiansen <billkris@microsoft.com>

Reviewed-by: Charmaine Lee >charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12677>
2021-09-08 07:21:26 -07:00
Simon Zeni 90be0d7963 glapi/gl_gentable.py: drop call to backtrace on no op
The function uses glibc specific functions

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12108>
2021-08-26 01:47:30 +00:00
Marek Olšák db9ffc5561 glthread: implement glGetUniformLocation without syncing
We already have the infrastructure for querying shader program properties
without syncing. This just uses it. _mesa_error_glthread_safe sets a GL
error from the producer thread.

This decreases CPU overhead for viewperf/snx.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12490>
2021-08-24 15:24:07 +00:00
Eric Engestrom f1eae2f8bb python: drop python2 support
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>
2021-08-14 21:44:32 +00:00
Eric Engestrom 6f854145d2 python: explicitly require python3
Ubuntu has dropped the `python` symlink to `python2` [1] instead of
redirecting it to `python3` like other distros are doing, which means
that if we want to build Mesa on Ubuntu we need the `python3` shebang.

[1] https://lists.ubuntu.com/archives/ubuntu-devel/2020-January/040882.html

Reported-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>
2021-08-14 21:44:31 +00:00