summaryrefslogtreecommitdiff
path: root/src/mesa/main
AgeCommit message (Collapse)AuthorFilesLines
4 daysmesa: execute glFlush asynchronously if no image has been imported/exportedMarek Olšák1-1/+3
This improves viewperf performance and it shouldn't break synchronization with external clients when it's indirectly implied by glFlush. This should not break the cases described in: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4903 Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
4 daysmesa: move _mesa_notifySwapBuffers into the x11 swrast driverMarek Olšák2-25/+0
It has no other use and no relevance to DRI drivers despite the name. Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
4 daysmesa: add gallium flush_flags param into ctx->Driver.FlushMarek Olšák3-5/+7
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
4 daysglthread: change when glFlush flushes asynchronouslyMarek Olšák1-0/+8
This fixes the flushing with external textures. We don't know if we need to flush synchronously with multiple contexts, so I removed that. Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
4 daysshader_enums: change VERT_BIT back to the 32-bit shiftMarek Olšák1-1/+1
This reverts 0e2566a8. The warning is fixed differently. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10993>
4 daysutil/queue: add a global data pointer for the queue objectMike Blumenkrantz1-5/+5
this better enables object-specific (e.g., context) queues where the owner of the queue will always be needed and various pointers will be passed in for tasks Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11312>
11 daysRevert "st/mesa: execute glFlush asynchronously if no image has been ↵Rob Clark1-8/+0
imported/exported" A number of the piglit glx tests use multiple contexts on a single thread, and previously the flush in MakeCurrent() was enforcing the ordering between draws on those different contexts. When that flush made ASYNC, now there is nothing ordering the draws because we have two (or more) driver threads for a single frontend thread which is using nothing more than glxMakeCurrent() to enforce the ordering. This reverts commit 057a702a3f6a78a8bcd347a74e5a79d70dfc4153. Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4903 Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11278>
11 daysmesa: also flush after compute dispatch when debug flag enabledIlia Mirkin1-0/+9
This makes MESA_DEBUG=flush also flush after compute dispatches. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Acked-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11205>
11 daysmesa: always expose NV_image_formats and OES_shader_image_atomicIlia Mirkin1-2/+2
As a result of some previous changes, it is now possible to expose ES 3.1 without having the ARB_shader_image_load_store enable set. However we still want those other extensions. When there's a driver that's capable of exposing ES 3.1 but not these extensions, more caps can be added. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11204>
12 daysnir: Move workgroup_size and workgroup_variable_size into common shader_infoCaio Marcelo de Oliveira Filho2-4/+4
Move it out the "cs" sub-struct, since these will be used for other shader stages in the future. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11225>
13 dayscompiler: Rename local_size to workgroup_sizeCaio Marcelo de Oliveira Filho2-4/+4
Acked-by: Emma Anholt <emma@anholt.net> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11190>
2021-06-06mesa/get: allow image/buffer/atomic variables to be fetched in es3.1Ilia Mirkin4-29/+40
Right now these rely on the desktop extension enables being set. However some drivers may not be able to support that full functionality. Allow presence of ES 3.1 to be sufficient. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10569>
2021-06-06mesa: relax ES 3.1 compute shader requirementsIlia Mirkin1-5/+12
The desktop extensions require more than what's needed for ES 3.1. Reduce this to allow implementations to expose ES 3.1 without supporting desktop functionality. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10569>
2021-06-04st/mesa: execute glFlush asynchronously if no image has been imported/exportedMarek Olšák1-0/+8
This improves viewperf performance and it shouldn't break synchronization with external clients when it's indirectly implied by glFlush. Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10937>
2021-05-28mesa: don't save/restore VAO NumUpdates and IsDynamic to fix update trackingMarek Olšák1-2/+1
NumUpdates is used to indicate whether a VAO is static or dynamic, but if we restored an older value, it could incorrectly indicate that it's not dynamic. This fixes a small performance issue with torcs. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
2021-05-28mesa: don't call FLUSH_VERTICES in glPopClientAttribMarek Olšák1-1/+0
These states don't affect draws, so any enqueued Begin/End vertices don't need flushing. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
2021-05-28mesa: optimize unreferencing VBOs in glPopClientAttribMarek Olšák1-1/+11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
2021-05-28mesa: optimize glPush/PopClientAttrib for GL_CLIENT_VERTEX_ARRAY_BITMarek Olšák3-9/+29
This improves performance in torcs by 6%. The idea is to skip saving and restoring vertex attribs and bindings that have never been changed. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
2021-05-28mesa: don't call _mesa_set_draw_vao in glPushClientAttribMarek Olšák1-3/+3
Pushing states doesn't affect draws. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
2021-05-28mesa: move _mesa_copy_vertex_attrib/buffer functions to their only useMarek Olšák3-43/+31
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>
2021-05-28mesa: fix error set for glCompressedTexSubImage callsTapani Pälli1-1/+18
Desktop and ES expect a different error code here when dealing with generic compressed format tokens. This fixes failures with upcoming new tests for compressed texture related API calls. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11009>
2021-05-21mesa: Add R8G8_R8B8 and G8R8_B8R8 formatsIan Romanick5-2/+12
These aren't real formats. They cannot be used with RenderbufferObjects, Textures, or anything else visible through the GL API. The only purpose is to support YUYV textures imported through EGL_image_external. There is hardware that can sample from this subsampled format, but the hardware does not do the colorspace conversion automatically. v2: Treat these formats as compressed. This is a lie, but it seems to be a less egregious lie than what I was doing before. It also passes 'ninja test'. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>
2021-05-07mesa: add an extension MESA_bgraGert Wollny2-1/+12
This GLES extension allows to combine the formats BGR and BGRA as host-side formatsto be combined with the internal formats RGB8/SRGB8 and RGBA8/SRGB8_ALPHA8 respectively. This extension is of interest to support a subset of OpenGL in virtualized environments where the host only supports GLES. Initial mesa/glformat.c patch: rohan.garg@collabora.com v2: - Correct names for ClearTexture calls - Add BGR(A)_EXT tokens - Add format check for BGR_EXT (All Adam Jackson) v3: Fix ordering in extension table (Marge) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com> (v2) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10613>
2021-05-06mesa: s/malloc/calloc/ to silence a warningAdam Jackson1-1/+1
gcc 11 warns: [846/1506] Compiling C object src/mesa/libmesa_common.a.p/main_shaderapi.c.o In function ‘shader_source’, inlined from ‘_mesa_ShaderSource_no_error’ at ../src/mesa/main/shaderapi.c:2137:4: ../src/mesa/main/shaderapi.c:2095:25: warning: ‘*offsets_10 + _130’ may be used uninitialized [-Wmaybe-uninitialized] 2095 | totalLength = offsets[count - 1] + 2; I can't really see how it's getting to that conclusion, but allocating `offsets` with calloc is both natural to do here and guarantees initialization. Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10671>
2021-05-05mesa: Ignore the depth buffer when computing framebuffer floatnessAdam Jackson1-0/+2
Not that Z32F is especially common, but we shouldn't consider it to imply that the color buffers are also float, which is what floatMode is meant to mean. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10491>
2021-05-05mesa: Remove unused _mesa_{create,destroy}_visualAdam Jackson2-72/+7
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10491>
2021-05-04util: fix (re-enable) L3 cache pinningMarek Olšák1-1/+1
cores_per_L3 was uninitialized, so it was always disabled. Remove the variable and do it differently. Fixes: 11d2db17c52 - util: rework AMD cpu L3 cache affinity code. Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10526>
2021-04-30gallium: remove padding members from pipe_draw_infoMike Blumenkrantz1-8/+0
these are no longer used, and the tc usage can be moved to the tc struct Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30gallium: split drawid out of pipe_draw_info and as a separate draw_vbo paramMike Blumenkrantz3-13/+18
the only case in which this is nonzero is if a multidraw gets split by the frontend, i.e., mesa core, and in all other cases it can be ignored. the value can also be ignored for all indirect draws, though it seems many (most?) gallium drivers are not aware of this Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30mesa/st: rename DrawGalliumComplex -> DrawGalliumMultiModeMike Blumenkrantz3-3/+3
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30gallium: move pipe_draw_info::index_bias to pipe_draw_start_count_biasMike Blumenkrantz3-76/+23
this moves index_bias into the multidraw struct, enabling draws where the value changes to be merged; the draw_info struct member is renamed and moved to the end of the struct for tc use u_vbuf still has some checks to split draws if index_bias changes, maybe this can be removed at some point? Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30gallium: rename pipe_draw_start_count -> pipe_draw_start_count_biasMike Blumenkrantz3-12/+12
and add an index_bias member no functional changes yet, just the rename and unused struct member Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10166>
2021-04-30mesa: fix glShaderSource() error handlingTimothy Arceri1-1/+5
Section 7.1 (SHADER OBJECTS) of the OpenGL 4.6 spec says: "An INVALID_VALUE error is generated if count is negative." However a count of 0 is not an error. Previously it would cause a GL_OUT_OF_MEMORY error. Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10477>
2021-04-29util/hash_table: do not leak u64 struct keyJuan A. Suarez Romero3-6/+6
For non 64bit devices the key stored in hash_table_u64 is wrapped in hash_key_u64 structure, which is never free. This commit fixes this issue by just removing the user-defined `delete_function` parameter in hash_table_u64_{destroy,clear} (which nobody is using) and using instead a delete function to free this structure. Fixes: 608257cf82f ("i965: Fix INTEL_DEBUG=bat") Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10480>
2021-04-26mesa: fix incomplete GL_NV_half_float implementationTimothy Arceri3-0/+36
All of the VertexAttrib* functions were missing. Fixes: ef66e02a408c ("src/mesa: add GL_NV_half_float extension support (v2)") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10431>
2021-04-22gallium/u_threaded: offload begin/end_intel_perf_queryMarcin Ślusarz2-3/+10
Fixes: 206495cac4e ("iris: Enable u_threaded_context") Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9922>
2021-04-21mesa: Replace _mesa_pack_ubyte_rgba_row() with pack_ubyte_rgba_8unorm().Eric Anholt4-202/+9
The major thing that the codegen had was support for expanding integers from byte-per-channel to the target format's channel size. However, the format_utils.c caller never did that for integers, and swrast doesn't have support for integers, so that appears to be dead code. With this done, format_pack.py goes away entirely. I slightly changed the prototype of _mesa_pack_ubyte_rgba_row() to match up with the new function, which involved (mostly) dropping some manual casts from the callers to make their data match the old prototype. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21mesa: Remove dead _mesa_pack_ubyte_rgba_rect().Eric Anholt2-36/+0
Unused since 8ec6534b2665 ("mesa: Use _mesa_format_convert to implement texstore_rgba.") in 2014 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21mesa: Move per-pixel Z pack functions to swrast.Eric Anholt2-157/+0
Only swrast uses them, and this makes it clearer why we only need partial format support for them, avoids linker work deleting them for gallium drivers, and means they will automatically go away when we get to finally delete swrast. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21msea: Move z24s8-to-z24s8 packing fastpath to swrast.Eric Anholt2-43/+0
It was only used here, and this made it clear (see draw_depth_stencil_pixels()) that the z32f_s8 case was unused and could be dropped. Also, it means this code will nicely go away when swrast is deleted. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> X Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21mesa: Remove dead _mesa_get_pack_float_z_func().Eric Anholt2-91/+2
Unused since its introduction 10 years ago. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21mesa: Deduplicate _mesa_pack_uint_z_row().Eric Anholt2-78/+5
util_format_pack_z_32unorm() does the same thing but supports more formats. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21mesa: Deduplicate _mesa_pack_float_z_row().Eric Anholt2-76/+5
util_format_pack_z_float() does the same thing but supports more formats. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-21mesa: Deduplicate _mesa_pack_ubyte_stencil_row()Eric Anholt2-49/+5
util_format_pack_s_8uint() has the same behavior of replacing the s values but supports more formats. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10336>
2021-04-19util: Switch the non-block formats to unpacking rgba rows instead of rects.Eric Anholt1-1/+1
We have only a few callers of unpack that do rects, so add a helper that iterates over y adding the strides. This saves us 36kb of generated code and means that adding cpu-specific variants for RGBA format unpack will be much simpler. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
2021-04-19mesa: Remove dead _mesa_unpack_rgba_block().Eric Anholt2-40/+0
Despite many changes over its lifetime, it appears to have been dead ever since its introduction in 2011. Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10014>
2021-04-16mesa: texparam: Add a clamping macro to handle out-of-range floats returned ↵Alexander Shi1-4/+8
as integers. The parameters GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_MAX_ANISOTROPY_EXT, GL_TEXTURE_LOD_BIAS are stored as floats but returned as integers. Setting their values outside of the integer range results has undefined behaviour when the c-runtime method lroundf converts the value back to an integer. Fixes: 53c36dfc('replace IROUND with util functions') Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10244>
2021-04-15Convert most remaining free-form fall-through comments to FALLTHROUGHMichel Dänzer7-14/+14
One exception is src/amd/addrlib/, for which -Wimplicit-fallthrough is explicitly disabled. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Juan A. Suarez <jasuarez@igalia.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10220>
2021-04-15mesa/st: plumb GL_TEXTURE_REDUCTION_MODE_ARB through QueryInternalFormatMike Blumenkrantz1-5/+7
enable per-format querying of texture_filter_minmax support if the ARB extension is enabled also now return 0 if neither extension is supported Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10030>
2021-04-15gallium: split PIPE_CAP_SAMPLER_REDUCTION_MINMAX into modesMike Blumenkrantz4-9/+18
this enables detection for the EXT vs the ARB extension, which have different specifications regarding which formats must be supported Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10030>