Commit Graph

1275 Commits

Author SHA1 Message Date
Marek Olšák 34356c009c api_hw_select_init_h.py: simplify the code
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák 3c621f8a2a glapi: rename 'vtxfmt' to 'beginend' to make it clear
These are really just the functions that execute between Begin/End.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák 684dae9e64 mesa: initialize OutsideBeginEnd directly instead of through Exec
Exec is just a mutable pointer to one of the dispatch tables.
OutsideBeginEnd is what we are actually initializing here. This makes
the original intention clear.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
2022-09-26 22:58:16 +00:00
Marek Olšák 4ff207b47b glthread: execute glSignalSemaphoreEXT synchronously
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>
2022-09-21 14:54:50 +00:00
Marek Olšák 7c1f8b63ad glthread: work around GL_INVALID_OPERATION with OpenGL ES 1.x draws
GLES1 only has (Multi)Draw{Array,Elements}, but glthread converts them
to the more complicated versions and then calls them through the dispatch,
which generated GL_INVALID_OPERATION.

Luckily, we can export them with the Internal prefix, so they are unlikely
to be used by apps by accident.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>
2022-09-21 14:54:50 +00:00
Marek Olšák 97891087b5 glthread: always sync for glShaderSource because invalid params can crash
If an invalid parameter is received along with an invalid pointer and we
ignore the invalid parameter and dereference the pointer, we crash.
Since we can't fully validate all parameters (such as whether "shader"
is a valid object ID), remove the custom code.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>
2022-09-21 14:54:49 +00:00
Marek Olšák 6b6f862170 glthread: generate errors for glGet functions between glBegin/End
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>
2022-09-21 14:54:49 +00:00
Marek Olšák 355d575820 mesa: fix glDrawRangeElementsBaseVertex should be compiled into display list
It's defined in terms of glDrawRangeElements, which is compiled into display
lists.

Cc: stable
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18223>
2022-09-21 14:54:49 +00:00
Jesse Natalie d0a1c1a37d mesa: Expose GL_NV_ES1_1_compatibility
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18217>
2022-08-25 10:17:10 -07:00
Yonggang Luo 8e8a231a07 mapi: Move shared stub into u_current.c
These stub are:
_glapi_Dispatch
_glapi_Context
_glapi_destroy_multithread
_glapi_check_multithread

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17814>
2022-08-22 21:32:09 +00:00
Yonggang Luo 7f49abbdc0 mapi: Move shared _glapi_set_context and _glapi_set_dispatch into u_current.c
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17814>
2022-08-22 21:32:09 +00:00
Marek Olšák 983684d763 glthread: track glBindFramebufferEXT, not just glBindFramebuffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>
2022-08-12 06:06:48 +00:00
Marek Olšák f9b0dc9377 glthread: track GL_READ_FRAMEBUFFER bindings too
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>
2022-08-12 06:06:48 +00:00
Marek Olšák 28e351673e glthread: call _mesa_glthread_DeleteBuffers unconditionally
Deleted buffers were not unbound in glthread.

Fixes: 4fa24747b9 - glthread: call _mesa_glthread_BindBuffer unconditionally

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>
2022-08-12 06:06:48 +00:00
Marek Olšák eb4036ea5b glthread: unbind framebuffers in glDeleteFramebuffers
Tests:
    dEQP-GLES2.functional.lifetime.delete_bound.framebuffer
    dEQP-GLES2.functional.state_query.integers.framebuffer_binding_getinteger

Fixes: e48f676835 - glthread: don't sync for more glGetIntegerv enums for glretrace

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976>
2022-08-12 06:06:48 +00:00
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
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 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
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
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
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
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
Gert Wollny 757bc6d37a mesa: Add support for EXT_clear_texture
This extension implements a subset of ARB_clear_texture (i.e.
only the features that are not available in OpenGL ES have been
dropped).

v2: Move call declarations from function to offsets  (Emil)

v3: Update llvmpipe and softpipe expectations

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10325>
2021-08-06 15:57:42 +00:00
Pierre-Eric Pelloux-Prayer b0536119f2 glthread: use custom marshal/unmarshal for CallList
Will be used in the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11493>
2021-07-09 10:05:46 +00:00
Pierre-Eric Pelloux-Prayer 7e2d4f505d glthread: return consumed bytes
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11493>
2021-07-09 10:05:46 +00:00
Pierre-Eric Pelloux-Prayer 9a9860bd11 glthread: add a last parameter to unmarshal functions
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11493>
2021-07-09 10:05:46 +00:00
Marek Olšák 3da170faae glthread: change when glFlush flushes asynchronously
This fixes the flushing with external textures.

We don't know if we need to flush synchronously with multiple contexts,
so I removed that.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Michel Zou 30115d0038 glapi: fix Warray-parameter
Fixes these new gcc11 warnings:

In file included from ../src/mapi/glapi/glapi_dispatch.c:174:
src/mapi/glapi/gen/glapitemp.h:3191:68: warning: argument 1 of type 'const GLdouble *' {aka 'const double *'} declared as a pointer [-Warray-parameter=]
 3191 | KEYWORD1 void KEYWORD2 NAME(LoadTransposeMatrixd)(const GLdouble * m)
      |                                                   ~~~~~~~~~~~~~~~~~^
In file included from ../src/mapi/glapi/glapi_priv.h:31,
                 from ../src/mapi/glapi/glapi_dispatch.c:40:
../include/GL/gl.h:1901:62: note: previously declared as an array 'const GLdouble[16]' {aka 'const double[16]'}
 1901 | GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11198>
2021-06-10 10:31:55 +00:00
Emma Anholt 75a9cb1033 util: Add a helper macro for defining initial-exec variables.
I'm going to add another case for Android shortly, and then we can keep
the logic all in one spot.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10389>
2021-06-02 03:10:49 +00:00
Timothy Arceri a02a0df2a2 mesa: fix incomplete GL_NV_half_float implementation
All of the VertexAttrib* functions were missing.

Fixes: ef66e02a40 ("src/mesa: add GL_NV_half_float extension support (v2)")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10431>
2021-04-26 03:35:21 +00:00
Jose Fonseca 6e6cd7d93c scons: Remove.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9720>
2021-03-20 10:38:55 +00:00
Michel Zou dfb1c986dd glapi: keep declspec(thread) msvc-specific
gcc ignores with a warning:
glapi.h:83:1: warning: ‘thread’ attribute directive ignored [-Wattributes]

Fixes: ba141b95

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9245>
2021-02-24 13:47:30 +00:00
Jesse Natalie ba141b95a7 glapi: Support "ELF" TLS on Windows
To avoid a massive rename, I'm leaving this as a misnomer, it's not
really ELF TLS, but it's the same concept.

Note that Windows doesn't support thread-local variables imported
or exported between modules, so we can only support this when we're
not using a shared glapi.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4050
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9165>
2021-02-23 17:06:48 +00:00
Marek Olšák c59fd3acb9 glthread: ignore the return value of glUnmapBuffer, don't sync, and return true
We always return GL_TRUE from the Unmap functions.

gl_marshal.py is modified so as not to use "return" in the unmarshal
function, which always returns void.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>
2021-02-17 05:47:27 -05:00
Marek Olšák 638a184849 glthread: don't sync when using pixel buffer objects
The pointer is a GPU offset if a PBO is bound.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>
2021-02-17 05:47:25 -05:00
Marek Olšák 0b6739ef80 glthread: don't declare pointers with const in unmarshal functions
so that GL functions with a non-const pointer don't print a warning when
we call them, such as glGetTexImage with a PBO where the pointer is really
just an offset.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>
2021-02-17 05:47:23 -05:00
Marek Olšák 2804d489e3 glthread: assume all parameters are fixed if marshal_sync is present
We want glthread to ignore variable-sized parameters if the only thing
we want is to pass the pointer parameter as-is, e.g. when a PBO is bound.
Making it conditional on marshal_sync is kinda hacky, but it's the easiest
path towards handling PBOs, which will use marshal_sync to check whether
a PBO is bound.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>
2021-02-17 05:47:21 -05:00
Marek Olšák d860b61f09 glapi: guard against invalid XML definitions for glthread
This would have prevented the bug that the previous commit fixes.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8753>
2021-01-29 02:28:42 +00:00
Marek Olšák b5a0714aae glthread: fix glVertexAttribDivisor calls not being tracked by non-VBO uploads
marshal_call_after is ignored if the function is an alias of another
function. Move it to the right place.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8753>
2021-01-29 02:28:42 +00:00
Jesse Natalie 92f1b6bad5 glapi: Undefine MemoryBarrier
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8661>
2021-01-28 18:35:13 +00:00
Marek Olšák e31d8fa0ad mesa: remove _mesa_initialize_exec_dispatch from draw.c by autogenerating it
The glapi scripts are fully capable of generating this correctly for all
GL APIs if we don't set exec="dynamic".

exec="dynamic" should only be used for glBegin, glEnd, and all functions
that are legal inside Begin/End.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:35 +00:00
Marek Olšák 33ad9e77c5 glthread: add display list support to fix state tracking with display lists
The existing display list code is reused to call display lists from the app
thread. The util_queue_fence_wait call waits for the last call that modifies
display lists (such as glEndList and glDeleteLists), which ensures that
accessing display lists from a non-mesa thread is thread safe because
the wait guarantees that display lists are immutable during the asynchronous
display list execution.

Display lists are executed just like normal display lists except that they
call glthread functions instead of the default GL dispatch. Many calls in
display lists are skipped because glthread only tracks a few states.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:35 +00:00
Marek Olšák fd678bef40 glthread: remove if (COMPAT) conditions from functions that are GL-compat-only
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:35 +00:00
Marek Olšák df38b99e85 glthread: rename inside_dlist to ListMode for future use
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:35 +00:00
Marek Olšák d8ad570b3e glthread: implement glGetIntegerv for states that glthread tracks
for viewperf

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:35 +00:00
Marek Olšák 6febe2b880 glthread: track all matrix stack depths
This just tracks matrix stack depths in MatrixStackDepth and everything
else here is needed to make it correct.

Matrix stack depths will be returned by glGetIntegerv without synchronizing.

Display lists will be handled by a separate commit.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:35 +00:00
Marek Olšák 8f53b54a3b glthread: don't sync with NV_half_float vertex attrib functions
Set the pointer sizes, so that glthread knows how much data needs to be
copied.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:34 +00:00
Marek Olšák 36740aa1f1 glthread: remove marshal="draw" because it doesn't do much
It only checked whether the pointer was indices or indirect, but we can
just determine the same thing manually for each draw call.

Simplify it as follows:
- if a call contains a pointer without count and it's either indirect or
  indices, set marshal="async". The marshal_sync attribute still determines
  when it syncs.
- if a call doesn't contain any pointer without count, remove the marshal
  attribute

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8297>
2021-01-21 00:12:34 +00:00
Michel Zou 07a68d27b3 glapi: fix unused-function warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
2020-12-01 16:51:01 +00:00
Marek Olšák b8684672ff glthread: make glGetActiveUniform return without syncing
We just need to track glLinkProgram and glDeleteProgram.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7053>
2020-11-21 21:02:56 +00:00
Marek Olšák ac4dc6e139 mesa: add glInternalSetError for glthread
glthread wants to set GL errors, but has to do it by adding the SetError
call into the queue for it to be thread-safe.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7053>
2020-11-21 21:02:56 +00:00
Adam Jackson fd104096c6 mesa: Implement GL_ANGLE_pack_reverse_row_order
Identical to GL_MESA_pack_invert in effect, just need to check for a
different enum value for GLES vs GL. The spec claims that "OpenGL 1.5 or
OpenGL ES 1.0 are required", but ReadPixels isn't a thing for ES1 so we
only enable it for ES2+.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3156>
2020-11-06 02:28:44 +00:00
Marek Olšák 315df8dbb8 glthread: handle glInterleavedArrays
We need to enable and bind everything on the glthread side too.
The behavior was copied from _mesa_InterleavedArrays.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6874>
2020-10-07 09:50:18 -04:00
Marek Olšák bd70b61f2f mesa: remove api_loopback to remove call indirections
This is an optimization for SPECviewperf.

The increase in lines of code is only 14%.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6874>
2020-10-07 09:50:18 -04:00
Marek Olšák 5827fe898e gl_marshal.py: inline print_sync_dispatch
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7031>
2020-10-06 15:59:07 +00:00
Yogesh Mohan Marimuthu ef66e02a40 src/mesa: add GL_NV_half_float extension support (v2)
This patch adds support for GL_NV_half_float
extension.

v2: fix main_test failure

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6219>
2020-08-11 19:55:22 +00:00
Kristian H. Kristensen e1a58ae7c4 mapi/test: Change type to unsigned for offset
Quiets this warning:

../../master/src/mapi/glapi/tests/check_table.cpp:576:20: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
   { "glColor3dv", _O(Color3dv) },
                   ^~~~~~~~~~~~

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>
2020-08-05 18:08:06 +00:00
Adam Jackson 45d159cb41 glx: Fix build and warnings with -Dglx=dri -Dglx-direct=false
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5958>
2020-07-23 01:23:12 +00:00
Marek Olšák a2d7f4fe5a glthread: handle ARB_vertex_attrib_binding
This handles ARB_vertex_attrib_binding for vertex uploads correctly.
Before this, the extension might have led to crashes if non-VBO vertex
attribs were present.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5303>
2020-06-23 06:41:37 +00:00
Marek Olšák 2bf425431d glapi: fix incorrect param names in ARB_vertex_attrib_binding functions
no change in behavior

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5303>
2020-06-23 06:41:37 +00:00
Marek Olšák d76e8131ac glthread: sync in glFlush for multiple contexts
See the code comment.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5382>
2020-06-09 05:07:01 +00:00
Eric Engestrom 7a68045b5d glapi: remove deprecated .getchildren() that has been replace with an iterator
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3086
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5342>
2020-06-05 09:16:13 +00:00
Marek Olšák 4925fb97f6 glthread: don't upload for glDraw inside a display list and always sync
Let the vbo module handle it, not glthread.

This handles functions set in vbo_initialize_save_dispatch.

Fixes: 2840bc3065 ("glthread: upload non-VBO vertices and indices for non-Indirect non-IBM draws")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3001

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5246>
2020-05-30 01:42:56 +00:00
Kristian H. Kristensen 12653beacb mapi: Fix a couple of warning in generated code
safe_mul may not be used and clang doesn't understand the "optimize"
attribute.

src/mapi/glapi/gen/marshal_generated0.c:1216:16: warning: unknown
attribute 'optimize' ignored [-Wunknown-attributes]

src/mapi/glapi/gen/marshal_generated0.c:36:19: warning: unused
function 'safe_mul' [-Wunused-function]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Marek Olšák 64c7363f7e glthread: stop using GLenum16 to get correct GL errors for out-of-bounds enums
Reported by Ian Romanick.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5016>
2020-05-13 20:10:42 +00:00