summaryrefslogtreecommitdiffstats
path: root/src/mapi
Commit message (Collapse)AuthorAgeFilesLines
* meson: Build with Python 3Mathieu Bridon2018-08-104-16/+16
| | | | | | | | | | | | Now that all the build scripts are compatible with both Python 2 and 3, we can flip the switch and tell Meson to use the latter. Since Meson already depends on Python 3 anyway, this means we don't need two different Python stacks to build Mesa. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Simplify list sortingMathieu Bridon2018-08-091-4/+2
| | | | | | | | | Instead of copying the list, then sorting the copy in-place, we can just get a new sorted copy directly. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Use key-functions when sorting containersMathieu Bridon2018-08-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | In Python 2, the traditional way to sort containers was to use a comparison function (which returned either -1, 0 or 1 when passed two objects) and pass that as the "cmp" argument to the container's sort() method. Python 2.4 introduced key-functions, which instead only operate on a given item, and return a sorting key for this item. In general, this runs faster, because the cmp-function has to get run multiple times for each item of the container. Python 3 removed the cmp-function, enforcing usage of key-functions instead. This change makes the script compatible with Python 2 and Python 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Fix rich comparisonsMathieu Bridon2018-08-071-8/+7
| | | | | | | | | | | | | | Python 3 doesn't call objects __cmp__() methods any more to compare them. Instead, it requires implementing the rich comparison methods explicitly: __eq__(), __ne(), __lt__(), __le__(), __gt__() and __ge__(). Fortunately Python 2 also supports those. This commit only implements the comparison methods which are actually used by the build scripts. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Use explicit integer divisionsMathieu Bridon2018-08-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Python 2, divisions of integers return an integer: >>> 32 / 4 8 In Python 3 though, they return floats: >>> 32 / 4 8.0 However, Python 3 has an explicit integer division operator: >>> 32 // 4 8 That operator exists on Python >= 2.2, so let's use it everywhere to make the scripts compatible with both Python 2 and 3. In addition, using __future__.division tells Python 2 to behave the same way as Python 3, which helps ensure the scripts produce the same output in both versions of Python. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v2) Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* glapi: Fix GLES versioning for AMD_framebuffer_multisample_advanced functionsIan Romanick2018-08-061-2/+2
| | | | | | | | | | | | | | The GL_AMD_framebuffer_multisample_advanced spec says: OpenGL ES dependencies: Requires OpenGL ES 3.0. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107483 Fixes: 3d6900d76ef ("glapi: define AMD_framebuffer_multisample_advanced and add its functions") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: Vinson Lee <vlee@freedesktop.org>
* glapi: define AMD_framebuffer_multisample_advanced and add its functionsMarek Olšák2018-08-041-0/+27
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: GL_MESA_framebuffer_flip_y extension [v4]Fritz Koenig2018-07-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Adds an extension to glFramebufferParameteri that will specify if the framebuffer is vertically flipped. Historically system framebuffers are vertically flipped and user framebuffers are not. Checking to see the state was done by looking at the name field. This adds an explicit field. v2: * updated spec language [for chadv] * correctly specifying ES 3.1 [for chadv] * refactor access to rb->Name [for jason] * handle GetFramebufferParameteriv [for chadv] v3: * correct _mesa_GetMultisamplefv [for kusmabite] v4: * update spec language [for chadv] * s/GLboolean/bool/g [for chadv] * s/InvertedY/FlipY/g [for chadv] * s/inverted_y/flip_y/g [for chadv] * assert changes [for chadv] Reviewed-by: Chad Versace <chadversary@chromium.org>
* python: Use range() instead of xrange()Mathieu Bridon2018-07-243-4/+4
| | | | | | | | | | | | | | | | Python 2 has a range() function which returns a list, and an xrange() one which returns an iterator. Python 3 lost the function returning a list, and renamed the function returning an iterator as range(). As a result, using range() makes the scripts compatible with both Python versions 2 and 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* python: Better use iteratorsMathieu Bridon2018-07-242-14/+15
| | | | | | | | | | | | | | | | | In Python 2, iterators had a .next() method. In Python 3, instead they have a .__next__() method, which is automatically called by the next() builtin. In addition, it is better to use the iter() builtin to create an iterator, rather than calling its __iter__() method. These were also introduced in Python 2.6, so using it makes the script compatible with Python 2 and 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Better sort dictionary keys/valuesMathieu Bridon2018-07-244-16/+8
| | | | | | | | | | | | | | | | | | | In Python 2, dict.keys() and dict.values() both return a list, which can be sorted in two ways: * l.sort() modifies the list in-place; * sorted(l) returns a new, sorted list; In Python 3, dict.keys() and dict.values() do not return lists any more, but iterators. Iterators do not have a .sort() method. This commit moves the build scripts to using sorted() on dict keys and values, which makes them compatible with both Python 2 and Python 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* python: Better iterate over dictionariesMathieu Bridon2018-07-242-9/+9
| | | | | | | | | | | | | | | | In Python 2, dictionaries have 2 sets of methods to iterate over their keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems(). The former return lists while the latter return iterators. Python 3 dropped the method which return lists, and renamed the methods returning iterators to keys()/values()/items(). Using those names makes the scripts compatible with both Python 2 and 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Stop using the string moduleMathieu Bridon2018-07-244-12/+11
| | | | | | | | | | | | | Most functions in the builtin string module also exist as methods of string objects. Since the functions were removed from the string module in Python 3, using the instance methods directly makes the code compatible with both Python 2 and Python 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Better check for keys in dictsMathieu Bridon2018-07-246-21/+19
| | | | | | | | | | | | Python 3 lost the dict.has_key() method. Instead it requires using the "in" operator. This is also compatible with Python 2. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* Allow AMD_perfmon on GLES contextsEric Anholt2018-07-181-11/+11
| | | | | | v2: whitespace alignment fix Reviewed-by: Rob Clark <robdclark@gmail.com>
* python: Stop using the Python 2 exception syntaxMathieu Bridon2018-07-064-6/+6
| | | | | | | | | | | | | | We could have made this compatible with Python 3 by using: except Exception as e: But since none of this code actually uses the exception objects, let's just drop them entirely. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* python: Use spaces, not tabsMathieu Bridon2018-07-061-4/+4
| | | | | | | | | Python 3 doesn't allow mixing spaces and tabs in a script, contrarily to Python 2. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* python: Use the print functionMathieu Bridon2018-07-0618-1043/+1079
| | | | | | | | | | | | In Python 2, `print` was a statement, but it became a function in Python 3. Using print functions everywhere makes the script compatible with Python versions >= 2.6, including Python 3. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Acked-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
* python: Stabilize some script outputsMathieu Bridon2018-07-052-2/+3
| | | | | | | | | | | | In Python, dictionaries and sets are unordered, and as a result their is no guarantee that running this script twice will produce the same output. Using ordered dicts and explicitly sorting items makes the build more reproducible, and will make it possible to verify that we're not breaking anything when we move the build scripts to Python 3. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
* mesa: enable ARB_direct_state_access in OpenGL 4.5 compat profileTimothy Arceri2018-07-051-97/+97
| | | | | | | | | Its unlikely anyone will add proper ARB_direct_state_access compat support before we branch 18.2. Enabling the extension in 4.5 at least allows users to make use of MESA_GL_VERSION_OVERRIDE=4.5COMPAT for games like No Mans Sky. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: enable ARB_vertex_attrib_64bit in compat profileTimothy Arceri2018-06-301-10/+10
| | | | Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: enable ARB_viewport_array in compat profileTimothy Arceri2018-06-301-8/+8
| | | | Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: enable ARB_shader_subroutine in compat profileTimothy Arceri2018-06-301-8/+8
| | | | Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: add Uniform*d support to display listsTimothy Arceri2018-06-301-18/+18
| | | | | | This is required so we can enable fp64 support in compat profile. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: add support for ARB_sample_locationsRhys Perry2018-06-141-0/+104
| | | | | | Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> (v2) Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v2)
* meson: Add support for SPARC assemblyDylan Baker2018-06-131-1/+2
| | | | | | | | | This was blindly copied from autotools and tested by a helpful gentoo user. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa: changes to expose OES_texture_view extensionTapani Pälli2018-05-241-0/+15
| | | | | | | | | | | Functionality already covered by ARB_texture_view, patch also adds missing 'gles guard' for enums (added in f1563e6392). Tested via arb_texture_view.*_gles3 tests and individual app utilizing texture view with ETC2. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: drop GL_EXT_polygon_offset supportTimothy Arceri2018-05-182-11/+0
| | | | | | | | glPolygonOffset() has been part of the GL standard since 1.1. Also niether AMD or Nvidia support this in their binary drivers. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61761
* mesa: enable geom shaders in OpenGL 3.2 Compat profileTimothy Arceri2018-05-031-2/+1
| | | | Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: add support for nvidia conservative rasterization extensionsRhys Perry2018-04-302-0/+48
| | | | | | | | Although the specs are written against compatibility GL 4.3 and allows core profile and GLES2+, it is exposed for GL 1.0+ and GLES1 and GLES2+. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* glapi: define GL_API to be KEYWORD1 in glapi_dispatch.c (v2)Brian Paul2018-03-301-0/+7
| | | | | | | | | | This fixes a Windows build warning where the prototypes for the ES function in the header file don't match the prototypes in this file because the GL_API and GLAPI macros are defined differently. v2: defined GL_API to KEYWORD1 instead of GLAPI, per Mathias. Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
* glapi: add glBlendBarrier(), glPrimitiveBoundingBox() prototypesBrian Paul2018-03-291-0/+2
| | | | | | | | in glapi_dispatch.c, as we have for many other GLES functions. Fixes a cross-compile issue (missing prototype) when GLES support is disabled. Reviewed-by: Sinclair Yeh <syeh@vmware.com>
* *-symbol-check: use correct `nm` path when cross-compilingEric Engestrom2018-02-264-2/+4
| | | | | | Inspired-by: a similar patch for libdrm by Heiko Becker Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* glapi: Update XML for last revision of EXT_shader_framebuffer_fetch.Francisco Jerez2018-02-242-5/+6
| | | | | | | Desktop GL is now supported, and there is an additional entry-point for EXT_shader_framebuffer_fetch_non_coherent. Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
* mesa: add some of missing compatibility support for ARB_bindless_textureMarek Olšák2018-02-231-1/+1
| | | | | | | The extension is exposed in the compatibility profile. Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Reviewed-by: Brian Paul <brianp@vmware.com>
* meson: Add Haiku platform support v4Alexander von Gluck IV2018-02-162-2/+2
| | | | Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* mesa: add glsl version query (v4)Vadym Shovkoplias2018-02-131-0/+1
| | | | | | | | | | | | | | | | | | | | | Add support for GL_NUM_SHADING_LANGUAGE_VERSIONS and glGetStringi for GL_SHADING_LANGUAGE_VERSION v2: - Combine similar functionality into _mesa_get_shading_language_version() function. - Change GLSL version return mechanism. v3: - Add return of empty string for GLSL ver 1.10. - Move _mesa_get_shading_language_version() function to src/mesa/main/version.c. v4: - Add OpenGL version check. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104915 Signed-off-by: Andriy Khulap <andriy.khulap@globallogic.com> Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias@globallogic.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* glapi: fix check_table test for non-shared glapi with mesonDylan Baker2018-02-061-2/+3
| | | | | | | | | v2: - Add glapitable_h generated source to requirements Fixes: 3218056e0eb3 ("meson: Build i965 and dri stack") Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1) Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (v1)
* glapi: Don't search through subdirs from glapitable.hDylan Baker2018-02-061-1/+1
| | | | | | | | Because meson won't put it in that folder. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* glapi: remove APPLE extensions from testDylan Baker2018-02-061-2/+0
| | | | | | | Fixes: 7009955281260fbb ("mesa: Remove GL_APPLE_vertex_array_object stubs") Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Acked-by: Ian Romanick <ian.d.romanick@intel.com>
* glapi/check_table: Remove 'extern "C"' blockDylan Baker2018-02-061-2/+0
| | | | | | | | | | | | Using 'extern "C"' around includes is always incorrect, as the header may contain C++ symbols (as it does in this case), which means it cannot use C linkage. In this case the header has a template in it, which obviously cannot be linked with C linkage rules. Fixes: a29ad2b421b75a1727b ("mesa/tests: Add tests for the generated dispatch table") Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* glapi: don't walk backwards for includesDylan Baker2018-02-062-3/+5
| | | | | | | | | | Instead just set the proper -I flags and include it from a more standard path. In this case we'll add -Isrc/mesa (which is common), and #include main/foo.h. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* glx/apple: locate dispatch table functions to wrap by nameJon Turney2018-02-012-0/+17
| | | | | | | | | | | | | Avoid reaching into the dispatch table internals (and thus having to deal with the complexities of remap etc.) by identifying functions to wrap by name. See: https://lists.freedesktop.org/archives/mesa-dev/2015-June/086721.html et seq. https://bugs.freedesktop.org/show_bug.cgi?id=90311 Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* mapi: remove duplicate GL typedefsEmil Velikov2018-01-251-7/+0
| | | | | | | | Remove the instances already available in gl.h or glext.h. Sadly GLclampx is only available in GLES(1) so we need to keep that one. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mapi: remove non applicable HAVE_DIX_CONFIG_H hunkEmil Velikov2018-01-251-6/+0
| | | | | | | | Seeming artefact from when the xserver build was diving directly into mesa's tree. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mapi: autotools: remove unused MAPI_FILES file listEmil Velikov2018-01-251-11/+0
| | | | | | | The sole user was OpenVG, which was removed couple of years ago. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* autotools: include meson build files in tarballDylan Baker2018-01-192-2/+8
| | | | | | | | | | | | This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Acked-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* meson: Use consistent style for testsDylan Baker2018-01-114-17/+21
| | | | | | | Don't use intermediate variables, use consistent whitespace. Acked-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
* meson: Use consistent styleDylan Baker2018-01-113-6/+12
| | | | | | | | | | | | | | | | | | | | Currently the meosn build has a mix of two styles: arg : [foo, ... bar], and arg : [ foo, ..., bar, ] For consistency let's pick one. I've picked the later style, which I think is more readable, and is more common in the mesa code base. v2: - fix commit message Acked-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
* mesa: Tidy up the 4.6 section of GL4x.xmlNeil Roberts2018-01-061-5/+10
| | | | | | | | The enums are moved to the top and indented like the rest of the file. Comments are added to split up the function aliases by corresponding extension. This should make no functional difference. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>