summaryrefslogtreecommitdiff
path: root/src/gallium/include/state_tracker
AgeCommit message (Collapse)AuthorFilesLines
2020-05-13gallium: rename 'state tracker' to 'frontend'Marek Olšák12-1254/+0
Acked-by: Eric Anholt <eric@anholt.net> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
2020-05-05driconf: add force_integer_tex_nearest optionPierre-Eric Pelloux-Prayer1-0/+1
And enable it for "GRID Autosport" and "DIRT: Showdown" games. CC: 20.1 <mesa-stable@lists.freedesktop.org> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1258 Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4647>
2020-03-26mesa: allow out-of-order drawing to optimize immediate mode if it's safeMarek Olšák1-0/+1
This increases performance by 11-13% in Viewperf11/Catia - first scene. Set allow_draw_out_of_order=true to enable this. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4152>
2020-01-20Revert "gallium: add st_context_iface::flush_resource to call FLUSH_VERTICES"Daniel Stone1-7/+0
This reverts commit bec9c90b5ecf9cc2dc580f9ff297f94ba5aa3506. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3472> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3472>
2020-01-17gallium: add st_context_iface::flush_resource to call FLUSH_VERTICESMarek Olšák1-0/+7
2020-01-15st/dri: track if image is created by a dmabufGurchetan Singh1-0/+2
Will be used by EXT_EGL_image_storage later. Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3375>
2019-12-10st/mesa: add a notify_before_flush callback param to flushPierre-Eric Pelloux-Prayer1-1/+3
The new callback is called right before the flush is done to allow users of st->flush to do some work after all the previous work has been flushed. This will be used by dri_flush in the next commit. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2019-12-06gallium: Store the image format in winsys_handleNanley Chery1-0/+6
This format will be used to properly handle planar images with modifiers in iris. Fixes: 246eebba4a8 ("iris: Export and import surfaces with modifiers that have aux data") Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-11-27driconf, glsl: Add a vs_position_always_invariant optionKenneth Graunke1-0/+1
Many applications use multi-pass rendering and require their vertex shader position to be computed the same way each time. Optimizations may consider, say, fusing a multiply-add based on global usage of an expression in a shader. But a second shader with the same expression may have different code, causing that optimization to make the other choice the second time around. The correct solution is for applications to mark their VS outputs 'invariant', indicating they need multiple shaders to compute that output in the same manner. However, most applications fail to do so. So, we add a new driconf option - vs_position_always_invariant - which forces the gl_Position output in vertex shaders to be marked invariant. Fixes: 7025dbe794b ("nir: Skip emitting no-op movs from the builder.") Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2019-11-11st/mesa: fix Sanctuary and Tropics by disabling ARB_gpu_shader5 for themMarek Olšák1-0/+1
They use the "sample" keyword as a variable name. Cc: 19.2 19.3 <mesa-stable@lists.freedesktop.org> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-08-13state_tracker/winsys_handle: Add plane input fieldJordan Justen1-0/+5
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Eric Anholt <eric@anholt.net>
2019-08-07mesa/gallium: add dric option to allow overriding GL vendor stringTimothy Arceri1-0/+1
Will be used in the following patch. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93551
2019-07-22gallium: remove boolean from state tracker APIsIlia Mirkin3-44/+42
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2019-04-23gallium: replace drm_driver_descriptor::configuration with driconf_xmlMarek Olšák1-37/+8
PIPE_CAPs are better. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-23gallium: replace DRM_CONF_SHARE_FD with PIPE_CAP_DMABUFMarek Olšák1-6/+0
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-04-23gallium: replace DRM_CONF_THROTTLE with PIPE_CAP_MAX_FRAMES_IN_FLIGHTMarek Olšák1-4/+0
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-01-25gallium: use put image shm2 path (v2)Dave Airlie1-1/+1
This fixes the drisw paths to use the new shm2 interface, so that we don't trigger the X server overflow checks when the x offset is non-zero. This just hides the versioning in drisw, and either passes the src_x or adds the offset fixup for the fallback path. Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-09-10gallium: Correctly handle no config context creationElie Tournier1-0/+2
This patch fixes the following Piglit test: spec@egl_mesa_configless_context@basic It also fixes few test in a virgl guest. v2: Evaluate the value of no_config (Ilia) Suggested-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Elie Tournier <elie.tournier@collabora.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2018-08-30st/mesa, gallium: add a workaround for No Mans SkyTimothy Arceri1-0/+1
The spec seems clear this is not allowed but the Nvidia binary forces apps to add layout qualifiers so this works around the issue for No Mans Sky until the CTS can be sorted out. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-08-21mesa: remove unused dri config option disable_shader_bit_encodingTimothy Arceri1-1/+0
This was added as a workaround for Heaven 3.0 but was later removed by 5ead448719f3 to allow Heaven 4.0 to work correctly. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2018-06-19mesa/util: add allow_glsl_relaxed_es driconfig overrideTimothy Arceri1-0/+1
This relaxes a number of ES shader restrictions allowing shaders to follow more desktop GLSL like rules. This initial implementation relaxes the following: - allows linking ES shaders with desktop shaders - allows mismatching precision qualifiers - always enables standard derivative builtins These relaxations allow Google Earth VR shaders to compile. Reviewed-by: Dave Airlie <airlied@redhat.com>
2018-06-19mesa/util: add allow_glsl_builtin_const_expression driconf overrideTimothy Arceri1-0/+1
Google Earth VR shaders uses builtins in constant expressions with GLSL 1.10. That feature wasn't allowed until GLSL 1.20. Reviewed-by: Dave Airlie <airlied@redhat.com>
2018-05-30drisw: learn to query shmid handle typeMarc-André Lureau3-2/+3
Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-05-30drisw: use putImageShm if availableMarc-André Lureau1-0/+3
If the DRIswrastLoaderExtension implements putImageShm, bind it to drisw_loader_funcs. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-05-30gallium/winsys: rename DRM_API_HANDLE_* to WINSYS_HANDLE_*Dave Airlie1-3/+3
This just renames this as we want to add an shm handle which isn't really drm related. Originally by: Marc-André Lureau <marcandre.lureau@gmail.com> (airlied: I used this sed script instead) This was generated with: git grep -l 'DRM_API_' | xargs sed -i 's/DRM_API_/WINSYS_/g' Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-05-30gallium: move winsys handle to it's own file.Marc-André Lureau2-47/+59
This will be used in the drisw interface later, which isn't drm specific. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-03-26gallium: Correct minor typo in header commentsAlyssa Rosenzweig1-1/+1
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-19gallium: Make (num_)samples an unsigned intGert Wollny1-1/+1
According to the ARB_multisample num_samples is a non-negative integer. Consequently define it as such, fail in glx/choose_visual if a negative number is given. v2: split patch into gallium and mesa part Signed-off-by: Gert Wollny <gw.fossdev@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-19gallium: plumb context priority through to driverRob Clark1-0/+2
Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Andres Rodriguez <andresx7@gmail.com> Reviewed-by: Wladimir J. van der Laan <laanwj@gmail.com>
2017-11-30mesa: add AllowGLSLCrossStageInterpolationMismatch workaroundTapani Pälli1-0/+1
This fixes issues seen with certain versions of Unreal Engine 4 editor and games built with that using GLSL 4.30. v2: add driinfo_gallium change (Emil Velikov) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97852 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103801 Acked-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-11-11st/dri: fix deadlock when waiting on android fencesMarek Olšák1-2/+1
Android fences can't be deferred, because st/dri calls fence_finish with ctx = NULL, so the driver can't flush u_threaded_context. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-10st/dri: fix android fence regressionMarek Olšák1-0/+2
Fixes piglit - egl_khr_fence_sync/android_native tests. Broken by 884a0b2a9e55d4c1ca39475b50d9af598d7d7280. Introduce state-tracker flush flags, analogous to the pipe ones. Use the former when with stapi->flush(). Fixes: 884a0b2a9e5 ("st/dri: use stapi flush instead of pipe flush when creating fences") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-06gallium: Wire up flush controlAdam Jackson1-0/+1
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-10-10st_api: remove unused get_resource_for_egl_imageNicolai Hähnle1-37/+0
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-02mesa: Remove force_s3tc_enable driconf variableMatt Turner1-1/+0
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-03gallium/st: Add a method to flush outstanding swapbuffersThomas Hellstrom1-0/+2
Add a state tracker interface method to flush outstanding swapbuffers, and add a call to it from the mesa state tracker during glFinish(). This doesn't strictly mean the outstanding swapbuffers have actually finished executing but is sufficient for glFinish() to be able to be used as a replacement for glXWaitGL(). Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2017-08-02gallium: add pipe_screen_config to screen_create functionsNicolai Hähnle1-1/+3
This allows a more generic mechanism for passing user configurations into drivers by accessing the dri options directly. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-02st/drm: add DRM_CONF_XML_OPTIONSNicolai Hähnle1-0/+2
Allow drivers to return the XML that describes the available config options. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-24st/mesa: create framebuffer iface hash table per st managerCharmaine Lee1-0/+21
With commit 5124bf98239, a framebuffer interface hash table is created in st_gl_api_create(), which is called in dri_init_screen_helper() for each screen. When the hash table is overwritten with multiple calls to st_gl_api_create(), it can cause race condition. This patch fixes the problem by creating a framebuffer interface hash table per state tracker manager. Fixes crash with steam. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101876 Fixes: 5124bf98239 ("st/mesa: add destroy_drawable interface") Tested-by: Christoph Haag <haagch@frickel.club> Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-20st/mesa: add destroy_drawable interfaceCharmaine Lee1-0/+7
With this patch, the st manager will maintain a hash table for the active framebuffer interface objects. A destroy_drawable interface is added to allow the state tracker to notify the st manager to remove the associated framebuffer interface object from the hash table, so the associated framebuffer and its resources can be deleted at framebuffers purge time. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101829 Fixes: 147d7fb772a ("st/mesa: add a winsys buffers list in st_context") Tested-by: Brad King <brad.king@kitware.com> Tested-by: Gert Wollny <gw.fossdev@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2017-07-14st/mesa: Add support for KHR_no_error flagGrigori Goronzy1-0/+1
Add a new context flag and plumb it through the various layers of the context creation code to set up dispatch tables for the no-error mode. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-11st/mesa: add a winsys buffers list in st_contextCharmaine Lee1-0/+5
Commit a5e733c6b52e93de3000647d075f5ca2f55fcb71 fixes the dangling framebuffer object by unreferencing the window system draw/read buffers when context is released. However this can prematurely destroy the resources associated with these window system buffers. The problem is reproducible with Turbine Demo running with VMware driver. In this case, the depth buffer content was lost when the context is rebound to a drawable. To prevent premature destroy of the resources associated with window system buffers, this patch maintains a list of these buffers in the context, making sure the reference counts of these buffers will not reach zero until the associated framebuffer interface objects no longer exist. This also helps to avoid unnecessary destruction and re-construction of the resources associated with the framebuffer. Fixes VMware bug 1909807. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-06-26mesa/glthread: add glthread "perf" counters and pass them to gallium HUDMarek Olšák1-1/+3
for HUD integration in following commits. This valuable profiling data will allow us to see on the HUD how well glthread is able to utilize parallelism. This is better than benchmarking, because you can see exactly what's happening and you don't have to be CPU-bound. u_threaded_context has the same counters. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-06-23gallium: allow passing 'unsigned flags' to create_screen()Marek Olšák1-1/+1
for drirc options Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-06-09gallium/winsys/drm: introduce modifier field to winsys_handleVarad Gautam1-0/+6
we use this to import resources with format modifiers, and to support per-resource modifier queries. Signed-off-by: Varad Gautam <varad.gautam@collabora.com> Cc: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
2017-05-20driconf: Add allow_glsl_builtin_variable_redeclaration optionJohn Brooks1-0/+1
This option will allow GLSL builtins to be redeclared verbatim (e.g. redeclaring "in int gl_VertexID" in a vertex shader). This is not strictly valid and would normally fail to compile, but some applications (such as newer Techland ports) do it and need more leniency. v2 (Samuel Pitoiset): - Rename allow_glsl_builtin_redeclaration -> allow_glsl_builtin_variable_redeclaration Signed-off-by: John Brooks <john@fastquake.com> Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-03-22driconf: add force_glsl_abs_sqrt optionSamuel Pitoiset1-0/+1
This will allow to force computing the absolute value for sqrt() and inversesqrt() in order to follow D3D9 behaviour for buggy apps that rely on it. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-03-16gallium: implement the backend of threaded GL dispatchMarek Olšák1-0/+19
Acked-by: Timothy Arceri <tarceri@itsqueeze.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Mike Lothian <mike@fireburn.co.uk>
2017-02-18st: add ST_FLUSH_WAIT to st_context_flush()Charmaine Lee1-0/+1
When st_context_flush() is called with ST_FLUSH_WAIT, the function will return after the fence is completed. Reviewed-by: Brian Paul <brianp@vmware.com>
2017-02-17st/mesa/glsl: build string of dri options and use as input to building sha ↵Timothy Arceri1-0/+1
for shaders Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>