Commit Graph

1169 Commits

Author SHA1 Message Date
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
Marek Olšák 2840bc3065 glthread: upload non-VBO vertices and indices for non-Indirect non-IBM draws
This is basically the same thing u_vbuf does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-30 22:01:55 +00:00
Marek Olšák 1485a3ff7b glthread: handle gl{Push,Pop}ClientAttrib{DefaultEXT} for glthread states
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-30 22:01:55 +00:00
Marek Olšák 47cf310a67 glthread: track primitive restart state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-30 22:01:55 +00:00
Marek Olšák 9037005d60 glthread: track instance divisor changes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-30 22:01:55 +00:00
Marek Olšák c9c9f57b02 glthread: track pointers and strides for Pointer & EXT_dsa attrib functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-30 22:01:55 +00:00
Marek Olšák a82889e537 mesa: add glInternalBufferSubDataCopyMESA for glthread
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
2020-04-30 22:01:55 +00:00