summaryrefslogtreecommitdiff
path: root/src/mesa
AgeCommit message (Collapse)AuthorFilesLines
48 hoursutil: Move the 4x4 matrix inverse function to u_mathJason Ekstrand1-116/+1
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11078>
4 daysvbo: delay vbo_exec_vtx_map callPierre-Eric Pelloux-Prayer1-6/+7
Instead of doing vbo_exec_vtx_map during initialization, defer it until the first actual user. v2: move init to vbo_exec_wrap_upgrade_vertex (Emma Anholt) Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
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šák3-27/+22
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šák19-34/+43
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 daysst/mesa: move the st_flush_bitmap_cache call into st_flushMarek Olšák1-3/+1
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 daysst/mesa: fix an incorrect comment in st_context_flushMarek Olšák1-2/+2
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šák2-0/+9
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>
5 daysst/mesa: always report the max samples as supportedIlia Mirkin1-1/+9
This is required by GL. Doing this even when the backend driver does not support it leads to creating attachments which are not renderable. This is not ideal, but does pass tests. This covers scenarios such as missing MSAA for 128-bit formats on Sandybridge, and missing 8x MSAA on 128-bit formats on NVIDIA Tesla generation boards. Signed-off-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/11372>
7 daysst/mesa: also disable other int texturesDave Airlie1-0/+1
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11146>
9 daysi965: Use nir_lower_passthrough_edgeflagsJason Ekstrand1-4/+3
Now that there's a common NIR pass, there's no point in us doing this in the back-end anymore. In order to use this pass in i965, we do have to make one tiny change. Gallium runs the pass after assigning input and output locations and so needs the pass to respect those locations and num_inputs. i965, however, runs it before any location assignment or I/O lowering so we don't care. We do, however, need the pass to succeed with num_inputs == 0 because we set that later. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11313>
9 daysintel/isl: Make the offset helpers four dimensionalJason Ekstrand2-4/+13
We need to do this in order to handle Yf and Ys tiling because they use a four-dimensional tile instead of laying everything out in two dimensions. v2 (Jason Ekstrand): - Update functions added since v1: - isl_surf_get_image_range_B_tile - blorp_can_hiz_clear_depth - get_image_offset_el Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> (v1) Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11330>
10 daysswrast: Fix a warning from gcc 11Adam Jackson1-1/+1
gcc 11 dixit: In function ‘sample_2d_ewa’, inlined from ‘sample_lambda_2d_aniso’ at ../src/mesa/swrast/s_texfilter.c:1995:10: ../src/mesa/swrast/s_texfilter.c:1729:13: warning: ‘sample_2d_nearest’ reading 16 bytes from a region of size 8 [-Wstringop-overread] 1729 | sample_2d_nearest(ctx, samp, img, newCoord, rgba); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/mesa/swrast/s_texfilter.c: In function ‘sample_lambda_2d_aniso’: ../src/mesa/swrast/s_texfilter.c:1729:13: note: referencing argument 4 of type ‘const GLfloat *’ {aka ‘const float *’} Indeed, newCoord is GLfloat[2] but the argument is typed GLfloat[4], even though only the first two (s and t) are ever read. Fix the array size in the function signature to reflect the maximum element actually addressed. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11273>
11 daysRevert "st/mesa: execute glFlush asynchronously if no image has been ↵Rob Clark3-10/+1
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 daysclassic/xlib: Fix the build after !9817Adam Jackson2-33/+5
This commit mostly exists to be backported to 21.1.x, because the classic binding to xlib is soon to be retired. Fixes: 4daef7ffe37 mesa: Remove redundant gl_config::sampleBuffers Closes: mesa/mesa#4900 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11270>
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 Filho3-5/+5
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 daysintel/isl: convert null surface fill to a struct.Dave Airlie1-1/+1
Suggested by Jason, pre-convert this to a struct so it can be expanded for gen4/5 crocus support Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10655>
13 dayscompiler: Rename local_size to workgroup_sizeCaio Marcelo de Oliveira Filho3-5/+5
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>
13 daysst/pbo: use correct type for images and texturesErik Faye-Lund2-9/+33
Not all hardware can treat float, uint and sint samplers and images the same way, so we need to respect the format-types here. This has the added benefit of making sure sint and uint data doesn't get copied through a float, which might mess with signaling nan encodings. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11164>
2021-06-06st/mesa: allow hardware to claim ES 3.1 without hw indirect drawsIlia Mirkin1-0/+9
Such a driver will be expected to handle indirect draws via emulation. As such we don't want to expose the ext in desktop GL contexts. However for ES 3.1 it's a required feature, so makes sense to allow fallbacks. 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/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-06st/mesa: properly encode OES_geometry_shader requirementIlia Mirkin1-5/+3
Since the extension was added, we grew a cap to expose the number of invocations. Use it to prevent geometry shaders from being spuriously exposed. 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-06st/mesa: avoid enabling image/buffer/compute extensions for weak hardwareIlia Mirkin1-5/+7
The requirements for ES 3.1 are lower than the requirements for desktop GL. The thread block size can be smaller, and images/buffers/atomics need not be supported in the fragment stage. Allow a driver to expose ES 3.1 without flipping on the desktop GL extensions. 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-05i915: Implement __DRI2_FLUSH version 4Ville Syrjälä1-5/+19
DRI3 needs version 4 of __DRI2_FLUSH. Straight up port of i965 commit 313f2bc32b86 ("intel: Add support for the new flush_with_flags extension."). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9734>
2021-06-05i915: Implement __DRI_IMAGE_ATTRIB_OFFSET queryVille Syrjälä1-1/+4
DRI3 needs __DRI_IMAGE_ATTRIB_OFFSET so implement it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9734>
2021-06-04intel: properly constify isl_format_layoutsAdam Jackson1-1/+1
Putting a const char * in the struct means it's a pointer that has to be resolved at rtld time, which means it can be in .data.rel.ro but not .rodata like you'd hope. Fix this with the usual string table trick. Cuts about 20k (-80k read-write +60k read-only) and ~280 relocations from the gallium driver. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11168>
2021-06-04st/mesa: execute glFlush asynchronously if no image has been imported/exportedMarek Olšák3-1/+10
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-06-03intel/nir,i965: Move HW generation check for UBO pushing to i965Jason Ekstrand7-10/+28
Iris only runs on BDW+ and ANV already handles this by not even trying on anything older than HSW. The only driver benefiting from this common check is i965. Moving it out makes the pass more generic and if some driver comes along which can push UBOs on IVB, it should work for that. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11145>
2021-06-03intel/gfx6: move xfb_setup outside the gs compiler into the driver.Dave Airlie1-1/+37
This remove the use of a GL thing from the backend compiler Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11097>
2021-06-03st/nir: always revectorise if scalarising happens.Dave Airlie1-6/+7
This fixes arb_gpu_shader_fp64-vs-non-uniform-control-flow-ssbo on crocus. Reviewed-by: Connor Abbott <cwabbott0@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11098>
2021-06-02android: i965: remove brw_ff_gs_emit.c from Makefile.sourcesMauro Rossi1-1/+0
Fixes the following building error: clang: error: no such file or directory: 'external/mesa/src/mesa/drivers/dri/i965/brw_ff_gs_emit.c' clang: error: no input files Fixes: 897bcc1e6b42 ("i965: drop old brw ff gs code.") Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10718>
2021-06-02sparc: Avoid some redefinition warningsMatt Turner2-10/+0
These definitions are provided by m_vector_asm.h now. Fixes: 67ffb853f05 ("sparc: Reuse m_vector_asm.h.") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11119>
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-27mesa/st: Don't assert !unify_interfaces in the passthrough edge flags caseIan Romanick1-1/+0
Technically, this is correct, and I think it's the right long-term solution. However, Iris has code that undoes the damage caused by nir_lower_passthrough_edgeflags (see iris_fix_edge_flags in iris_program.c), so it should be safe to do the lowering here. I'm not marking this as closing mesa#4838 because I think we should move the Iris code up to here, make a different version of the NIR pass, or something different... to properly fix this problem. In the mean time, this gets a bunch of tests to stop crashing. :) Fixes: a76ec17f12c ("mesa/st: Fix iris regression with clip distances.") Acked-by: Emma Anholt <emma@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11013>
2021-05-27st/mesa: fix clearing of 1D array texturesPierre-Eric Pelloux-Prayer1-0/+8
st_gl_texture_dims_to_pipe_dims isn't usable in this case since its API doesn't match the usage so fix up the dimensions manually. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3646 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/10523>
2021-05-26gallium/st: add a back buffer fallback for front renderingYiwei Zhang1-3/+10
Unlike front buffer used by big GL API for front rendering, EGL_KHR_mutable_render_buffer together with ES redirects GL_BACK to the front buffer. This patch adds a fallback to use back buffer and ensures no behavior change for unrelated frontends. Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10685>
2021-05-24mesa/st: Fix iris regression with clip distances.Emma Anholt1-3/+16
In general gallium shaders are all SSO and it's up to the driver to handle lining up varying storage between stages at draw time. However, there's a NIR option "unify_interfaces" that iris uses which applies to non-SSO (as indicated by nir->info.separate_shader) shaders and makes the inputs_read and outputs_written match up at GLSL-to-NIR link time, and then iris then avoids any lowering passes that would add new varyings. By introducing info gathering after variant creation (because all I knew was "gallium is always SSO"), I broke the unify_interfaces link-time setup on iris. Just skip that when the unify_interfaces flag is set, and add some asserts to catch anyone trying to mix unify_interfaces with known varying-adjusting lowering passes. Closes: #4450 Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10876>
2021-05-21gallium: split transfer_(un)map into buffer_(un)map and texture_(un)mapMarek Olšák9-37/+40
The u_resource_vtbl indirection is going to be removed. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10659>
2021-05-21gallium/dri: Allow use of R8G8_R8B8 for YUYV and G8R8_B8R8 for UYVYIan Romanick6-13/+58
v2: Add missing FALLTHROUGH. Caught by CI. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9610>