aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/extensions.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa/main: do not pass context to one-time extension initErik Faye-Lund2020-04-271-5/+5
| | | | | | | | | _mesa_problem doesn't use the ctx argument for anything, so there's no reason to pass it. This saves us from needing a context passed down this code-path in the first place. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* mesa/main: do not store unrecognized extensions in contextErik Faye-Lund2020-04-271-13/+18
| | | | | | | | | | | | | We process extension overrides only when we initialize the first context, which means that unrecognized extensions only appear in the first context created. Let's instead store them in a global array, so we can apply them to all contexts. This has the added benefit of making the initialization of the first context less special, which allows us to clean up code a bit more. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4765>
* remove final imports.h and imports.c bitsDylan Baker2020-04-211-1/+1
| | | | | | | | | | | This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* Move compiler.h and imports.h/c from src/mesa/main into src/utilMarek Olšák2020-03-271-1/+1
| | | | | Reviewed-by: Timothy Arceri <[email protected] Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
* mesa: use binary search for MESA_EXTENSION_OVERRIDEEric Engestrom2019-06-301-6/+16
| | | | | | | | | | | Not a hot path obviously, but the table still has 425 extensions, which you can go through in just 9 steps with a binary search. The table is already sorted, as required by other parts of the code and enforced by mesa's `main-test`. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Revert "mesa: remove unnecessary 'sort by year' for the GL extensions"Emil Velikov2018-10-031-2/+44
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3d81e11b49366b5636b8524ba0f8c7076e3fdf34. As reported by Federico, some games require the 'sort by year' since they truncate the extensions which do not fit the fixed size string array. Seemingly I did not consider that, as the documentation (both Mesa and Nvidia) mentions about program crashes ... which are worked around by setting the env. variable. This commit reinstates the workaround and enhances the documentation. Cc: Marek Olšák <[email protected]> Cc: Ian Romanick <[email protected]> Reported-by: Federico Dossena <[email protected]> Fixes: 3d81e11b493 ("mesa: remove unnecessary 'sort by year' for the GL extensions") Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Federico Dossena <[email protected]>
* mesa: remove struct gl_extensions::ATI_separate_stencilEmil Velikov2018-06-211-1/+0
| | | | | | | | | | | | Virtually every driver that supports ATI_separate_stencil also supports EXT_stencil_two_side. Use the latter boolean for both extension. With that in mind we can drop the explicit true from the drivers and the nasty comment in compute_version(). Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Unconditionally enable floating-point texturesTimothy Arceri2018-06-181-2/+0
| | | | | | | | | | | | | | ARB_texture_float references US Patent #6,650,327 [1] which has a filing date of June 16 1998. According to [2], patents filed after 1995 expire 20 years from the filing date, giving an expiration of June 17 2018. [1] https://www.google.com/patents/US6650327 [2] https://en.wikipedia.org/wiki/Term_of_patent_in_the_United_States Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: return 'unrecognized' extensions in glGetStringiEmil Velikov2017-11-161-0/+13
| | | | | | | | Analogous to the glGetString() case - report all the extensions enabled via MESA_EXTENSION_OVERRIDE Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: rework the way we manage extra_extensionsEmil Velikov2017-11-161-43/+33
| | | | | | | | | | | | | | Store pointers to the tokenized strings in the gl_extensions struct. This way we can reuse them in glGetStringi() while we construct the really long string only in _mesa_make_extension_string. Only 16 pointers/strings are stored for now. v2: Warn only once when we provide more than 16 unk. extensions, rebase Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: pass the ctx to _mesa_one_time_init_extension_overridesEmil Velikov2017-11-161-1/+1
| | | | | | | Will be needed with next commit Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: call atexit() only as neededEmil Velikov2017-11-161-3/+1
| | | | | | | | | | If the extra_extensions string is empty there's no need to call atexit() - there's nothing to free. v2: Rebase Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]> (v1)
* mesa: remove unnecessary 'sort by year' for the GL extensionsEmil Velikov2017-11-161-50/+3
| | | | | | | | | | | | | | | | | | | The sorting was originally added to work around broken games (comment says Quake3 demo) that were copying the extensions list into small buffer. Sorting does not solve the problem, since we'll still overflow and cause corruption/crash. Better workaround is to actually trim the string ... as done with a later commit which introduces the MESA_EXTENSION_MAX_YEAR env. variable. Side note: On my machine, the existing sorting makes no changes to the extensions string. Cc: Jose Fonseca <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: reuse set_extension() for _mesa_extension_override_disablesEmil Velikov2017-11-161-4/+3
| | | | | | | | We already use it for _mesa_extension_override_enables. Improve consistency and use it for both extension lists. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: drop unnecessary coping of extra_extensionsEmil Velikov2017-11-161-11/+6
| | | | | | | | | | The function get_extension_override() returns a copy of a string, only for it to be copied again ... Drop the unneeded calloc/strdup/free dance. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove duplicate 'disabled extensions' listEmil Velikov2017-11-161-7/+1
| | | | | | | | | | | | | | | While parsing MESA_EXTENSION_OVERRIDE we keep track of the disabled extensions, twice - in _mesa_extension_override_disables and disabled_extensions. Upon context creation, we use the former to modify the extensions list. Yet, we still check the updated list against disabled_extensions. Remove disabled_extensions, it's obsolete. Cc: Jordan Justen <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: split extensions overrides and glGetString(GL_EXTENSIONS)Emil Velikov2017-11-161-20/+12
| | | | | | | | | | | | | Currently we apply the extension overrides and construct the extensions string upon MakeCurrent. They are two distinct things, so let's slit the two while pushing the overrides management _before_ _mesa_compute_version(). This ensures that the version is updated to reflect the enabled/disabled extensions. Cc: Jordan Justen <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Drop Mesa_DXTn from gl_contextMatt Turner2017-10-021-4/+2
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Implement GL_ARB_texture_filter_anisotropicAdam Jackson2017-08-251-0/+1
| | | | | | | | | | | The only difference from the EXT version is bumping the minmax to 16, so just hit all the drivers at once. v2: Fix driver names, add to 17.3 release notes (Ilia Mirkin) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: reuse main extension table to appropriately restrict extensionsIlia Mirkin2016-07-231-26/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we were only restricting based on ES/non-ES-ness and whether the overall enable bit had been flipped on. However we have been adding more fine-grained restrictions, such as based on compat profiles, as well as specific ES versions. Most of the time this doesn't matter, but it can create awkward situations and duplication of logic. Here we separate the main extension table into a separate object file, linked to the glsl compiler, which makes use of it with a custom function which takes the ES-ness of the shader into account (thus allowing desktop shaders to properly use ES extensions that would otherwise have been disallowed.) We can also now use this logic to generate #define's for all supported extensions automatically, removing the duplicate (and often inaccurate) list in glcpp. The effect of this change should be nil in most cases. However in some situations, extensions like GL_ARB_gpu_shader5 which were formerly available in compat contexts on the GLSL side of things will now become inaccessible. This regresses two ES CTS tests: ES3-CTS.shaders.shader_integer_mix.define ES31-CTS.shader_integer_mix.define however that is due to them using #version 100 instead of 300 es. As the extension is only defined for ES3, I believe this is the correct behavior. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v2) v2 -> v3: integrate glcpp defines into the same mechanism
* mesa/extensions: Enable overriding permanently enabled extensionsNanley Chery2015-11-221-40/+24
| | | | | | | | | Provide the ability to prevent any permanently enabled extension from appearing in the string returned by glGetString[i](). Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: whitespaces fixes in _mesa_one_time_init_extension_overrides()Brian Paul2015-11-201-6/+7
| | | | Trivial.
* mesa: Replace gl_extensions::EXT_texture3D with ::dummy_trueNanley Chery2015-11-121-1/+0
| | | | | | | | | | Mesa unconditionally sets this driver flag to true in _mesa_init_extensions(). There is therefore no need for the driver to communicate support for this extension. Replace the driver capability flag with ::dummy_true. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Prefix global struct and extension typeNanley Chery2015-11-121-20/+20
| | | | | | | | | | | | | Rename the following types and variables: * struct extension -> struct mesa_extension, like the mesa_format type. * extension_table -> _mesa_extension_table, like the _mesa_extension_override_{enables,disables} structs. Suggested-by: Marek Olšák <[email protected]> Suggested-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Generate a helper function for each extensionNanley Chery2015-11-121-22/+1
| | | | | | | | | | | | | | | | | Generate functions which determine if an extension is supported in the current context. Initially, enums were going to be explicitly used with _mesa_extension_supported(). The idea to embed the function and enums into generated helper functions was suggested by Kristian Høgsberg. For performance, the function body no longer uses _mesa_extension_supported() and, as suggested by Chad Versace, the functions are also declared static inline. v2: Place function qualifiers on separate line (Chad) v3: Move function curly brace to new line (Chad) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Replace extension::api_set with ::versionNanley Chery2015-11-121-18/+3
| | | | | | | | | | | | | | | The api_set field has no users outside of _mesa_extension_supported(). Remove it and allow the version field to take its place. The brunt of the transformation was performed with the following vim commands: s/\(GL [^,]\+\),\s*\d*,\s*\d*\(,\s*\d*\)\(,\s*\d*\)/\1, GLL, GLC\2\3/g s/\(GLL [^,]\+\)\,\s*\d*/\1, GLL/g s/\(GLC [^,]\+\)\(,\s*\d*\),\s*\d*\(,\s*\d*\)\(,\s*\d*\)/\1\2, GLC\3\4/g s/\( ES1[^,]*\)\(,\s*\(\w\|\d\)\+\)\(,\s*\(\w\|\d\)\+\),\s*\d*/\1\2\4, ES1/g s/\( ES2[^,]*\)\(,\s*\(\w\|\d\)\+\)\(,\s*\(\w\|\d\)\+\)\(,\s*\(\w\|\d\)\+\),\s*\d*/\1\2\4\6, ES2/g Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Use _mesa_extension_supported()Nanley Chery2015-11-121-43/+11
| | | | | | | | Replace open-coded checks for extension support with _mesa_extension_supported(). Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Create _mesa_extension_supported()Nanley Chery2015-11-121-0/+18
| | | | | | | | | | | | Create a function which determines if an extension is supported in the current context. v2: Use common variable names (Emil) Insert new line between variables and return statement (Chad) Rename api_set variable to api_bit (Chad) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Add extension::versionNanley Chery2015-11-121-2/+16
| | | | | | | | | | | | | | | | Enable limiting advertised extension support by context version with finer granularity. This new field is currently unused and is set to 0 everywhere. When it is used, a value of 0 will indicate that the extension is supported for any version of a context. v2: Use uint*t type for version and note the expected values (Emil) Use an 8-bit data type Reformat macro for better readability (Chad) v3: Note preparatory nature of commit (Chad) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Move entries entries to separate fileNanley Chery2015-11-121-325/+1
| | | | | | | | | | With this infrastructure set in place, we can now reuse the entries to generate useful code. v2: Add the new file into Makefile.sources (Emil) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Wrap array entries in macrosNanley Chery2015-11-121-327/+328
| | | | | | | | | | | | | Now that we're using macros, remove the redundant text from each entry. Remove comments between the entries to make editing easier and separate the sections with blank lines. Structure the EXT macros in a way that helps reviewers verify that no meaning has been altered. v2: Indent the entries (Chad) Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa/extensions: Remove array sentinelNanley Chery2015-11-121-18/+25
| | | | | | | | Simplify future updates to the extension struct array by removing the sentinel. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: add ARB_enhanced_layoutsTimothy Arceri2015-11-121-0/+1
| | | | Reviewed-by: Emil Velikov <[email protected]>
* mesa: expose support for GL_EXT_buffer_storageRyan Houdek2015-11-041-0/+1
| | | | | | | | | This extension requires ES 3.1 since it relies on glMemoryBarrier. For testing purposes I temporarily moved glMemoryBarrier to be an ES 3.0 function. This has been tested with the piglit in the ML and the Dolphin emulator. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: expose support for OES/EXT_draw_elements_base_vertex to OpenGL ESRyan Houdek2015-11-011-0/+2
| | | | | | | This has been tested with the piglits in the mailing list and on the Dolphin emulator. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add infra for ARB_shader_clockEmil Velikov2015-10-301-0/+1
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* Revert "mesa: enable KHR_debug for ES contexts"Emil Velikov2015-10-071-1/+1
| | | | | | | This reverts commit b69cfbdf18fa64606a76761b20bc268f4ac731e5. This isn't quite baked yet. Seems that despite building the ES piglits, none of them got executed.
* mesa: enable KHR_debug for ES contextsEmil Velikov2015-10-071-1/+1
| | | | Signed-off-by: Emil Velikov <[email protected]>
* Revert "mesa/extensions: restrict GL_OES_EGL_image to GLES"Dave Airlie2015-09-171-1/+2
| | | | | | | | | | | | | This reverts commit 48961fa3ba37999a6f8fd812458b735e39604a95. glamor/Xwayland use this, the spec saying something when it was written, and the fact that the comment says Mesa relies on it hasn't changed. I also don't have a copy of this patch in my mail archive, which seems wierd, did it get posted to mesa-dev? Signed-off-by: Dave Airlie <[email protected]>
* mesa/extensions: restrict GL_OES_EGL_image to GLESNanley Chery2015-09-151-2/+1
| | | | | | | | Driver vendors do this as well. The extension specification lists GLES 1.1 or 2.0 as requirements. Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/extensions: restrict luminance alpha formats to API_OPENGL_COMPATNanley Chery2015-09-151-2/+2
| | | | | | | According the GL 3.1 spec, luminance alpha formats are deprecated. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa: add infra for ARB_shader_texture_image_samplesIlia Mirkin2015-09-101-0/+1
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add extension enable for OES_texture_storage_multisample_2d_arrayTapani Pälli2015-08-271-0/+1
| | | | | | | | v2: use ARB_texture_multisample bit to enable extension Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add ASTC extensions to the extensions tableNanley Chery2015-08-261-0/+2
| | | | | | | | v2: alphabetize the extensions. remove OES ASTC extension. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* main: add extension GL_ARB_shader_image_sizeMartin Peres2015-08-201-0/+1
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa: Add ES31 API tag for the extension table.Francisco Jerez2015-08-201-0/+7
| | | | | | | | | | I'll mark the OES_shader_image_atomic extension entry with this tag to make sure that we don't expose it on earlier GLES API versions accidentally, because according to the extension: "OpenGL ES 3.1 and GLSL ES 3.10 are required." Reviewed-by: Tapani Pälli <[email protected]>
* mesa: add NV_read_{depth,stencil,depth_stencil} extensionsRob Clark2015-08-121-0/+3
| | | | | | | | These extensions allow reading depth/stencil for GLES contexts, which is useful for tools like apitrace. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add extension tracking for arb_shader_subroutine (v2)Chris Forbes2015-07-231-0/+1
| | | | | | | | | v2: [airlied]: merge version check update. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: enable GL_ARB_get_texture_sub_image for all driversBrian Paul2015-07-211-0/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: define ARB_shader_storage_buffer_object extensionSamuel Iglesias Gonsalvez2015-07-141-0/+1
| | | | | Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Jordan Justen <[email protected]>