summaryrefslogtreecommitdiff
path: root/src/mapi
AgeCommit message (Collapse)AuthorFilesLines
2023-10-15mesa: enable NV_texture_barrier in GLES2+ (again)Lucas Stach1-1/+1
This re-enables NV_texture_barrier in GL ES2+ contexts. This had previously been tried, but caused CI issues and thus had been reverted. c7da969f8fe1 ("mesa: Enable NV_texture_barrier in GLES2+") was buggy, as it added the es2 annotation to the category instead of the function in the XML, which lead to the extension being advertised, but calling glTextureBarrierNV in a GLES context only yielded a GL_INVALID_OPERATION instead of the desired barrier operation. Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25728>
2023-08-17glthread: sync for VDPAU sync functionsMarek Olšák1-2/+2
They should sync according to the spec. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24528>
2023-08-01mesa: Implement and advertise GL_MESA_sampler_objectsAdam Jackson1-10/+10
This is the GLES3 sampler object API trivially backported to GLES2, because it allows for simpler/better support in glamor and mutter. The only code change we need is adding these to the generated dispatch tables for ES2 contexts. The interactions with EXT_shadow_samplers, EXT_texture_filter_anisotropic and EXT_texture_sRGB_decode are already in place before this change, and OES_texture_border_clamp is always supported in Mesa. Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2440>
2023-06-29mapi: Remove dead struct _glapi_function in glapi/glapi_getproc.cYonggang Luo1-12/+0
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>
2023-06-29mapi: Merge get_static_proc_address into _glapi_get_proc_addressYonggang Luo1-34/+15
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>
2023-06-29mapi: Style fixes in glapi/glapi_getproc.cYonggang Luo1-5/+5
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23879>
2023-06-27mapi: Hide OpenGL functions to be exported when shared-glapi is disabledYonggang Luo5-12/+7
Fixes the following test error: 135/154 mesa:gallium / osmesa-symbols-check FAIL 0.07s exit status 1 ``` src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glAreTexturesResidentEXT src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glDeleteTexturesEXT src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glGenTexturesEXT src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glIsTextureEXT ``` The build options is: ``` -D glx=xlib -D gles1=disabled -D gles2=disabled -D shared-glapi=disabled ``` Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23409>
2023-06-27mapi: Now _glapi_get_dispatch_table_size always equal to sizeof(struct ↵Yonggang Luo1-1/+1
_glapi_table) / sizeof(void *) Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23822>
2023-06-27mapi: Fixes compile error with build option "-D shared-glapi=disabled"Yonggang Luo1-31/+7
Fixes: 398a8d43dc9 ("mapi: Delete dynamic stub generation.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9245 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23822>
2023-06-22mapi: Fixes non-constant-expression cannot be narrowed from type 'unsigned ↵Yonggang Luo1-1/+1
long' to 'unsigned int' in initializer list with clang error is: ../src/mapi/glapi/tests/check_table.cpp:563:19: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'unsigned int' in initializer list [-Wc++11-narrowing] { "glNewList", _O(NewList) }, This is just a test and only with clang, and can be disabled by compiler option, so there is no need to back ported Reviewed-by: Eric Engestrom <eric@igalia.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23793>
2023-06-22mapi: Fixes check_table.cpp for DrawArraysInstancedARB and ↵Yonggang Luo1-2/+2
DrawElementsInstancedARB The compile error when compiled with "-Dglx=xlib -D shared-glapi=disabled": check_table.cpp:1133:37: error: ‘struct _glapi_table’ has no member named ‘DrawArraysInstancedARB’; did you mean ‘DrawArraysInstanced’? 1133 | { "glDrawArraysInstancedARB", _O(DrawArraysInstancedARB) }, Fixes: 5679ef99b82 ("glapi: remove EXT and ARB suffixes from Draw functions") Reviewed-by: Eric Engestrom <eric@igalia.com> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23793>
2023-06-12mapi: Delete execmem support code.Emma Anholt4-169/+0
No longer used now that we don't dynamically generate dispatch stubs. Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-12mapi: Drop the unused_functions table.Emma Anholt2-57/+1
Since we don't support loading an older driver with newer loader any more, we don't need to bother tracking entrypoints that Mesa no longer supports. Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-12mesa: Drop the aliases from the remap table.Emma Anholt4-126/+16
Mesa core doesn't need to have mapi sanity check that our aliases all map to the same offset. That's a build-time decision. Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-12mapi: Clean up mapi_stub struct.Emma Anholt2-5/+4
We no longer use the address field, and the name is always a size_t offset in the string pool (never a dynamic strduped name). Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-12mesa: Drop the function parameter spec from the remap table.Emma Anholt4-63/+5
Since we don't generate dynamic dispatch stubs any more, we don't need this data. Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-12mapi: Delete dynamic stub generation.Emma Anholt11-683/+18
Since Mesa drivers are now version-locked to the loader, that means that we never need to support a newer hardware driver than the loader, and thus don't need to generate dynamic dispatch stubs. This is great news, given that we don't test those paths, and it involved delightful features like arrays of hex for code to be pasted into executable memory. More code removal will follow, this is the first cut of "don't generate, and DCE generation code". Fixes: #9158 Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-12mapi: clang-format _glapi_add_dispatch().Emma Anholt1-42/+38
The formatting was so broken I couldn't follow what was going on. Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
2023-06-07Update OpenGL headersSimon Ser1-10806/+6833
Token from commit 91cdaf381d77b6e700654ecd78cb88a95c1fde1a of OpenGL-Registry. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23144>
2023-04-11mesa: Add EXT_instanced_arrays supportCorentin Noël3-3/+14
The support for ARB_instanced_arrays already exists for big GL, reuse the same PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR for this extension. The OES_draw_elements_base_vertex and EXT_draw_elements_base_vertex both define the DrawElementsInstancedBaseVertex method when EXT_instanced_arrays is defined. Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11glapi: Make EXT_draw_instanced functions available for GLES 2.0Corentin Noël1-2/+2
The EXT suffixed functions should be available in the GLES 2.0 context. Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11Revert "mesa: Enable NV_texture_barrier in GLES2+"David Heidelberg1-1/+1
Fixes failing skqp GLES test: - gles_lcdblendmodes This reverts commit c7da969f8fe1b78d2479623e2510e52827c3035a. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-08mesa: Enable NV_texture_barrier in GLES2+Adam Jackson1-1/+1
The spec text is written against 3.2 but only requires framebuffer objects and ES2. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19234>
2023-03-30mapi: add InternalInvalidateFramebufferAncillaryMESAMike Blumenkrantz2-0/+5
this allows glthread to handle ancillary buffer invalidation Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-20mesa ctx->API --> _mesa_is_foo(ctx)volodymyr.o2-11/+11
replaces direct API checks with _mesa_is_...() checks Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8340 Signed-off-by: Volodymyr Obohzyn volodymyr.obozhyn@globallogic.com Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21556>
2023-03-12glthread: qualify the *cmd unmarshal parameter with restrictMarek Olšák2-2/+2
This seems like a logical thing to do. Clearly the memory can't be accessed with any other pointer. Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12mesa: rename CurrentClientDispatch to GLApiMarek Olšák1-2/+2
I like this more. The name self-documents itself. It's always equal to the dispatch set in glapi. GLAPI is a definition, so can't use that. Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12mesa: move ctx->Table -> ctx->Dispatch.Table except Client & MarshalExecMarek Olšák2-2/+2
There is a new struct gl_dispatch, which I'd like to reuse in glthread. This allows building code around gl_dispatch that can be shared between mesa and glthread. This is only refactoring. Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12glapi: inline the meson list files_mapi_utilMarek Olšák3-9/+9
so that people can easily tell where these files are used by searching for the file names in the meson files. Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12glapi: move files specific to shared-glapi into the shared-glapi subdirectoryMarek Olšák6-7/+7
Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-10meson: inline gtest_test_protocol now that it's always 'gtest'Eric Engestrom2-2/+2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-01glthread: fix a perf regression due to draw_always_async flag, fix DrawIndirectMarek Olšák1-2/+2
Performance regressed by 31% in one VP2020/Creo subtest because the draw_always_async flag wasn't implemented correctly. Remove it instead of fixing it. While removing it, I noticed that our DrawIndirect async conditions were incorrect. I fixed them. Fixes: 3b897719e632a165f - glthread: add ctx->GLThread.draw_always_async to simplify draw checking Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21566>
2023-02-28glapi/meson: drop duplicate line in depsEric Engestrom1-1/+0
Fixes: 0842bc879b34414de54b ("meson: wire the new generator for es1 and es2") Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21562>
2023-02-18glthread: convert (Multi)DrawIndirect into direct if user buffers are presentMarek Olšák2-14/+6
so that user buffers are uploaded without syncing. Now glthread fully handles non-VBO uploads, so that we can disable user buffer codepaths in st/mesa. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: add API to allow passing DrawID from glthread to mesaMarek Olšák2-0/+10
This will be needed for lowering DrawIndirect in glthread, which is needed if non-VBO vertex arrays are present. This only adds the drawid parameter in glthread's draw_arrays and draw_elements functions, and implements where needed. New GL API functions are added because we want to use separate DISPATCH_CMD_* enums for draws with DrawID, so that we don't increase the memory footprint of draws in glthread batches if drawid == 0. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: handle non-VBO uploads for glMultiModeDraw{Arrays,Elements}IBMMarek Olšák1-4/+2
This was unimplemented, and this implementation matches exactly what we do in main/draw.c. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: add ctx->GLThread.draw_always_async to simplify draw checkingMarek Olšák1-2/+2
This just precomputes 3 terms of the condition to draw asynchronously. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: track vertex formats for all attributesMarek Olšák7-40/+40
We'll need this for a special vertex upload fallback. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: don't bind/unbind uploaded indexbuf, pass it to glMultiDraw directlyMarek Olšák1-0/+7
MultiDrawElementsUserBuf is changed to mean the same thing as glMultiDrawElementsBaseVertex, but "gl_buffer_object *index_buffer" is passed via a parameter instead of using the bound GL_ELEMENT_ARRAY_BUFFER. This skips binding and unbinding the index buffer around every draw where glthread uploads indices. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: don't bind/unbind uploaded indexbuf, pass it to glDraw directlyMarek Olšák1-0/+8
DrawElementsUserBuf is changed to mean the same thing as glDrawElementsInstancedBaseVertexBaseInstance, but "gl_buffer_object * index_buffer" is passed via a parameter instead of using the bound GL_ELEMENT_ARRAY_BUFFER. This skips binding and unbinding the index buffer around every draw where glthread uploads indices. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18glthread: track the current element array buffer in the Core profile tooMarek Olšák2-5/+5
This is a prerequisite for: "glthread: upload non-BO indices in the core profile to fix GStreamer" Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-01-20glthread: make marshal functions for glBegin/End attribs non-staticMarek Olšák1-1/+3
for a future commit Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20glapi: autogenerate function parameters with no space between * and variableMarek Olšák1-1/+4
print "int *v" instead of "int * v". Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-19meson: use the same workaround for setting 'lib' on windowsDylan Baker3-3/+3
Reviewed-by: Eric Engestrom <eric@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19glthread: fix glArrayElement handlingPierre-Eric Pelloux-Prayer1-1/+1
This must be marshalled synchronously or the attrib pointers' content might change by the time we use them. Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8068 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-10mesa: add missing count_scale attributesPierre-Eric Pelloux-Prayer1-4/+4
The EXT_gpu_program_parameters spec says: <params> points to an array of 4*<count> values for both functions. Cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>
2023-01-10mesa: add missing count_scale attributePierre-Eric Pelloux-Prayer1-2/+2
The EXT_gpu_program_parameters spec says: <params> points to an array of 4*<count> values Fixes: a4e935f2d70 ("mesa: add EXT_dsa + EXT_gpu_program_parameters functions") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7943 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8025 Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>
2023-01-03glx: Remove the GetProcAddress special case for indirect renderingAdam Jackson1-49/+0
Some GL entrypoints would be aliased in an API sense but have different GLX protocol. The only one that matters to us is EXT_texture_object, which is the pre-GL-1.1 API. We're just going to drop support for that and assume you have 1.1 or better, since 1.0 + EXT_texture_object is a vanishingly rare combo at this point. Acked-by: David Heidelberg <david.heidelberg@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20300>
2022-11-20mapi: update gles 1.1 extention packet linkYusuf Khan1-1/+1
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com> Reviewed-by: Yonggang Luo <luoyonggang@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19874>
2022-11-11meson: Refactoring shared gen_vs_module_defs_normal_command outYonggang Luo2-6/+2
Cc: mesa-stable 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/19610>