mesa.git
14 months agoutil: fix possible buffer overflow in util_get_process_exec_path
Marcin Ślusarz [Fri, 24 Jul 2020 16:14:24 +0000 (18:14 +0200)]
util: fix possible buffer overflow in util_get_process_exec_path

Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Fixes: f8f1413070a ("util/u_process: add util_get_process_exec_path")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067>

14 months agoglsl: catch out of bounds access in the debug version
Marcin Ślusarz [Fri, 24 Jul 2020 15:59:36 +0000 (17:59 +0200)]
glsl: catch out of bounds access in the debug version

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067>

14 months agoutil: fix possible fd leaks in os_socket_listen_abstract
Marcin Ślusarz [Fri, 24 Jul 2020 15:51:25 +0000 (17:51 +0200)]
util: fix possible fd leaks in os_socket_listen_abstract

Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Fixes: ef5266ebd50 ("util/os_socket: Add socket related functions.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067>

14 months agovulkan/util: add struct vk_pipeline_cache_header
Alejandro Piñeiro [Fri, 3 Jul 2020 22:54:19 +0000 (00:54 +0200)]
vulkan/util: add struct vk_pipeline_cache_header

Header is defined at vkGetPipelineCacheData spec, in any vulkan
version, and anv, tu and radv were using the same struct, and v3dv was
about to do the same.

Defining the same struct four times seemed odd, so let's define on a
common place.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6058>

14 months agofreedreno/a6xx: fixup draw state earlier
Rob Clark [Wed, 29 Jul 2020 17:14:34 +0000 (10:14 -0700)]
freedreno/a6xx: fixup draw state earlier

`fixup_draw_state()` was updating `ctx->dirty` after it had already been
copied into the emit struct, which had the result that we were not re-
emitting the rast state when primitive_restart changes.

Fixes: 4d8f42c8512 ("freedreno/a6xx: separate rast stateobj for prim restart")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3067
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6117>

14 months agofreedreno/a6xx: don't emit a bogus size for empty cb slots
Rob Clark [Wed, 29 Jul 2020 16:09:19 +0000 (09:09 -0700)]
freedreno/a6xx: don't emit a bogus size for empty cb slots

Noticed that asphalt9 had no uniforms bound, so cb[0] is null.  In
theory shouldn't cause a problem, since nothing is doing `ldc` against
cb[0], but to be safe we should use SIZE=0.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6117>

14 months agofreedreno/ir3: add missing track_ubo_use()
Rob Clark [Wed, 29 Jul 2020 15:37:29 +0000 (08:37 -0700)]
freedreno/ir3: add missing track_ubo_use()

We could lower *some* accesses to a UBO but not others.  In this case,
we would have a valid range, but would have skipped tracking that the
UBO is accessed as a UBO rather than push constants.

Fixes one issue with asphalt9, that was a result of having `ldc` without
having emit UBO state.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3067
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6117>

14 months agoegl/dri2: only take a dri2_dpy reference when binding a new context/surfaces
Frank Binns [Tue, 28 Jul 2020 14:50:30 +0000 (15:50 +0100)]
egl/dri2: only take a dri2_dpy reference when binding a new context/surfaces

This effectively reverts part of 2907faee, which changed dri2_make_current() to
always take a dri2_dpy reference regardless of whether or not a new context or
surface(s) were being bound. This led to a reference count imbalance as there
was no corresponding code added to drop a reference on the dri2_dpy. As a
consequence, any application that called eglInitialize() on a default/native
display after having called eglTerminate() would always get back the old
dri2_dpy, inheriting its previous state.

As the reference count is there to prevent the dri2_dpy from being destroyed
between eglTerminate() and eglInitialize() calls when a context is still bound,
a reference should only be taken when a successful call to
dri2_dpy->core->bindContext() has been made. Fix the issue by restoring the old
reference counting behaviour.

Fixes: 4e8f95f64d004 ("egl_dri2: Always unbind old contexts")
Fixes: 2907faee7a397 ("egl/dri2: try to bind old context if bindContext failed")
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Nicolas Cortes <nicolas.g.cortes@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3328
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6105>

14 months agofreedreno/decode: cffdec warnings cleanup
Rob Clark [Wed, 29 Jul 2020 18:29:57 +0000 (11:29 -0700)]
freedreno/decode: cffdec warnings cleanup

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6118>

14 months agofreedreno/rnn: headergen2 warnings cleanup
Rob Clark [Wed, 29 Jul 2020 18:25:13 +0000 (11:25 -0700)]
freedreno/rnn: headergen2 warnings cleanup

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6118>

14 months agoiris: Delete shader variants when deleting the API-facing shader
Kenneth Graunke [Wed, 5 Jun 2019 20:12:58 +0000 (13:12 -0700)]
iris: Delete shader variants when deleting the API-facing shader

We were space-leaking iris_compiled_shader objects, leaving them around
basically forever - long after the associated iris_uncompiled_shader was
deleted.  Perhaps even more importantly, this left the BO containing the
assembly referenced, meaning those were never reclaimed either.  For
long running applications, this can leak quite a bit of memory.

Now, when freeing iris_uncompiled_shader, we hunt down any associated
iris_compiled_shader objects and pitch those (and their BO) as well.

One issue is that the shader variants can still be bound, because we
haven't done a draw that updates the compiled shaders yet.  This can
cause issues because state changes want to look at the old program to
know what to flag dirty.  It's a bit tricky to get right, so instead
we defer variant deletion until the shaders are properly unbound, by
stashing them on a "dead" list and tidying that each time we try and
delete some shader variants.

This ensures long running programs delete their shaders eventually.

Fixes: ed4ffb97158 ("iris: rework program cache interface")
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6075>

14 months agoaco: remove isel for GLSL-style barriers
Rhys Perry [Mon, 20 Jul 2020 13:34:21 +0000 (14:34 +0100)]
aco: remove isel for GLSL-style barriers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>

14 months agoradv: use scoped barriers
Rhys Perry [Fri, 17 Jul 2020 18:17:10 +0000 (19:17 +0100)]
radv: use scoped barriers

fossil-db (LLVM, Navi):
Totals from 843 (0.62% of 135820) affected shaders:
SGPRs: 40456 -> 40480 (+0.06%); split: -0.10%, +0.16%
VGPRs: 39648 -> 39688 (+0.10%); split: -0.01%, +0.11%
CodeSize: 2936164 -> 2932508 (-0.12%); split: -0.21%, +0.09%
MaxWaves: 10828 -> 10827 (-0.01%)

fossil-db changes seem to be due to SPIR-V -> NIR emitting a workgroup
scope shared memory barrier instead of a group_memory_barrier.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>

14 months agoac/nir: implement scoped_barrier
Rhys Perry [Fri, 17 Jul 2020 18:16:08 +0000 (19:16 +0100)]
ac/nir: implement scoped_barrier

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>

14 months agonir/load_store_vectorize: fix indentation
Rhys Perry [Fri, 17 Jul 2020 16:15:26 +0000 (17:15 +0100)]
nir/load_store_vectorize: fix indentation

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>

14 months agonir: Filter modes of scoped memory barrier in nir_opt_load_store_vectorize
Caio Marcelo de Oliveira Filho [Sat, 11 Jan 2020 01:33:31 +0000 (17:33 -0800)]
nir: Filter modes of scoped memory barrier in nir_opt_load_store_vectorize

Otherwise a scoped memory barrier containing nir_var_mem_ubo (which
memoryBarrier() does lower to) would incorrectly prevent the
optimization to happen in UBOs.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>

14 months agonir: Add a find_variable_with_[driver_]location helper
Jason Ekstrand [Thu, 23 Jul 2020 04:37:27 +0000 (23:37 -0500)]
nir: Add a find_variable_with_[driver_]location helper

We've hand-rolled this loop 10 places and those are just the ones I
found easily.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/gl_nir_linker: Call add_vars_with_modes once for GL_PROGRAM_INPUT
Jason Ekstrand [Tue, 21 Jul 2020 16:55:27 +0000 (11:55 -0500)]
nir/gl_nir_linker: Call add_vars_with_modes once for GL_PROGRAM_INPUT

Now that nir_foreach_variable_with_modes can handle multiple modes at
one time, we can simplify things a bit and only walk the list once.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/split_per_member_structs: Inline split_variables_in_list
Jason Ekstrand [Tue, 21 Jul 2020 16:32:38 +0000 (11:32 -0500)]
nir/split_per_member_structs: Inline split_variables_in_list

This lets us do one list walk instead of three.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Use a single list for all shader variables
Jason Ekstrand [Mon, 20 Jul 2020 21:30:37 +0000 (16:30 -0500)]
nir: Use a single list for all shader variables

Instead of having separate lists of variables, roughly sorted by mode,
use a single list for all shader-level NIR variables.  This makes a few
list walks a bit longer here and there but list walks aren't a very
common thing in NIR at all.  On the other hand, it makes a lot of things
like validation, printing, etc. way simpler.  Also, there are a number
of cases where we move variables from inputs/outputs to globals and this
makes it way easier because we no longer have to move them between
lists.  We only have to deal with that if moving them from the shader to
a nir_function_impl.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agogallium/ttn: Use variable create/add helpers
Jason Ekstrand [Tue, 21 Jul 2020 17:15:27 +0000 (12:15 -0500)]
gallium/ttn: Use variable create/add helpers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agomesa/ptn: Use nir_variable_create
Jason Ekstrand [Tue, 21 Jul 2020 17:09:28 +0000 (12:09 -0500)]
mesa/ptn: Use nir_variable_create

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agoaco: Use nir_foreach_variable_with_modes to walk SSBOs
Jason Ekstrand [Tue, 21 Jul 2020 16:57:21 +0000 (11:57 -0500)]
aco: Use nir_foreach_variable_with_modes to walk SSBOs

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agopanfrost: Use nir_foreach_variable_with_modes in pan_compile
Jason Ekstrand [Tue, 21 Jul 2020 23:13:34 +0000 (18:13 -0500)]
panfrost: Use nir_foreach_variable_with_modes in pan_compile

Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agopanfrost/midgard: Make search_var take a nir_shader and mode
Jason Ekstrand [Mon, 20 Jul 2020 21:07:11 +0000 (16:07 -0500)]
panfrost/midgard: Make search_var take a nir_shader and mode

Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agor600/sfn: Use nir_foreach_variable_with_modes in IO vectorization
Jason Ekstrand [Tue, 21 Jul 2020 23:21:56 +0000 (18:21 -0500)]
r600/sfn: Use nir_foreach_variable_with_modes in IO vectorization

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agor600/sfn/lower_tex: Get rid of the lower_sampler vector
Jason Ekstrand [Wed, 22 Jul 2020 16:26:14 +0000 (11:26 -0500)]
r600/sfn/lower_tex: Get rid of the lower_sampler vector

We can get the result type information easily from nir_tex_instr itself
by looking at dest_type.  There's no reason to construct a vector and
try to index into it.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agor600/sfn/lower_tess_io: Rework get_tcs_varying_offset
Jason Ekstrand [Mon, 20 Jul 2020 21:04:40 +0000 (16:04 -0500)]
r600/sfn/lower_tess_io: Rework get_tcs_varying_offset

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agofreedreno/ir3_cmdline: Rework i/o variable fixup
Jason Ekstrand [Mon, 20 Jul 2020 20:53:59 +0000 (15:53 -0500)]
freedreno/ir3_cmdline: Rework i/o variable fixup

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agolima/standalone: Rework i/o variable fixup
Jason Ekstrand [Mon, 20 Jul 2020 20:48:22 +0000 (15:48 -0500)]
lima/standalone: Rework i/o variable fixup

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agofreedreno/ir3_lower_tess: Rework var list helpers
Jason Ekstrand [Mon, 20 Jul 2020 20:16:02 +0000 (15:16 -0500)]
freedreno/ir3_lower_tess: Rework var list helpers

They now take a nir_shader and a nir_variable_mode

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/gl_nir_linker: Use nir_foreach_variable_with_modes
Jason Ekstrand [Tue, 21 Jul 2020 16:54:19 +0000 (11:54 -0500)]
nir/gl_nir_linker: Use nir_foreach_variable_with_modes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/lower_variable_initializers: Restrict the modes we lower
Jason Ekstrand [Tue, 21 Jul 2020 23:46:24 +0000 (18:46 -0500)]
nir/lower_variable_initializers: Restrict the modes we lower

This is not a functional change because these are the only modes we
handle.  All others get silently ignored.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/split_per_member_structs: Use nir_variable_with_modes_safe
Jason Ekstrand [Tue, 21 Jul 2020 16:31:00 +0000 (11:31 -0500)]
nir/split_per_member_structs: Use nir_variable_with_modes_safe

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/lower_uniforms_to_ubo: Use nir_foreach_variable_with_modes
Jason Ekstrand [Tue, 21 Jul 2020 16:22:23 +0000 (11:22 -0500)]
nir/lower_uniforms_to_ubo: Use nir_foreach_variable_with_modes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/lower_two_sided_color: Use nir_variable_create
Jason Ekstrand [Tue, 21 Jul 2020 16:18:29 +0000 (11:18 -0500)]
nir/lower_two_sided_color: Use nir_variable_create

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/io_to_vector: Use nir_foreach_variable_with_modes
Jason Ekstrand [Tue, 21 Jul 2020 16:13:04 +0000 (11:13 -0500)]
nir/io_to_vector: Use nir_foreach_variable_with_modes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/lower_io_to_temporaries: Use a separate list for new inputs
Jason Ekstrand [Tue, 21 Jul 2020 14:51:05 +0000 (09:51 -0500)]
nir/lower_io_to_temporaries: Use a separate list for new inputs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Use a nir_shader and mode in lower_clip_cull_distance_arrays
Jason Ekstrand [Mon, 20 Jul 2020 22:34:42 +0000 (17:34 -0500)]
nir: Use a nir_shader and mode in lower_clip_cull_distance_arrays

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/lower_amul: Add a variable mode check
Jason Ekstrand [Mon, 20 Jul 2020 22:31:04 +0000 (17:31 -0500)]
nir/lower_amul: Add a variable mode check

This loop should only apply to UBOs and SSBOs because max_slot is never
used for normal uniforms.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Split nir_index_vars into two functions
Jason Ekstrand [Mon, 20 Jul 2020 21:49:46 +0000 (16:49 -0500)]
nir: Split nir_index_vars into two functions

We also very slightly change the semantics.  It no longer is one index
per list for global variables and is a single index over-all.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/split_vars: Add mode checks to list walks
Jason Ekstrand [Mon, 20 Jul 2020 20:04:45 +0000 (15:04 -0500)]
nir/split_vars: Add mode checks to list walks

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agost/nir: Rework fixup_varying_slots
Jason Ekstrand [Mon, 20 Jul 2020 20:57:45 +0000 (15:57 -0500)]
st/nir: Rework fixup_varying_slots

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/linking: Rework some internal helpers
Jason Ekstrand [Mon, 20 Jul 2020 22:15:27 +0000 (17:15 -0500)]
nir/linking: Rework some internal helpers

Instead of taking a variable list, take a nir_shader and mode.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Take a shader and variable mode in nir_assign_io_var_locations
Jason Ekstrand [Mon, 20 Jul 2020 19:42:53 +0000 (14:42 -0500)]
nir: Take a shader and variable mode in nir_assign_io_var_locations

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Take a nir_shader and variable mode in assign_var_locations
Jason Ekstrand [Mon, 20 Jul 2020 19:51:04 +0000 (14:51 -0500)]
nir: Take a nir_shader and variable mode in assign_var_locations

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Add and use a nir_variable_list_for_mode helper
Jason Ekstrand [Mon, 20 Jul 2020 19:32:01 +0000 (14:32 -0500)]
nir: Add and use a nir_variable_list_for_mode helper

We also add a new list iterator which takes a modes bitfield and
automatically figures out which list to use.  In the future, this
iterator will work for multiple modes but today it assumes a single mode
thanks to the behavior of nir_variable_list_for_mode.  This also doesn't
work for function_temp variables.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Add a nir_foreach_gl_uniform_variable helper for GL linking
Jason Ekstrand [Mon, 20 Jul 2020 19:09:50 +0000 (14:09 -0500)]
nir: Add a nir_foreach_gl_uniform_variable helper for GL linking

There are a bunch of cases where we really do want to walk the list that
is nir->uniforms because we want all things declared "uniform" in the
GLSL.  Add a helper for this but restrict it to the GL linking code.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Add a nir_foreach_uniform_variable helper
Jason Ekstrand [Sat, 18 Jul 2020 23:45:18 +0000 (18:45 -0500)]
nir: Add a nir_foreach_uniform_variable helper

This one's a bit more complex because it filters off only those
variables with mode == nir_var_uniform.  As such, it's not exactly a
drop-in replacement for nir_foreach_variable(var, &nir->uniforms).

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Add a nir_foreach_function_temp_variable helper
Jason Ekstrand [Wed, 20 May 2020 15:18:14 +0000 (10:18 -0500)]
nir: Add a nir_foreach_function_temp_variable helper

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Add nir_foreach_shader_in/out_variable helpers
Jason Ekstrand [Sat, 18 Jul 2020 23:24:25 +0000 (18:24 -0500)]
nir: Add nir_foreach_shader_in/out_variable helpers

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir/dead_variables: Respect the modes passed to remove_dead_vars
Jason Ekstrand [Tue, 21 Jul 2020 20:15:43 +0000 (15:15 -0500)]
nir/dead_variables: Respect the modes passed to remove_dead_vars

For the most part, this doesn't actually matter today.  We already only
call remove_dead_vars on the lists that are specified in the modes.  The
only functional change here is for the uniform, mem_ubo, and mem_ssbo
modes because they share a list.  If nir_remove_dead_variables is called
with a mode of nir_var_uniform, it will no longer remove UBOs or SSBOs,
for instance.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agonir: Take a mode in remove_unused_io_vars
Jason Ekstrand [Wed, 20 May 2020 15:09:05 +0000 (10:09 -0500)]
nir: Take a mode in remove_unused_io_vars

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>

14 months agodocs: change "Fixes:" tag example to match git fixes output
Frank Binns [Tue, 28 Jul 2020 16:54:05 +0000 (17:54 +0100)]
docs: change "Fixes:" tag example to match git fixes output

The "Fixes:" tag example has the commit title in double quotes, whereas the
suggested git fixes alias, a couple of lines below, also adds some outer
parenthesis.

Although there doesn't appear to be a consistent format for the "Fixes:" tag,
other than it should be a git commit sha followed by the commit title, the
information in the docs should at least be consistent. As the "Fixes:" tag was
inspired by the Linux kernel, which does have parenthesis, update the example to
match the git fixes output.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6106>

14 months agofreedreno/rnn: add schema validation
Rob Clark [Tue, 28 Jul 2020 16:15:05 +0000 (09:15 -0700)]
freedreno/rnn: add schema validation

Now that all the schema validation issues are fixed, enable xml
validation according to stylesheet in rnn.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: schema updates for dynamic/irregular offsets
Rob Clark [Tue, 28 Jul 2020 18:56:32 +0000 (11:56 -0700)]
freedreno/rnn: schema updates for dynamic/irregular offsets

Really we want to require one-of offset/offsets/doffsets.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/registers/mdp5: fix validation error
Rob Clark [Tue, 28 Jul 2020 18:54:58 +0000 (11:54 -0700)]
freedreno/registers/mdp5: fix validation error

Empty enums are not allowed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: fix use-group
Rob Clark [Tue, 28 Jul 2020 18:53:26 +0000 (11:53 -0700)]
freedreno/rnn: fix use-group

The schema describes the attribute as "ref" rather than "name".  Which
makes more sense.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: allow name to be optional in arrays
Rob Clark [Tue, 28 Jul 2020 18:01:02 +0000 (11:01 -0700)]
freedreno/rnn: allow name to be optional in arrays

We are using unnamed arrays to describe repeating portions of a pm4
packet.  So allow the name to be optional.  Instead of just using
the empty-string hack, drop the attribute.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: add "addvariant" to schema
Rob Clark [Tue, 28 Jul 2020 17:52:37 +0000 (10:52 -0700)]
freedreno/rnn: add "addvariant" to schema

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: describe copyright element in schema
Rob Clark [Tue, 28 Jul 2020 17:51:50 +0000 (10:51 -0700)]
freedreno/rnn: describe copyright element in schema

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/registers/adreno_pm4: fix validation errors
Rob Clark [Tue, 28 Jul 2020 17:26:31 +0000 (10:26 -0700)]
freedreno/registers/adreno_pm4: fix validation errors

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/registers/a4xx: fix validation error
Rob Clark [Tue, 28 Jul 2020 17:10:14 +0000 (10:10 -0700)]
freedreno/registers/a4xx: fix validation error

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/registers/a2xx: fix validation error
Rob Clark [Tue, 28 Jul 2020 17:07:55 +0000 (10:07 -0700)]
freedreno/registers/a2xx: fix validation error

And bonus whitespace fix.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: add variants/varset to domain
Rob Clark [Tue, 28 Jul 2020 17:03:06 +0000 (10:03 -0700)]
freedreno/rnn: add variants/varset to domain

We have already been using this to describe pm4 packets that are
specific to certain generations.

Maybe we should introduce a new "packet" element type instead.  But
first lets just get validation working with what we already use.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: relax Hexadecimal to HexOrNumber
Rob Clark [Tue, 28 Jul 2020 16:59:58 +0000 (09:59 -0700)]
freedreno/rnn: relax Hexadecimal to HexOrNumber

We are already using non-hex offsets to describe pm4 packet payloads.
Let's just permit this in the schema, rather than updating all the xml
to use hex.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: add radix/align
Rob Clark [Tue, 28 Jul 2020 16:57:11 +0000 (09:57 -0700)]
freedreno/rnn: add radix/align

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: add high/low/pos to registers
Rob Clark [Tue, 28 Jul 2020 16:55:10 +0000 (09:55 -0700)]
freedreno/rnn: add high/low/pos to registers

This was added recently in rnn, but the schema was not updated.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: add relaxed boolean type
Rob Clark [Tue, 28 Jul 2020 16:47:38 +0000 (09:47 -0700)]
freedreno/rnn: add relaxed boolean type

In the schema, boolean means strictly "true" or "false".  But rnn
parsing code was looking for "yes"/"1"/"no"/"0".  So split the
difference, and add a relaxed boolean type, and update rnn to also
accept "true" or "false".

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: update schema for 'pos'
Rob Clark [Tue, 28 Jul 2020 16:36:55 +0000 (09:36 -0700)]
freedreno/rnn: update schema for 'pos'

Ideally we'd like to express that *either* 'high' + 'low' OR 'pos' is
required, but it doesn't appear that this is possible.  But the rnn
parsing code should still enforce this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: rename schema file
Rob Clark [Tue, 28 Jul 2020 16:04:04 +0000 (09:04 -0700)]
freedreno/rnn: rename schema file

All of the xml references rules-ng.xsd, not rules-ng-ng.xsd

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: add error helper
Rob Clark [Tue, 28 Jul 2020 16:00:12 +0000 (09:00 -0700)]
freedreno/rnn: add error helper

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/rnn: split out helper to find files
Rob Clark [Tue, 28 Jul 2020 15:30:13 +0000 (08:30 -0700)]
freedreno/rnn: split out helper to find files

So we can re-use it to locate the schema file.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agofreedreno/tools: check rnn parse status
Rob Clark [Tue, 28 Jul 2020 14:55:49 +0000 (07:55 -0700)]
freedreno/tools: check rnn parse status

Don't silently ignore issues.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6107>

14 months agoci: Build kernels and rootfs for x86 devices
Tomeu Vizoso [Fri, 3 Jul 2020 08:04:20 +0000 (10:04 +0200)]
ci: Build kernels and rootfs for x86 devices

For testing Mesa on LAVA devices with the amd64 architecture, build
kernels and rootfs in the same way as we do for arm64 and armhf.

Also add a few trivial jobs for a specific AMD Chromebook.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5903>

14 months agoci: Split building of libdrm to its own script
Tomeu Vizoso [Mon, 27 Jul 2020 12:42:42 +0000 (14:42 +0200)]
ci: Split building of libdrm to its own script

As we are doing that in several places already and we'll need to build
in others as well.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5903>

14 months agoci: Don't ship vk-build-programs after building dEQP
Tomeu Vizoso [Mon, 27 Jul 2020 10:32:47 +0000 (12:32 +0200)]
ci: Don't ship vk-build-programs after building dEQP

As it's not needed at runtime.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5903>

14 months agoci: Fix URL for glslang
Tomeu Vizoso [Mon, 27 Jul 2020 12:59:19 +0000 (14:59 +0200)]
ci: Fix URL for glslang

master-tot doesn't have that zip file any more, but the just made
release still does.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5903>

14 months agoci: Print load stats after running dEQP
Tomeu Vizoso [Tue, 28 Jul 2020 06:22:34 +0000 (08:22 +0200)]
ci: Print load stats after running dEQP

So we can get an idea if what are the bottlenecks when looking for
opportunities to speed things up.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6101>

14 months agoci: Always print status code of HTTP uploads in tracie
Tomeu Vizoso [Tue, 28 Jul 2020 05:47:40 +0000 (07:47 +0200)]
ci: Always print status code of HTTP uploads in tracie

I'm seeing occasional unexpected 403 errors when uploading artifacts.
Print the response in case MinIO is telling us why.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Rohan Garg <rohan.garg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6101>

14 months agofreedreno: Add trace for CP_DRAW_INDIRECT_MULTI
Connor Abbott [Tue, 28 Jul 2020 12:49:05 +0000 (14:49 +0200)]
freedreno: Add trace for CP_DRAW_INDIRECT_MULTI

Test the indirect count case. This is recorded with turnip.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6104>

14 months agofreedreno/cffdec: Handle CP_DRAW_INDIRECT_MULTI like other draws
Connor Abbott [Tue, 28 Jul 2020 11:47:15 +0000 (13:47 +0200)]
freedreno/cffdec: Handle CP_DRAW_INDIRECT_MULTI like other draws

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6104>

14 months agofreedreno/rnn: Support stripes in rnndec_decodereg
Connor Abbott [Tue, 28 Jul 2020 11:42:23 +0000 (13:42 +0200)]
freedreno/rnn: Support stripes in rnndec_decodereg

We'll need this for finding where INDIRECT/STRIDE are in
CP_DRAW_INDIRECT_MULTI, since they are in different locations in each
variant.

This is tricky because we need to bubble up success/failure to the upper
levels, and 0 could be a valid offset if the stripe is inside an array
or in a packet. Hence we refactor tryreg to return success/failure
separately, although I stopped short of modifying rnndec_decodereg
itself.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6104>

14 months agotu: Dump CP_DRAW_INDIRECT_MULTI draw BO's
Connor Abbott [Tue, 28 Jul 2020 10:57:08 +0000 (12:57 +0200)]
tu: Dump CP_DRAW_INDIRECT_MULTI draw BO's

These will be decoded by cffdump.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6104>

14 months agobifrost: Fix packing of ADD_FEXP2_FAST
Chris Forbes [Tue, 28 Jul 2020 21:42:33 +0000 (14:42 -0700)]
bifrost: Fix packing of ADD_FEXP2_FAST

This was being packed as 1-src and so the Src1 was not set up properly.
It only worked by accident.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6111>

14 months agobifrost: Honor src swizzle in special math ops
Chris Forbes [Tue, 28 Jul 2020 19:40:44 +0000 (12:40 -0700)]
bifrost: Honor src swizzle in special math ops

Most ops use the common handling in emit_alu in order to convert NIR
sources to bifrost sources, but the "special" math op lowering handrolls
the conversion (due to needing to reference the same source multiple
times).

Unfortunately, that handrolled lowering did not consider that there
might be a non-identity swizzle on the source. In this case we would
reference the wrong component of the source and generate garbage.

Fixes all but two of the remaining failures on G31 in:
  dEQP-GLES2.functional.shaders.operator.exponential.*highp*

The following tests are still broken due to some other issue:
  dEQP-GLES2.functional.shaders.operator.exponential.exp2.highp_float_fragment
  dEQP-GLES2.functional.shaders.operator.exponential.exp2.highp_vec2_fragment

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6108>

14 months agoprevent multiply defined symbols
Daryl W. Grunau [Thu, 23 Jul 2020 21:39:07 +0000 (15:39 -0600)]
prevent multiply defined symbols

Without this patch applied gcc@10.1.0 fails to compile with the following
error (note mesa@18.3.6 but the latest release also posseses this problem):

  ld: ../../../../src/gallium/auxiliary/.libs/libgallium.a(u_debug_symbol.o):/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/galli um/auxiliary/util/u_debug_symbol.c:273: multiple definition of `symbols_hash'; ../../../../src/gallium/auxiliary/.libs/libgallium.a(u_debug_stack.o):/tmp/spa ck/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/gallium/auxiliary/util/u_debug_stack.c:49: first defined here
  collect2: error: ld returned 1 exit status
  make[4]: *** [libGL.la] Error 1
  make[4]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/gallium/targets/libgl-xlib'
  make[3]: *** [all-recursive] Error 1
  make[3]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src/gallium'
  make[2]: *** [all-recursive] Error 1
  make[2]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/tmp/spack/spack-stage/spack-stage-mesa-18.3.6-be7kyg2dyxwktir3zrai27n6a6coadab/spack-src/src'
  make: *** [all-recursive] Error 1

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3298
Cc: mesa-stable
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6053>

14 months agoamd: enable displayable DCC for everything newer than Navi1x
Marek Olšák [Mon, 27 Jul 2020 23:24:31 +0000 (19:24 -0400)]
amd: enable displayable DCC for everything newer than Navi1x

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6100>

14 months agoamd: add support for Navy Flounder
Marek Olšák [Mon, 27 Jul 2020 23:13:51 +0000 (19:13 -0400)]
amd: add support for Navy Flounder

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6100>

14 months agoamd: rename SIENNA -> SIENNA_CICHLID
Marek Olšák [Mon, 27 Jul 2020 23:11:11 +0000 (19:11 -0400)]
amd: rename SIENNA -> SIENNA_CICHLID

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6100>

14 months agoaco: create acq+rel barriers instead of acq/rel
Rhys Perry [Wed, 22 Jul 2020 10:47:20 +0000 (11:47 +0100)]
aco: create acq+rel barriers instead of acq/rel

NIR doesn't have atomic loads/stores, so we have to workaround that with
this for dEQP-VK.memory_model.* to pass.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: improve workgroup-scope and lower vmem/smem barriers
Rhys Perry [Wed, 13 May 2020 15:05:46 +0000 (16:05 +0100)]
aco: improve workgroup-scope and lower vmem/smem barriers

No fossil-db changes on Navi.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: improve sync_info for TCS output stores
Rhys Perry [Tue, 5 May 2020 12:30:12 +0000 (13:30 +0100)]
aco: improve sync_info for TCS output stores

Stop scheduling them as SSBO stores.

No fossil-db changes on Navi.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: use storage_scratch
Rhys Perry [Tue, 5 May 2020 10:54:59 +0000 (11:54 +0100)]
aco: use storage_scratch

fossil-db (Navi):
Totals from 9 (0.01% of 114665) affected shaders:
VMEM: 14456 -> 15312 (+5.92%)
VClause: 336 -> 327 (-2.68%)

Helps 9 Dark Souls 3 shaders a little.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: enable value numbering of s_buffer_load_*
Rhys Perry [Mon, 29 Jun 2020 12:22:19 +0000 (13:22 +0100)]
aco: enable value numbering of s_buffer_load_*

fossil-db (Navi):
Totals from 33 (0.03% of 114665) affected shaders:
SGPRs: 2176 -> 2152 (-1.10%)
VGPRs: 1572 -> 1564 (-0.51%)
CodeSize: 115988 -> 115472 (-0.44%)
Instrs: 21459 -> 21385 (-0.34%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agonir,radv/aco: add and use pass to lower make available/visible barriers
Rhys Perry [Fri, 1 May 2020 13:32:31 +0000 (14:32 +0100)]
nir,radv/aco: add and use pass to lower make available/visible barriers

Lower them to ACCESS_COHERENT to simplify the backend and
probably give better performance than invalidating or writing back the
entire L0/L1 cache.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: consider intrinsic access in visit_{load,store}_image
Rhys Perry [Fri, 24 Jul 2020 15:38:33 +0000 (16:38 +0100)]
aco: consider intrinsic access in visit_{load,store}_image

radv_nir_lower_memory_model will use this.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoradv/aco,aco: use scoped barriers
Rhys Perry [Wed, 13 May 2020 15:12:39 +0000 (16:12 +0100)]
radv/aco,aco: use scoped barriers

fossil-db (Navi):
Totals from 109 (0.08% of 132058) affected shaders:
SGPRs: 5416 -> 5424 (+0.15%)
CodeSize: 460500 -> 460508 (+0.00%); split: -0.07%, +0.07%
Instrs: 87278 -> 87272 (-0.01%); split: -0.09%, +0.09%
Cycles: 2241996 -> 2241852 (-0.01%); split: -0.04%, +0.04%
VMEM: 33868 -> 35539 (+4.93%); split: +5.14%, -0.20%
SMEM: 7183 -> 7184 (+0.01%); split: +0.36%, -0.35%
VClause: 1857 -> 1882 (+1.35%)
SClause: 2052 -> 2055 (+0.15%); split: -0.05%, +0.19%
Copies: 6377 -> 6380 (+0.05%); split: -0.02%, +0.06%
PreSGPRs: 3391 -> 3392 (+0.03%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: rework barriers and replace can_reorder
Rhys Perry [Fri, 26 Jun 2020 14:54:22 +0000 (15:54 +0100)]
aco: rework barriers and replace can_reorder

fossil-db (Navi):
Totals from 273 (0.21% of 132058) affected shaders:
CodeSize: 937472 -> 936556 (-0.10%)
Instrs: 158874 -> 158648 (-0.14%)
Cycles: 13563516 -> 13562612 (-0.01%)
VMEM: 85246 -> 85244 (-0.00%)
SMEM: 21407 -> 21310 (-0.45%); split: +0.05%, -0.50%
VClause: 9321 -> 9317 (-0.04%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>

14 months agoaco: add missing add_to_hazard_query
Rhys Perry [Fri, 24 Jul 2020 14:49:43 +0000 (15:49 +0100)]
aco: add missing add_to_hazard_query

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4905>