aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add EXT_dsa glGetVertexArray* 4 functionsPierre-Eric Pelloux-Prayer2019-11-053-4/+279
| | | | | | | | | | | | The implementation doesn't share much with get.c because: * the refactoring needed for get.c to not depend on ctx->Array.VAO would be quite large * glGetVertexArray* would still need to filter pname to only accept the one specified by the spec * these functions are getter, the implementation is trivial (the complexity is in the correct filtering of pname input) Reviewed-by: Marek Olšák <[email protected]>
* mesa: extract helper function from _mesa_GetPointervPierre-Eric Pelloux-Prayer2019-11-052-29/+47
| | | | | | Will be used by EXT_dsa gllGetVertexArrayPointervEXT implementation. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa EnableVertexArrayAttribEXT / DisableVertexArrayAttribEXTPierre-Eric Pelloux-Prayer2019-11-053-2/+38
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glEnableVertexArrayEXT / glDisableVertexArrayEXTPierre-Eric Pelloux-Prayer2019-11-053-2/+69
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add gl_vertex_array_object parameter to client state helpersPierre-Eric Pelloux-Prayer2019-11-051-22/+25
| | | | | | | This will allow to use the same helper for the EXT_direct_state_access implementation. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glVertexArray* functions implementationPierre-Eric Pelloux-Prayer2019-11-051-0/+308
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add vao/vbo lookup helper for EXT_dsaPierre-Eric Pelloux-Prayer2019-11-051-0/+32
| | | | | | | | Add a single helper dealing with the lookup of both the vao and the vbo to avoid duplicating this code in all the glVertexArray* functions. Reviewed-by: Marek Olšák <[email protected]>
* mesa: rework _mesa_lookup_vao_err to allow usage from EXT_dsaPierre-Eric Pelloux-Prayer2019-11-053-18/+36
| | | | | | | | | ARB_dsa and EXT_dsa slightly differs when an uninitialized VAO is requested. In this case ARB_dsa fails while EXT_dsa requires to initialize the object. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glVertexArray* functions declarationsPierre-Eric Pelloux-Prayer2019-11-053-11/+148
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: pass vao as a function paramterPierre-Eric Pelloux-Prayer2019-11-051-60/+94
| | | | | | | This change will allow reusing the same function for the EXT_direct_state_access implementation. Reviewed-by: Marek Olšák <[email protected]>
* mesa: check draw buffer completeness on glClearBufferfi/glClearBufferivLionel Landwerlin2019-11-021-0/+12
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* main: fix several 'may be used uninitialized' warningsAndrii Simiklit2019-10-311-0/+2
| | | | | | | | | | | | This patch fixes approximately 39 warnings in 'texcompress_etc.c' for the release configuration v2: Fixed by adding the unreachable case to the etc2_rgb8_fetch_texel ( Eric Engestrom <[email protected]> ) Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Signed-off-by: Andrii Simiklit <[email protected]>
* mesa: enable ARB_gpu_shader_int64 in compat profileTapani Pälli2019-10-302-39/+39
| | | | | | Signed-off-by: Tapani Pälli <[email protected]> Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add [Program]Uniform*64ARB display list supportTapani Pälli2019-10-301-0/+979
| | | | | | | | This is required for int64 to be enabled in compat profile. Signed-off-by: Tapani Pälli <[email protected]> Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/main: Ignore filter state for MS texture completenessIllia Iorin2019-10-251-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | After the discussion in https://github.com/KhronosGroup/OpenGL-API/issues/45 the section 8.17 (texture completeness) of the OpenGL 4.6 core profile was changed to explicitly say that multisample texture completeness ignores filter state of the texture. "Using the preceding definitions, a texture is complete unless any of the following conditions hold true: ... - The minification filter requires a mipmap (is neither NEAREST nor LINEAR), the texture is not multisample, and the texture is not mipmap complete. - The texture is not multisample; either the magnification filter is not NEAREST, or the minification filter is neither NEAREST nor NEAREST_- MIPMAP_NEAREST; and any of – The internal format of the texture is integer (see table 8.12). – The internal format is STENCIL_INDEX. – The internal format is DEPTH_STENCIL, and the value of DEPTH_- STENCIL_TEXTURE_MODE for the texture is STENCIL_INDEX." Signed-off-by: Danylo Piliaiev <[email protected]> Signed-off-by: Illia Iorin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* Revert "mesa/main: Fix multisample texture initialize"Illia Iorin2019-10-251-25/+13
| | | | | | | | | | This reverts commit a113a42e7369a4e43a1db1c9a7a35a3f7175615e. Per https://github.com/KhronosGroup/OpenGL-API/issues/45 it was a wrong way to fix the issue. Signed-off-by: Illia Iorin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: Fix a bunch of undefined left-shifts in u_format_*Adam Jackson2019-10-241-3/+3
| | | | | Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* mesa: Redefine the RG formats as array formats.Eric Anholt2019-10-208-62/+32
| | | | | | | | | This is the layout used in the GL API, and maps directly to PIPE formats with no endianness trickery. As with the LA change, this fixes big-endian fetching from texbos. Also cleans up some endian shenanigans in shader images. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Replace MESA_FORMAT_L8A8/A8L8 UNORM/SNORM/SRGB with an array format.Eric Anholt2019-10-207-39/+25
| | | | | | | | | | | | | | | | | The array format is what the GL API wants (fixing texbos on big-endian), and matches directly to gallium's corresponding array format. The only driver exposing A8L8 was radeon/r200 in big-endian, where the HW's underlying format was trying to read as array and we needed to flip things around to make our packed format come out right (note that while the radeon format tables had both AL and LA, ChooseTextureFormat would only pick one of them based on endianness). v2: Don't make r200/radeon use endian swaps. v3: Rebase on dropping the r200 _be/_le format table removal patch v4: reword commit message to explain why we can drop both formats from radeon. Reviewed-by: Marek Olšák <[email protected]> (v1)
* mesa: Replace the LA16_UNORM packed formats with one array format.Eric Anholt2019-10-205-8/+5
| | | | | | | | | | | The array format is what the GL API wants (and we made a mistake in the format returned for texbos on big-endian!), and it's exactly what the gallium-side PIPE_FORMAT_L16A16 is. The only downside is that dri_util tries to fall back to sampling RG16 using LA16, which doesn't have a match for big-endian any more. No HW drivers supported A16L16 anyway. Reviewed-by: Marek Olšák <[email protected]>
* Revert "egl: Fixes transparency with EGL and X11."Hal Gentz2019-10-181-3/+0
| | | | This reverts commit 90a19074b4e1d4d8f8ababaade8170c05aeecffe.
* mesa/main: GL_GEOMETRY_SHADER_INVOCATIONS exists in GL_OES_geometry_shaderIago Toral Quiroga2019-10-181-1/+3
| | | | | | | | It seems that for desktop GL this was included with ARB_gpu_shader5, but for OpenGL ES this is already included with the base extension and there is a CTS test that checks this. Reviewed-by: Marek Olšák <[email protected]>
* mesa: implement glTextureStorageNDEXT functionsPierre-Eric Pelloux Prayer2019-10-181-38/+24
| | | | | | | | Implement the 3 functions using the texturestorage_error() helper. _mesa_lookup_or_create_texture is always called to make sure that 'texture' is initialized (even if the texturestorage_error() generates an error afterwards). Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa NamedCopyBufferSubDataEXT functionPierre-Eric Pelloux-Prayer2019-10-183-2/+31
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa NamedRenderbufferStorageMultisampleEXT functionPierre-Eric Pelloux-Prayer2019-10-182-0/+24
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa Generate*MipmapEXT functionsPierre-Eric Pelloux-Prayer2019-10-183-2/+35
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: refactor GenerateTextureMipmap handlingPierre-Eric Pelloux-Prayer2019-10-181-32/+25
| | | | | | Rework _mesa_GenerateTextureMipmap to allow code sharing with EXT_dsa functions. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glGetFloati_vEXT/glGetDoublei_vEXTPierre-Eric Pelloux-Prayer2019-10-181-2/+0
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa + EXT_gpu_program_parameters functionsPierre-Eric Pelloux-Prayer2019-10-183-15/+45
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa + EXT_gpu_shader4 functionsPierre-Eric Pelloux-Prayer2019-10-181-8/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa + EXT_texture_integer functionsPierre-Eric Pelloux-Prayer2019-10-184-8/+292
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa + EXT_texture_buffer_object functionsPierre-Eric Pelloux-Prayer2019-10-183-2/+69
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glProgramUniform*EXT functionsPierre-Eric Pelloux-Prayer2019-10-181-25/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa NamedProgram functionsPierre-Eric Pelloux-Prayer2019-10-184-72/+404
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glClientAttribDefaultEXT / glPushClientAttribDefaultEXTPierre-Eric Pelloux-Prayer2019-10-183-2/+83
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glNamedRenderbufferStorageEXT and ↵Pierre-Eric Pelloux-Prayer2019-10-183-2/+43
| | | | | | glGetNamedRenderbufferParameterivEXT Reviewed-by: Marek Olšák <[email protected]>
* mesa: Refactor the entirety of _mesa_format_matches_format_and_type().Eric Anholt2019-10-176-642/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | This function was difficult to implement for new formats due to the combination of endianness and swapbytes support. Since it's mostly used for fast paths, bugs in it were often missed during testing. Just reimplement it on top of the recent _mesa_format_from_format_and_type() which can give us a canonical MESA_FORMAT for a format and type enum (while respecting endianness). Fixes: - R4G4B4A4_UNORM, B4G4R4_UINT, R4G4B4A4_UINT incorrectly matched with swapBytes (you can't just reverse the channels if the channels aren't bytes) - A4R4G4B4_UNORM and A4R4G4B4_UINT missing BGRA/4444_REV matches - failing to match RGB/BGR unorm8 array formats on BE - 2101010 formats incorrectly matching with swapBytes set. - UINT/SINT byte formats failed to match with swapBytes set. This deletes the part of tests/mesa_formats.cpp that called _mesa_format_matches_format_and_type() to make sure it didn't assertion fail, as it now would assertion fail due to the fact that we were passing an invalid format (GL_RG) for most types. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for array formats of depth and stencil.Eric Anholt2019-10-176-8/+83
| | | | | | | | | | | In desktop GL, you can specify things like GL_DEPTH_COMPONENT/GL_BYTE as a ReadPixels format, and we need to be able to represent that to see if we have proper MESA_FORMATs for them. That's exactly what the mesa_array_format enum is for. v2: Drop _mesa from static fn. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add format/type matching for DEPTH/UINT_24_8.Eric Anholt2019-10-171-0/+2
| | | | | | | | We had missed this case where GLES3 allows glReadPixels(DEPTH, UINT_24_8), and just got lucky by the readpixels path never asking for the matching format from this function. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix depth/stencil ordering in _mesa_format_from_format_and_type().Eric Anholt2019-10-171-1/+1
| | | | | | | | | | The GL spec says the 24-bit component is in the high bits, and format_unpack.c looks at the high 24 bits in the S8Z24 case, not Z24SS8. Avoids a regression in the next commit. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add debug info to _mesa_format_from_format_and_type() error path.Eric Anholt2019-10-171-0/+4
| | | | | | | The unreachable() that follows isn't very useful for debug, and by adding this here we get a nice description of the failure in debug builds. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix invalid target error handling for teximagePierre-Eric Pelloux-Prayer2019-10-161-7/+8
| | | | | | | | | This commit moves the target check before using _mesa_get_current_tex_object to fix a "Mesa implementation error: bad target in _mesa_get_current_tex_object()" error. Fixes: 9dd1f7cec01 ("mesa: pass gl_texture_object as arg to not depend on state") Reviewed-by: Marek Olšák <[email protected]>
* mesa: Handle pbuffers in desktop GL framebuffer attachment queriesKenneth Graunke2019-10-151-5/+7
| | | | | | | | | | Once again, we were handling back-to-front in the GLES3 case, but not the desktop GL case. Fixes GTF-GL46.gtf30.GL3Tests.framebuffer_srgb.framebuffer_srgb_default_encoding when run with --deqp-surface-type=pbuffer --deqp-gl-context-type=egl. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Make back_to_front_if_single_buffered non-staticKenneth Graunke2019-10-152-5/+9
| | | | | | | So I can use it in fbobject.c in the next commit. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Use ctx->ReadBuffer in glReadBuffer back-to-front testsKenneth Graunke2019-10-151-4/+5
| | | | | | | | | We were looking at ctx->DrawBuffer when asking about the read buffer, which was good enough for CTS purposes, but definitely not right. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Fixes transparency with EGL and X11.Hal Gentz2019-10-111-0/+3
| | | | | | | | | | | | | This commit does this by allowing both RGB and RGBA visuals to match with EGL configs. We also expose the `EGL_MESA_config_select_group` egl extension, which is similar to GLX's visual select group extension, to allow the RGBA visuals to get less priority. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676 Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs" Cc: [email protected] Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Hal Gentz <[email protected]>
* mesa/main: prefer R8-textures instead of A8 for glBitmap in display listsErik Faye-Lund2019-10-092-3/+11
| | | | | | | This allows drivers to communicate that they prefer R8 textures rather than A8 for glBitmap usage. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Allow MESA_framebuffer_flip_y for GLES 3Fritz Koenig2019-10-084-13/+62
| | | | | | | | Implement glFramebufferParameteriMESA on GLES 3 so that the extension is not dependant on GLES 3.1 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* mesa: don't forget to clear _Layer field on texture unitLionel Landwerlin2019-10-011-1/+1
| | | | | | | | | | | | | | On the Android Antutu benchmark we ran into an assert in ISL where the (base layer + num layers) > total layers. It turns out the core of mesa forgot to clear the _Layer variable, potentially leaving an inconsistent value. v2: Pull setting u->_Layer out of the conditional blocks (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Cc: <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: Extension boilerplate for EXT_demote_to_helper_invocationCaio Marcelo de Oliveira Filho2019-09-302-0/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>