aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* shader_enums: Move MAX_DRAW_BUFFERS to this file.Eric Anholt2019-09-271-6/+1
| | | | | | | | | We include shader_enums.h from freedreno's compiler for both GL and Vulkan, and the main/config.h include resulted in polluting the namespace with things like MAX_VIEWPORTS that other Vulkan drivers use as their driver-specific maximums. Reviewed-by: Kristian H. Kristensen <[email protected]>
* Move blob from compiler/ to util/Jason Ekstrand2019-09-191-1/+1
| | | | | | | | There's nothing whatsoever compiler-specific about it other than that's currently where it's used. Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* util/u_queue: track job size and limit the size of queue growthTimothy Arceri2019-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | When both UTIL_QUEUE_INIT_RESIZE_IF_FULL and UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY are set, we can get into a situation where the queue never executes and grows to a huge size due to all other threads being busy. This is the case with the shader cache when attempting to compile a huge number of shaders up front. If all threads are busy compiling shaders the cache queues memory use can climb into the many GBs very fast. The use of these two flags with the shader cache is intended to allow shaders compiled at runtime to be compiled as fast as possible. To avoid huge memory use but still allow the queue to perform optimally in the run time compilation case, we now add the ability to track memory consumed by the jobs in the queue and limit it to a hardcoded 256MB which should be more than enough. Reviewed-by: Marek Olšák <[email protected]>
* mesa/gl: Sync with Khronos registryHeinrich Fink2019-09-161-1/+1
| | | | | | | | | | | | | | | | | | Update GL headers and xml API from upstream Khronos registry (commit 3d0c3eb). Keep `BUILDING_MESA` quirk in glext.h. mesa/extensions: Expose EXT_EGL_sync instead of MESA_EGL_sync to reflect Khronos request of changing this extension's scope from MESA to EXT. EGL_EGL_sync is also the name of the extension that has been merged into the upstream Khronos GL registry. Remove MESA_EGL_sync spec txt from Mesa tree as it is now published as EXT by Khronos. v1: Remove MESA_EGL_sync spec and squash commits (Eric E) Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* mesa: fix texStore for FORMAT_Z32_FLOAT_S8X24_UINTJiadong Zhu2019-09-121-3/+3
| | | | | | | | | | | | _mesa_texstore_z32f_x24s8 calculates source rowStride at a pace of 64-bit, this will make inaccuracy offset if the width of src image is an odd number. Modify src pointer to int_32* as source image format is gl_float which is 32-bit per pixel. Reviewed by Ilia Mirkin Signed-off-by: Jiadong Zhu <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa/spirv: Set a few more extensionsCaio Marcelo de Oliveira Filho2019-09-101-0/+3
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Eliminate gl_config::rgbModeAdam Jackson2019-09-093-3/+0
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Eliminate gl_config::have{Accum,Depth,Stencil}BufferAdam Jackson2019-09-095-15/+4
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove unused gl_config::indexBitsAdam Jackson2019-09-093-4/+1
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Add GL_MESA_EGL_sync supportHeinrich Fink2019-09-081-0/+1
| | | | | | | | This commit follow OES_EGL_sync to universially enable use of EGL sync objects with desktop OpenGL contexts. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: Plumb through a way to disable GLSL const loweringConnor Abbott2019-09-052-0/+7
| | | | | | | | | | For radeonsi, we will prefer the NIR pass as it'll generate better code (some index calculation and a single load vs. a load, then index calculation, then another load) and oftentimes NIR optimization can kick in and make all the access indices constant. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* headers: remove redundant GL token from GL wrapperHeinrich Fink2019-09-051-4/+0
| | | | | | | | Removing GL_FRAMEBUFFER_FLIP_Y_MESA token from glheader.h as it is now provided by glext.h Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* teximage: ensure that Tex*SubImage* checks formatIlia Mirkin2019-09-041-0/+9
| | | | | | | | | We were previously not doing at least some of the checks. This uses the same logic that is used in glTexImage*. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/main: remove unused includeErik Faye-Lund2019-09-021-1/+0
| | | | | | | | This has been unused since 183db3a6455 ("glsl: move half<->float convertion to util"), Oct 10 2015. Let's drop needlessly including it. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Fix _mesa_float_to_unorm() on 32-bit systems.Kenneth Graunke2019-08-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following CTS test on 32-bit systems: GTF-GL46.gtf30.GL3Tests.packed_depth_stencil.packed_depth_stencil_init It does glGetTexImage of a 16-bit SNORM image, requesting 32-bit UNORM data. In get_tex_rgba_uncompressed, we round trip through float to handle image transfer ops for clamping. _mesa_format_convert does: _mesa_float_to_unorm(0.571428597f, 32) which translated to: _mesa_lroundevenf(0.571428597f * 0xffffffffu) which produced different results on 64-bit and 32-bit systems: 64-bit: result = 0x92492500 32-bit: result = 0x80000000 This is because the size of "long" varies between the two systems, and 0x92492500 is too large to fit in a signed 32-bit integer. To fix this, we switch to the new _mesa_i64roundevenf function which always does the 64-bit operation. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104395 Fixes: 594fc0f8595 ("mesa: Replace F_TO_I() with _mesa_lroundevenf().") Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: recover target_check before get_current_tex_objectsJose Maria Casanova Crespo2019-08-211-7/+7
| | | | | | | | | | | | | | | | | At compressed_tex_sub_image we only can obtain the tex_object after compressed_subtexture_target_check is validated for TEX_MODE_CURRENT. So if the target is wrong the error is raised to the user. This completes the fix for the regression introduced on "mesa: refactor compressed_tex_sub_image function" of the pending failing tests: dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d dEQP-GLES31.functional.debug.negative_coverage.get_error.texture.compressedtexsubimage3d v2: Fix warning that texObj might be used uninitialized (Gert Wollny) Fixes: 7df233d68dc ("mesa: refactor compressed_tex_sub_image function") Reviewed-By: Gert Wollny <[email protected]>
* dri: Add config attributes for color channel shiftKevin Strasser2019-08-212-3/+7
| | | | | | | | | | | | | | | The existing mask attributes can only support up to 32 bpp. Introduce per-channel SHIFT attributes that indicate how many bits, from lsb towards msb, the bit field is offset. A shift of -1 will indicate that there is no bit field set for the channel. As old loaders will still be looking for masks, we set the masks to 0 for any formats wider than 32 bpp. Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa/version: uncomment SPIR-V extensionsAlejandro Piñeiro2019-08-211-2/+2
| | | | | | As they are implemented on i965, so we can expose 4.6. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/compiler: rework tear down of builtin/typesLionel Landwerlin2019-08-213-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | The issue we're running into when running CTS is that glsl types are deleted while builtins depending on them are not. This happens because on one hand we have glsl types ref counted, but builtins are not. Instead builtins are destroyed when unloading libGL or explicitly calling glReleaseShaderCompiler(). This change removes almost entirely any dealing with glsl types ref/unref by letting the builtins deal with it instead. In turn we introduce a builtin ref count mechanism. Each GL context takes a reference on the builtins when compiling a shader for the first time. It releases the reference when the context is destroyed. It can also explicitly release those when glReleaseShaderCompiler() is called. Finally we also take a reference on the glsl types when loading libGL to avoid recreating glsl types too often. v2: Ensure we take a reference if we don't have one in link step (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110796 Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: reverse no_error on compressed_tex_sub_image for TEX_MODE_CURRENTJose Maria Casanova Crespo2019-08-201-2/+2
| | | | | | | | | This fixes the regression introduced on "mesa: refactor compressed_tex_sub_image function" that started to crash KHR-GLES2.texture_3d.compressed_texture.negative_compressed_tex_sub_image Fixes: 7df233d68dc ("mesa: refactor compressed_tex_sub_image function") Reviewed-by: Eric Anholt <[email protected]>
* mesa: add ext_dsa GetMultiTexLevelParameterEXTPierre-Eric Pelloux-Prayer2019-08-193-2/+57
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glCompressedMultiTex* functions display list supportPierre-Eric Pelloux-Prayer2019-08-191-0/+276
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glCompressedMultiTex* functionsPierre-Eric Pelloux-Prayer2019-08-195-12/+196
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glCompressedTex* functions display list supportPierre-Eric Pelloux-Prayer2019-08-191-0/+239
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add EXT_dsa glCompressedTexture(Sub)Image1D/2D/3D functionsPierre-Eric Pelloux-Prayer2019-08-195-6/+152
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: refactor compressed_tex_sub_image functionPierre-Eric Pelloux-Prayer2019-08-191-101/+115
| | | | | | | | | | Combine compressed_tex_sub_image, compressed_tex_sub_image_error and compressed_tex_sub_image_no_error in a single function. The added "enum tex_mode mode" parameter allows to implement the DSA / non-DSA variants and their error/no_error combination. Reviewed-by: Marek Olšák <[email protected]>
* win32: unify strcasecmp definitionsErik Faye-Lund2019-08-151-3/+0
| | | | | | | | | There was two incompatible definitions of strcasecmp, which lead to a compiler warning. Let's clean this up by only leaving one of them, and using that one all the time. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/main: avoid warning when casting offset to pointerErik Faye-Lund2019-08-151-1/+1
| | | | | | | | This generates a warning on some 64-bit systems, so let's cast to a properly sized integer first. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/spirv: Lower shared memory laterCaio Marcelo de Oliveira Filho2019-08-101-1/+0
| | | | | | | | | | | Instead of asking spirv_to_nir to lower the workgroup (shared memory) to offsets, keep them as derefs longer, then lower it later on. Because Workgroup memory doesn't have explicit offsets, we need to set those using nir_lower_vars_to_explicit_types before calling the I/O lowering pass. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: be consistent on GL_TRUE/GL_FALSE & TRUE/FALSELionel Landwerlin2019-08-092-3/+3
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* mesa: drop some p_compiler.h typesLionel Landwerlin2019-08-091-2/+2
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* mesa/main: cast away constnessErik Faye-Lund2019-08-081-1/+1
| | | | | | | | This avoids a warning about implicitly casting away the constness of the pointer. Signed-off-by: Erik Faye-Lund <[email protected]> Acked-by: Eric Engestrom <[email protected]>