summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add EXT_shader_image_load_store glBindImageTextureEXT functionPierre-Eric Pelloux-Prayer2019-08-063-9/+47
| | | | | | | The implementation is almost identical to glBindImageTexture except for error checking. Reviewed-by: Marek Olšák <[email protected]>
* glapi: add EXT_shader_image_load_storePierre-Eric Pelloux-Prayer2019-08-062-0/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glMultiTexCoordPointerEXT functionPierre-Eric Pelloux-Prayer2019-08-063-2/+30
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glMultiTexGen* functionsPierre-Eric Pelloux-Prayer2019-08-063-145/+262
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glCopyMultiTexImage* and glCopyMultiTexSubImage*Pierre-Eric Pelloux-Prayer2019-08-064-5/+308
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glGetMultiTexParameteriv/fvEXTPierre-Eric Pelloux-Prayer2019-08-063-3/+49
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glMultiTexSubImage1D/2D/3DEXTPierre-Eric Pelloux-Prayer2019-08-064-3/+231
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glMultiTexImage1D/2D/3DEXT + glGetMultiTexImageEXTPierre-Eric Pelloux-Prayer2019-08-066-5/+299
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add glBindMultiTextureEXT display list supportPierre-Eric Pelloux-Prayer2019-08-061-0/+23
| | | | | | Fixes: 0972b0b059d ("mesa: add support for glBindMultiTextureEXT") Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glMultiTexParameter* functionsPierre-Eric Pelloux-Prayer2019-08-064-4/+192
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa (Get)MultiTexEnv functionsPierre-Eric Pelloux-Prayer2019-08-063-1/+175
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add _mesa_(get)texenvi(f)v_indexed helpersPierre-Eric Pelloux-Prayer2019-08-061-27/+50
| | | | | | | They are exactly like _mesa_GetTexEnvfv/_mesa_GetTexEnviv except they take a GLuint texunit parameter instead of relying of ctx->Texture.CurrentUnit. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add new helper _mesa_get_texobj_by_target_and_texunitPierre-Eric Pelloux-Prayer2019-08-063-43/+82
| | | | | | | Based on the 'static get_texobj_by_target' function from texparam.c, but extended to also take the texunit as a parameter. Reviewed-by: Marek Olšák <[email protected]>
* mesa: replace _mesa_get_current_fixedfunc_tex_unit with ↵Pierre-Eric Pelloux-Prayer2019-08-064-12/+10
| | | | | | | | | | _mesa_get_fixedfunc_tex_unit The new function implements the same feature but doesn't depend on ctx->Texture.CurrentUnit. This change allows to use it from indexed functions. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add an ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: replace MAYBE_UNUSED with UNUSEDEric Engestrom2019-07-311-2/+2
| | | | | | | | MAYBE_UNUSED is going away, so let's replace legitimate uses of it with UNUSED, which the former aliased to so far anyway. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: drop MAYBE_UNUSED varEric Engestrom2019-07-311-3/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: add EXT_dsa indexed generic queriesPierre-Eric Pelloux-Prayer2019-07-304-4/+40
| | | | | Only GetPointerIndexedvEXT needs an implementation, the other functions are aliases of existing functions.
* mesa: add EXT_dsa indexed texture commands functionsPierre-Eric Pelloux-Prayer2019-07-303-2/+54
| | | | | | | | | | | | | | | | | | | | | Added functions: - EnableClientStateIndexedEXT - DisableClientStateIndexedEXT - EnableClientStateiEXT - DisableClientStateiEXT Implemented using the idiom provided by the spec: if (array == TEXTURE_COORD_ARRAY) { int savedClientActiveTexture; GetIntegerv(CLIENT_ACTIVE_TEXTURE, &savedClientActiveTexture); ClientActiveTexture(TEXTURE0+index); XXX(array); ClientActiveTexture(savedActiveTexture); } else { // Invalid enum }
* mesa: add EXT_dsa (Named)Framebuffer functionsPierre-Eric Pelloux-Prayer2019-07-305-22/+311
| | | | | | | | | | These functions dont support display list as specified: Should the selector-free versions of various OpenGL 3.0 and EXT_framebuffer_object framebuffer object commands not be allowed in display lists [...]? RESOLVED: Yes
* mesa: add EXT_dsa NamedBuffer functionsPierre-Eric Pelloux-Prayer2019-07-303-9/+121
|
* mesa: extension boilerplate for EXT_texture_shadow_lodPaulo Zanoni2019-07-302-0/+2
| | | | | | | | With the help of Sagar, Ian and Ivan. Signed-off-by: Paulo Zanoni <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/spirv: Set frag_coord_is_sysval to GLSLFragCoordIsSysValJason Ekstrand2019-07-291-0/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* main: unreference ATIFragmentShader program before creating new oneYevhenii Kolesnikov2019-07-261-1/+4
| | | | | | | Old program was overwritten without release of memory. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* mesa: Fix GetTextureImage error reporting, againPierre-Eric Pelloux-Prayer2019-07-251-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Iago Toral Quiroga fixed this in commit 94f740e3fce0cb26e4d90cb9de75b, but it recently regressed in 0d8826f723cd8868b5271f17f18a1ab4548a1199. Quoting Iago's original commit message for the fix: GetTex*Image should return INVALID_ENUM if target is not valid, however, GetTextureImage does not receive a target, and instead should return INVALID_OPERATION if the effective target is not valid. From the OpenGL 4.6 core profile spec, section 8.11 Texture Queries: "An INVALID_OPERATION error is generated by GetTextureImage if the effective target is not one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_RECTANGLE, or TEXTURE_CUBE_MAP (for GetTextureImage only)." Note that this differs from the original ARB_direct_state_access spec. However, the EXT_direct_state_access version does take a target parameter, so it should continue reporting INVALID_ENUM. Fixes KHR-GL45.direct_state_access.textures_image_query_errors. Fixes: 0d8826f723c ("mesa: refactor get_texture_image to remove duplicate code") Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Enable GL_MESA_framebuffer_flip_y for GL 4.3Heinrich Fink2019-07-251-1/+1
| | | | | | | | Extend MESA_framebuffer_flip_y to be used with OpenGL versions 4.3 and higher. OpenGL 4.3 adds FramebufferParameteri needed by this extension. Reviewed-by: Fritz Koenig <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* main: Free memory allocated for gl_bitmap_atlas structureYevhenii Kolesnikov2019-07-241-0/+1
| | | | | | | | | Structure itself wasn't freed during context tear-down, causing a memory leak on iris. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* main: Fix memleaks in mesa_use_programYevhenii Kolesnikov2019-07-241-0/+2
| | | | | | | | | Add freeing of SubroutineIndexes to the _mesa_free_shader_state. Fixes: 4566aaaa5b1 ("mesa/subroutines: start adding per-context subroutine index support (v1.1)") Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix ReadBuffers with pbuffersKenneth Graunke2019-07-221-18/+17
| | | | | | | | | | | | pbuffers are internally single-buffered. Marek fixed DrawBuffers to handle this case, but we need to fix ReadBuffers too. Otherwise, pretty much every conformance test fails because glReadPixels breaks. v2: Refactor the switch into a helper (suggested by Eric Anholt) Fixes: 35294f2eca8 ("mesa: fix pbuffers because internally they are front buffers") Acked-by: Eric Engestrom <[email protected]> (v1) Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix assertion failure in TexImageMarek Olšák2019-07-221-8/+6
| | | | | | | | | | Check the assertion after error checking. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111194 Fixes: 9dd1f7cec01 ("mesa: pass gl_texture_object as arg to not depend on state") Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add EXT_dsa glEnabledIndexedEXTPierre-Eric Pelloux-Prayer2019-07-192-0/+74
| | | | | | | | | | | | The implementation uses _mesa_ActiveTexture to change the active texture unit and then reset it. It causes an unnecessary _NEW_TEXTURE_STATE but: - adding an index argument to _mesa_set_enable causes a lot of changes (~140 callers) - enable_texture (called by _mesa_set_enable) might cause a _NEW_TEXTURE_STATE anyway. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glGetTextureLevelParameter*vEXT functionsPierre-Eric Pelloux-Prayer2019-07-193-2/+53
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa gl(Copy)Texture(Sub)Image1D/2D/3DEXT functionsPierre-Eric Pelloux-Prayer2019-07-196-11/+726
| | | | | | | | | | | | | | | | | | | Added functions: - glTextureImage1DEXT - glTextureImage2DEXT - glTextureImage3DEXT - glTextureSubImage1DEXT - glTextureSubImage3DEXT - glCopyTextureImage1DEXT - glCopyTextureImage2DEXT - glCopyTextureSubImage1DEXT - glCopyTextureSubImage2DEXT - glCopyTextureSubImage3DEXT - glGetTextureImageEXT All but the last one can be compiled in a display list. Reviewed-by: Marek Olšák <[email protected]>
* mesa: move lookup_texture_ext_dsa up in teximage.cPierre-Eric Pelloux-Prayer2019-07-191-63/+60
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: pass gl_texture_object as arg to not depend on statePierre-Eric Pelloux-Prayer2019-07-191-28/+32
| | | | | | This will allow to use the same functions for EXT_dsa implementation. Reviewed-by: Marek Olšák <[email protected]>
* mesa: refactor get_texture_image to remove duplicate codePierre-Eric Pelloux-Prayer2019-07-191-50/+32
| | | | | | | | Move shared code in a new function (_get_texture_image) and use it instead of duplicating the same lines. Will be also used by the EXT_dsa functions (GetTextureImageEXT and GetMultiTexImageEXT). Reviewed-by: Marek Olšák <[email protected]>
* main: Destroy static hash tableYevhenii Kolesnikov2019-07-191-0/+8
| | | | | | | | | format_array_format_table has a static lifetime - it will be destroyed by an atexit handler. Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Optionally declare gl_PointCoord as a system valueAndreas Baierl2019-07-181-1/+5
| | | | | | Signed-off-by: Andreas Baierl <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* spirv_extensions: i965: initialize SPIR-V extensionsAlejandro Piñeiro2019-07-171-0/+2
| | | | | | v2: Rebase update after changes on previous patches. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* spirv_extensions: add spirv_supported_extensions on gl_constantsAlejandro Piñeiro2019-07-172-1/+21
| | | | | | | | | We can use it to get real values for ARB_spirv_extensions methods. Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* spirv_extensions: define spirv_extensions_supportedAlejandro Piñeiro2019-07-172-0/+43
| | | | | | | | | | | | | | | | | | | | | | Add a struct to maintain which SPIR-V extensions are supported, and an utility method to initialize it based on nir_spirv_supported_capabilities. v2: * Fixing code style (Ian Romanick) * Adding a prefix (spirv) to fill_supported_spirv_extensions (Ian Romanick) v3: rebase update (nir_spirv_supported_extensions renamed) v4: include AMD_gcn_shader support v5: move spirv_fill_supported_spirv_extensions to src/mesa/main/spirv_extensions.c Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* spirv_extensions: add list of extensions and to_string methodAlejandro Piñeiro2019-07-172-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ideally this should be generated somehow. One option would be gather all the extension dependencies listed on the core grammar, but there would be the possibility of not including some of the extensions. Note that spirv-tools is doing it just slightly better, as it has a hardcoded list of extensions manually took from the registry, that they parse to get the enum and the to_string method (see generate_grammar_tables.py). v2: * Use a macro to improve readability. (Tapani Pälli) * Add unreachable on the switch, no default (Eric Engestrom) * No typedef enum (Ian Romanick) * Sort extensions names (Ian Romanick) * Don't add extensions unlikely to be supported by Mesa at any point (Ian Romanick) v3: rebase update v4: Include AMD_gcn_shader v5: move spirv_extensions_to_string to src/mesa/main/spirv_extensions.c Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* spirv_extensions: add GL_ARB_spirv_extensions boilerplateAlejandro Piñeiro2019-07-177-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | v2: * Mention extension gap at gl_API.xml (Emil Velikov) * Bail with INVALID_ENUM if extension not available on getStringi (Emil Velikov) * Use EXTRA_EXT macro when defining the extension at get.c/get_hash_params.py (Emil Velikov) * Rename source files (spirvextensions.[ch] -> spirv_extensions.[ch]) (Ian) v3: * Fix GL_PROGRAM_BINARY_FORMATS glGet query, broken by error on a previous rebase v4: * Fix rebase conflicts on getstring.c after GL_SHADING_LANGUAGE_VERSION query was added v5: * Remove src/mapi/glapi/gen/Makefile.am as it no longer exists in master Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* swrast: Move _mesa_format_pack_colormask() to the only caller.Eric Anholt2019-07-162-76/+0
| | | | | | | | | This avoids needing format_pack to have access to the GLenum return functions for mesa_format. It seems like an odd function and unlikely to be reused. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: Give _mesa_format_get_color_encoding a clearer name.Eric Anholt2019-07-167-22/+12
| | | | | | | It only returned one of two values. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: Fold _mesa_unpack_depth_stencil_row() into its only caller.Eric Anholt2019-07-163-34/+14
| | | | | | | This was the last bit of gl.h usage in format packing. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: Convert format_pack/unpack off of GL types.Eric Anholt2019-07-164-353/+352
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: Port format_pack/unpack off of _mesa_problem().Eric Anholt2019-07-162-47/+17
| | | | | | | unreachable() should be plenty of debug for these. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: Mostly switch Mesa format info off of GL types other than GLenum.Eric Anholt2019-07-162-142/+144
| | | | | | | | I'm considering moving most of this code to src/util/, and I want that code to not expose GL types in its interfaces. Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>