platform/upstream/mesa.git
3 years agost/mesa: don't use cso_context to restore VBs, sampler views for glDrawPixels
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, sampler views for glDrawPixels

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs for glClear
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs for glClear

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs, sampler views for glBitmap
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, sampler views for glBitmap

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/pp: don't use cso_context to restore VBs, constbuf 0 and sampler views
Marek Olšák [Sun, 20 Dec 2020 07:49:07 +0000 (02:49 -0500)]
gallium/pp: don't use cso_context to restore VBs, constbuf 0 and sampler views

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views
Marek Olšák [Sun, 20 Dec 2020 07:49:07 +0000 (02:49 -0500)]
gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/api: add state invalidate interface as alternative to cso_save/restore
Marek Olšák [Sun, 20 Dec 2020 07:45:20 +0000 (02:45 -0500)]
gallium/api: add state invalidate interface as alternative to cso_save/restore

Some cso_context save/restore capabilities will be removed to decrease
CPU overhead. This is the alternative solution that e.g. the HUD will use.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/tests: stop using cso_set_sampler_views
Marek Olšák [Sun, 20 Dec 2020 05:44:03 +0000 (00:44 -0500)]
gallium/tests: stop using cso_set_sampler_views

It will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/xa: stop using cso_set_sampler_views
Marek Olšák [Sun, 20 Dec 2020 05:43:39 +0000 (00:43 -0500)]
st/xa: stop using cso_set_sampler_views

It will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/nine: stop using cso_set_sampler_views
Marek Olšák [Sun, 20 Dec 2020 05:43:08 +0000 (00:43 -0500)]
st/nine: stop using cso_set_sampler_views

It will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agoci: mark some sparse CTS as expected failures on RAVEN
Samuel Pitoiset [Fri, 15 Jan 2021 06:57:53 +0000 (07:57 +0100)]
ci: mark some sparse CTS as expected failures on RAVEN

Same as Vega10.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8518>

3 years agoandroid: r600/sfn: add sfn_nir_lower_64bit.cpp to Makefile.sources
Mauro Rossi [Thu, 14 Jan 2021 22:15:56 +0000 (23:15 +0100)]
android: r600/sfn: add sfn_nir_lower_64bit.cpp to Makefile.sources

Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: r600::r600_nir_split_64bit_io(nir_shader*)
>>> referenced by sfn_nir.cpp:981 (external/mesa/src/gallium/drivers/r600/sfn/sfn_nir.cpp:981)
...
ld.lld: error: undefined symbol: r600::r600_nir_64_to_vec2(nir_shader*)
>>> referenced by sfn_nir.cpp:1010 (external/mesa/src/gallium/drivers/r600/sfn/sfn_nir.cpp:1010)
...
ld.lld: error: undefined symbol: r600::r600_merge_vec2_stores(nir_shader*)
>>> referenced by sfn_nir.cpp:1015 (external/mesa/src/gallium/drivers/r600/sfn/sfn_nir.cpp:1015)

Fixes: 165fb5117b ("r600/sfn: add lowering passes to get 64 bit ops lowered to 32 bit vec2")
Cc: 21.0 <mesa-stable>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8505>

3 years agoradv: do not invalidate the L2 metadata cache on compute queues
Samuel Pitoiset [Thu, 14 Jan 2021 17:32:16 +0000 (18:32 +0100)]
radv: do not invalidate the L2 metadata cache on compute queues

The flush VA space was only allocated for command buffers on the
graphics queue. Also, the ZPASS_DONE event should never be emitted
on compute queues because it hangs.

Invalidating the L2 metadata cache is only required for coherency
between the RBs and L2, so only on the graphics queue.

The L2 cache is invalidated at beginning of any IBs and that should
also invalidate the L2 metadata cache for compute anyways.

Fixes: 4a783a3c ("radv: Use L2 coherency on GFX9+.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8494>

3 years agoci/freedreno: Remove some long-unseen a6xx known flakes.
Eric Anholt [Thu, 14 Jan 2021 23:43:00 +0000 (15:43 -0800)]
ci/freedreno: Remove some long-unseen a6xx known flakes.

We haven't seen any of these since June.

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

3 years agoci/freedreno: Drop skip list stuff from a5xx flakes.
Eric Anholt [Thu, 14 Jan 2021 23:41:49 +0000 (15:41 -0800)]
ci/freedreno: Drop skip list stuff from a5xx flakes.

I clearly copied the wrong file when setting this up.

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

3 years agoci/freedreno: Drop some long-unseen a5xx flakes.
Eric Anholt [Thu, 14 Jan 2021 23:41:04 +0000 (15:41 -0800)]
ci/freedreno: Drop some long-unseen a5xx flakes.

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

3 years agoci/freedreno: Remove a bunch of stale flakes from a3xx.
Eric Anholt [Thu, 14 Jan 2021 23:39:48 +0000 (15:39 -0800)]
ci/freedreno: Remove a bunch of stale flakes from a3xx.

I haven't seen these in the CI channel in many months.

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

3 years agoci/freedreno: Fix up the xfail/flake handling of a3xx texture functions.
Eric Anholt [Thu, 14 Jan 2021 23:38:12 +0000 (15:38 -0800)]
ci/freedreno: Fix up the xfail/flake handling of a3xx texture functions.

There's only one that's been unstable for the last couple months, and it's
almost always a fail, so just mark that one's state.

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

3 years agoci/freedreno: Mark some a5xx separate_shader tests as xfails.
Eric Anholt [Thu, 14 Jan 2021 23:34:04 +0000 (15:34 -0800)]
ci/freedreno: Mark some a5xx separate_shader tests as xfails.

These almost always fail for us, so we get flake complaints on basically
every job.

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

3 years agogallium/ntt: Avoid referencing undefined channels of system values.
Eric Anholt [Thu, 14 Jan 2021 00:30:15 +0000 (16:30 -0800)]
gallium/ntt: Avoid referencing undefined channels of system values.

Fixes failure to compile the shader on the host with gl_NumWorkGroups (for
example) on virgl.

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

3 years agogallium/ntt: Add support for store_per_vertex_output.
Eric Anholt [Thu, 14 Jan 2021 00:18:02 +0000 (16:18 -0800)]
gallium/ntt: Add support for store_per_vertex_output.

Needed by virgl and r600 to use NTT.

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

3 years agogallium/ntt: Don't vectorize IBFE/UBFE/BFI.
Eric Anholt [Wed, 13 Jan 2021 23:48:36 +0000 (15:48 -0800)]
gallium/ntt: Don't vectorize IBFE/UBFE/BFI.

Since our source language only allows scalar offset/bits arguments,
virglrenderer only handled scalar values too.  Just refuse to vectorize
these to prevent breakage.

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

3 years agomesa/st: Dump nir-to-tgsi output when ST_DEBUG=tgsi or nir is set.
Eric Anholt [Mon, 11 Jan 2021 23:55:29 +0000 (15:55 -0800)]
mesa/st: Dump nir-to-tgsi output when ST_DEBUG=tgsi or nir is set.

Suggested by Gert Wollny, and oh how I've wanted this.

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

3 years agomesa/st: Lower shader images before handing off to NIR-to-TGSI.
Eric Anholt [Mon, 11 Jan 2021 23:43:54 +0000 (15:43 -0800)]
mesa/st: Lower shader images before handing off to NIR-to-TGSI.

Otherwise you'll just throw unknown intrinsic errors on drivers ignorant
of this NIR option.

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

3 years agomesa/st: Make a single helper for the NIR-to-TGSI transfer.
Eric Anholt [Mon, 11 Jan 2021 23:39:15 +0000 (15:39 -0800)]
mesa/st: Make a single helper for the NIR-to-TGSI transfer.

The common path means that we get NIR IR dumping on builtin shaders, too.

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

3 years agofrontend/dri: Expose RGB[AX]_SRGB as well
Rob Clark [Tue, 12 Jan 2021 00:12:10 +0000 (16:12 -0800)]
frontend/dri: Expose RGB[AX]_SRGB as well

platform_android prefers RGB[AX] over BGR[AX] to avoid buggyness with
older android versions.  But we need to include the corresponding SRGB
formats as well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2888
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8452>

3 years agozink: decouple renderpass from framebuffer state
Mike Blumenkrantz [Thu, 24 Dec 2020 14:42:24 +0000 (09:42 -0500)]
zink: decouple renderpass from framebuffer state

a framebuffer is based on the surfaces attached to it

a renderpass is based on the operations being performed

a zink_framebuffer object doesn't necessarily need to be changed
if the renderpass changes, as this might just indicate that a clear operation
is being used instead of a load, so we can cache the corresponding vk objects
into the zink_framebuffer based on the renderpass ops being used to (eventually)
reduce fb object thrashing by doing more incremental updates

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agozink: use 'fb' variable name for zink_framebuffer objects in zink_framebuffer.c
Mike Blumenkrantz [Thu, 24 Dec 2020 14:22:25 +0000 (09:22 -0500)]
zink: use 'fb' variable name for zink_framebuffer objects in zink_framebuffer.c

let's be a bit consistent and intuitive

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agozink: rename param in zink_create_framebuffer
Mike Blumenkrantz [Thu, 24 Dec 2020 14:21:48 +0000 (09:21 -0500)]
zink: rename param in zink_create_framebuffer

this is consistent with other state naming

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agozink: ralloc zink_framebuffer structs
Mike Blumenkrantz [Thu, 24 Dec 2020 14:20:39 +0000 (09:20 -0500)]
zink: ralloc zink_framebuffer structs

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agozink: remove renderpass refcounting
Mike Blumenkrantz [Thu, 24 Dec 2020 14:17:23 +0000 (09:17 -0500)]
zink: remove renderpass refcounting

this is useless because we never destroy renderpasses during the lifetime
of a process and don't want to do so

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agozink: add batch flag for checking renderpass state
Mike Blumenkrantz [Thu, 24 Dec 2020 14:16:33 +0000 (09:16 -0500)]
zink: add batch flag for checking renderpass state

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agozink: rework framebuffer state
Mike Blumenkrantz [Thu, 24 Dec 2020 13:26:32 +0000 (08:26 -0500)]
zink: rework framebuffer state

we don't want to actually be tracking any null surfaces, so instead use
the vk object for this purpose

also store the fb state onto the fb object so we have this info available
at all times

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8227>

3 years agoir3: add debug option to override shader assembly
Danylo Piliaiev [Fri, 8 Jan 2021 13:09:30 +0000 (15:09 +0200)]
ir3: add debug option to override shader assembly

IR3_SHADER_DEBUG=vs,tcs,tes... now also prints shader's sha1.

When there is a file named %sha1%.asm in IR3_SHADER_OVERRIDE_PATH
directory - ir3 assembly from file would be parsed, assembled, and
will override the shader with corresponding sha1 hash.

Parsing failure is considered unrecoverable error.
Upon successful override shader's assembly is printed with:
 "Native code (overridden) for unnamed ..."

This debug option allows easier testing of small changes in
assembly without modifying the compiler or using computerator.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8388>

3 years agozink: only emit streamout targets during draw if we have them
Mike Blumenkrantz [Tue, 17 Nov 2020 23:30:00 +0000 (18:30 -0500)]
zink: only emit streamout targets during draw if we have them

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8503>

3 years agomesa: always set valid index bounds for non-indexed draws for classic drivers
Marek Olšák [Tue, 12 Jan 2021 19:45:03 +0000 (14:45 -0500)]
mesa: always set valid index bounds for non-indexed draws for classic drivers

This should fix crashing piglit tests on the i915 classic driver.

Fixes: 2358da81d26 - mesa: switch (Multi)DrawArrays to DrawGallium

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8453>

3 years agoiris: Fix android build due to missing link to libmesa_iris_gen125
Jordan Justen [Sun, 10 Jan 2021 00:10:26 +0000 (16:10 -0800)]
iris: Fix android build due to missing link to libmesa_iris_gen125

Reported-by: Yugang Fan
Fixes: cd3251d6baf ("intel/iris: Build gen 12.5")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8426>

3 years agoturnip: make GS use correct varyings size from previous stage
Danylo Piliaiev [Thu, 14 Jan 2021 17:13:19 +0000 (19:13 +0200)]
turnip: make GS use correct varyings size from previous stage

Fixes:
 dEQP-VK.tessellation.invariance.primitive_set.triangles_fractional_even_spacing_ccw
 dEQP-VK.tessellation.invariance.outer_edge_division.triangles_fractional_even_spacing
 dEQP-VK.tessellation.invariance.outer_edge_symmetry.triangles_fractional_odd_spacing_cw
 dEQP-VK.tessellation.invariance.outer_edge_symmetry.quads_fractional_odd_spacing_ccw
 dEQP-VK.tessellation.invariance.outer_edge_symmetry.isolines_equal_spacing_cw
 dEQP-VK.tessellation.invariance.outer_edge_index_independence.triangles_equal_spacing_ccw
 dEQP-VK.tessellation.invariance.outer_edge_index_independence.triangles_fractional_even_spacing_cw
 dEQP-VK.tessellation.invariance.inner_triangle_set.triangles_equal_spacing

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8497>

3 years agoiris: only set point sprite overrides if actually using points
Yevhenii Kolesnikov [Thu, 15 Oct 2020 14:21:14 +0000 (17:21 +0300)]
iris: only set point sprite overrides if actually using points

Fixes black screen in some FNA games.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3431
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7218>

3 years agozink: partially enable SSBO pipe cap
Mike Blumenkrantz [Tue, 5 Jan 2021 13:51:28 +0000 (08:51 -0500)]
zink: partially enable SSBO pipe cap

this enables atomic counters

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add more usage bits for buffer types
Mike Blumenkrantz [Tue, 17 Nov 2020 23:25:41 +0000 (18:25 -0500)]
zink: add more usage bits for buffer types

these things can be anything they want to be when they grow up

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: flag ssbo buffer resources as having pending writes on batch
Mike Blumenkrantz [Tue, 4 Aug 2020 18:57:06 +0000 (14:57 -0400)]
zink: flag ssbo buffer resources as having pending writes on batch

ssbos are the only descriptor type we support (so far) that allows writes
during the draw, so we have to ensure that we set the right flag on the batch
reference to handle sync if the buffer is later read from

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: split UBOs and samplers into 'read' batch references during draw
Mike Blumenkrantz [Fri, 28 Aug 2020 13:17:37 +0000 (09:17 -0400)]
zink: split UBOs and samplers into 'read' batch references during draw

we have the technology, so now we can just flag these resources as being
read from instead of also being written to, freeing them up for concurrent reads
without requiring fencing

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: start supporting atomic shader ops
Mike Blumenkrantz [Tue, 4 Aug 2020 18:28:50 +0000 (14:28 -0400)]
zink: start supporting atomic shader ops

this handles atomic_add, which is what atomic counters use

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: modify ubo loading in ntv to work for ssbos
Mike Blumenkrantz [Tue, 4 Aug 2020 18:24:54 +0000 (14:24 -0400)]
zink: modify ubo loading in ntv to work for ssbos

if ssbo variables are declared using the same structure as ubos, then
the mechanics here are identical, and we can just add a couple extra lines
to handle the atomic ops and different array usage

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: emit ssbo variables in ntv
Mike Blumenkrantz [Tue, 4 Aug 2020 18:26:22 +0000 (14:26 -0400)]
zink: emit ssbo variables in ntv

we're structuring these the same as ubos so we can reuse the same load
function later

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: hook up ssbo shader bindings
Mike Blumenkrantz [Tue, 4 Aug 2020 18:22:52 +0000 (14:22 -0400)]
zink: hook up ssbo shader bindings

this is just the struct zink_shader binding point stuff, but nothing is
using it yet

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add set_shader_buffers pipe_context method
Mike Blumenkrantz [Tue, 4 Aug 2020 18:21:00 +0000 (14:21 -0400)]
zink: add set_shader_buffers pipe_context method

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add util function for emitting ntv atomic ops
Mike Blumenkrantz [Tue, 4 Aug 2020 18:27:36 +0000 (14:27 -0400)]
zink: add util function for emitting ntv atomic ops

these all need specific memory params, but otherwise they're the same
as normal ops, so we can just make a helper function here to add in the memory
params

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add spirv builder function for runtime array type
Mike Blumenkrantz [Tue, 4 Aug 2020 18:20:19 +0000 (14:20 -0400)]
zink: add spirv builder function for runtime array type

we'll need this for ssbos

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agonir/lower_uniforms_to_ubo: set explicit_binding on uniform_0
Mike Blumenkrantz [Wed, 2 Dec 2020 16:40:33 +0000 (11:40 -0500)]
nir/lower_uniforms_to_ubo: set explicit_binding on uniform_0

this variable is always bound to buffer index 0, so the binding info
here is actually useful

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7935>

3 years agozink: optimize renderpass hash table
Mike Blumenkrantz [Wed, 13 Jan 2021 16:08:25 +0000 (11:08 -0500)]
zink: optimize renderpass hash table

only the existing render targets need to be used for table entries

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8487>

3 years agoutil/set: split off create() into an init() function
Mike Blumenkrantz [Thu, 7 Jan 2021 14:39:46 +0000 (09:39 -0500)]
util/set: split off create() into an init() function

this brings parity with the matching hash_table api

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoutil/set: add the found param to search_or_add
Mike Blumenkrantz [Thu, 7 Jan 2021 14:38:52 +0000 (09:38 -0500)]
util/set: add the found param to search_or_add

this brings parity with the internal api

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoutil/set: optimize rehash for empty table and no-func clears
Mike Blumenkrantz [Tue, 12 Jan 2021 17:20:41 +0000 (12:20 -0500)]
util/set: optimize rehash for empty table and no-func clears

if the table is filled with deleted entries, we don't need to rzalloc+free an identical
block of memory for the table, we can just memset the existing one

the same applies to table clears without a function passed in that the table
doesn't need to be iterated and can just be memset

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoutil/hash_table: optimize rehash for empty table and no-func clears
Mike Blumenkrantz [Tue, 12 Jan 2021 17:20:41 +0000 (12:20 -0500)]
util/hash_table: optimize rehash for empty table and no-func clears

if the table is filled with deleted entries, we don't need to rzalloc+free an identical
block of memory for the table, we can just memset the existing one

the same applies to table clears without a function passed in that the table
doesn't need to be iterated and can just be memset

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoradeonsi: invalidate compute sgprs in si_rebind_buffer
Pierre-Eric Pelloux-Prayer [Mon, 11 Jan 2021 19:40:09 +0000 (20:40 +0100)]
radeonsi: invalidate compute sgprs in si_rebind_buffer

If we don't tag compute sgpr as dirty they will point to the
ol buffer location.
This fixes arb_compute_shader-dlist with mcbp enabled.

Fixes: 85a6bcca615 ("radeonsi: pass at most 3 images and/or shader buffers via user SGPRs for compute")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8433>

3 years agoac: add ifdef __cplusplus guard to header
Pierre-Eric Pelloux-Prayer [Mon, 11 Jan 2021 19:37:25 +0000 (20:37 +0100)]
ac: add ifdef __cplusplus guard to header

ac_shadowed_regs.h can be included from si_state_draw.cpp so this commit
adds the needed guards.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8433>

3 years agoci: Use meson test directly instead of ninja test
Michel Dänzer [Tue, 12 Jan 2021 17:39:03 +0000 (18:39 +0100)]
ci: Use meson test directly instead of ninja test

The former allows specifying how many processes to spawn for tests. The
latter seems to spawn (up to) as many test processes as there are CPU
cores.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8451>

3 years agoci: Remove .gitlab-ci/meson-build.bat
Michel Dänzer [Tue, 12 Jan 2021 17:27:31 +0000 (18:27 +0100)]
ci: Remove .gitlab-ci/meson-build.bat

Unused since 07885cbcdb0b "CI: Add native Windows VS2019 build"

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8451>

3 years agoanv: add transfer usage for color/depth/stencil attachments
Lionel Landwerlin [Mon, 4 Jan 2021 12:47:37 +0000 (13:47 +0100)]
anv: add transfer usage for color/depth/stencil attachments

We sometimes use anv_layout_to_aux_state() to compute the aux state of
an image during the resolve operations at the end of a render
(sub)pass.

If we're dealing with a multisampled image that is created without a
transfer usage, our internal code might trigger a resolve using the
transfer layout (see genX_cmd_buffer.c:cmd_buffer_end_subpass), for
which the image doesn't the usage bit. The current code tries to AND
the 2 usages which won't have any bit in common, thus skipping all
checks below.

v2: Add the transfer usages depending on attachment usage (Lionel)

v3: Limit to samples > 1 (Jason) && DEPTH_STENCIL_ATTACHMENT_BIT (Lionel)

v4: Add transfer usage at image creation (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 54b525caf0aa99 ("anv: Rework anv_layout_to_aux_state")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4037
Reviewed-by: Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8307>

3 years agoturnip/ir3: handle image load/stores produced by AtomicLoad/Store
Danylo Piliaiev [Wed, 13 Jan 2021 14:39:41 +0000 (16:39 +0200)]
turnip/ir3: handle image load/stores produced by AtomicLoad/Store

SpvOpAtomicLoad and SpvOpAtomicStore are translated into
nir_intrinsic_image_deref_store/load instead of some separate
atomic intrinsics, however they don't have src or dest type
specified. Turnip doesn't support shaderImageFloat32Atomics
so type is just integer.

Fixes:
dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.device.payload_local.image.guard_local.image.frag
dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_local.buffer.guard_local.image.comp
dEQP-VK.memory_model.write_after_read.core11.u32.coherent.fence_fence.atomicwrite.device.payload_local.buffer.guard_local.image.comp
dEQP-VK.memory_model.write_after_read.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_local.image.guard_local.image.comp
dEQP-VK.memory_model.write_after_read.core11.u32.coherent.fence_fence.atomicwrite.workgroup.payload_nonlocal.workgroup.guard_local.image.comp

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8476>

3 years agolavapipe: Defer lavapipe warning to CreateDevice
Witold Baryluk [Fri, 8 Jan 2021 10:16:53 +0000 (10:16 +0000)]
lavapipe: Defer lavapipe warning to CreateDevice

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4055
Fixes: b38879f8c5f57b7f1802e433e33181bdf5e72aef
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8377>

3 years agopanfrost: Fix typos.
Vinson Lee [Sat, 9 Jan 2021 02:39:38 +0000 (18:39 -0800)]
panfrost: Fix typos.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8400>

3 years agogallium/tgsi: garbage collect unused TGSI_UTIL_SIGN_MODE.
Eric Anholt [Thu, 7 Jan 2021 18:56:54 +0000 (10:56 -0800)]
gallium/tgsi: garbage collect unused TGSI_UTIL_SIGN_MODE.

Noticed while git grepping for abs/neg stuff.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

3 years agogallium/tgsi: Rewrite the docs on source modifiers.
Eric Anholt [Mon, 11 Jan 2021 19:22:53 +0000 (11:22 -0800)]
gallium/tgsi: Rewrite the docs on source modifiers.

Clarify what the rules are, and warn about the exceptions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

3 years agogallium/tgsi: Remove support for f64 src modifiers.
Eric Anholt [Thu, 7 Jan 2021 18:53:03 +0000 (10:53 -0800)]
gallium/tgsi: Remove support for f64 src modifiers.

The tgsi.rst was not very clear but didn't indicate that they were
supported, and llvmpipe only supported double abs and not negate.
glsl_to_tgsi never generated them, and neither did the new nir_to_tgsi, so
just garbage collect it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

3 years agogallium/tgsi: Assert that we don't see integer abs modifiers.
Eric Anholt [Thu, 7 Jan 2021 18:20:57 +0000 (10:20 -0800)]
gallium/tgsi: Assert that we don't see integer abs modifiers.

tgsi.rst says it's not supported, and llvmpipe, r600, and virgl don't
support it.  Make sure nobody else introduces them like I did while
testing only on softpipe.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

3 years agogallium/ntt: Stop lowering integer source mods.
Eric Anholt [Thu, 7 Jan 2021 18:04:03 +0000 (10:04 -0800)]
gallium/ntt: Stop lowering integer source mods.

While tgsi_exec.c (softpipe) implemented 32b integer src mods, the
tgsi.rst documentation says only 32b negate is supported and not abs.
llvmpipe implemented 32 and 64 negate but not abs, virgl implemented
negate incorrectly, and r600 apparently doesn't do any integer src mods.
glsl_to_tgsi has apparently never generated integer src mods.

Given that r600 can't do any integer src mods, just stop trying to
generate them for TGSI.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

3 years agogallium/ttn: Add support for TGSI_OPCODE_I64NEG/ABS.
Eric Anholt [Sat, 9 Jan 2021 00:22:57 +0000 (16:22 -0800)]
gallium/ttn: Add support for TGSI_OPCODE_I64NEG/ABS.

Found when converting AMD's built-in TGSI shaders to not using 64-bit src
mods.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8369>

3 years agonv50,nvc0: explicitly list recently-added caps
Ilia Mirkin [Wed, 13 Jan 2021 01:07:25 +0000 (20:07 -0500)]
nv50,nvc0: explicitly list recently-added caps

Some of these should be implemented, but that can be done in a later
change.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8461>

3 years agonv50/ir: ignore FS_BLEND_EQUATION_ADVANCED
Ilia Mirkin [Tue, 12 Jan 2021 23:41:06 +0000 (18:41 -0500)]
nv50/ir: ignore FS_BLEND_EQUATION_ADVANCED

It's unsupported, but gets set unconditionally by the state tracker,
even when fbfetch is to be used.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8461>

3 years agozink: clamp sampler+samplerview limits
Mike Blumenkrantz [Tue, 12 Jan 2021 21:40:41 +0000 (16:40 -0500)]
zink: clamp sampler+samplerview limits

* struct shader_info provides a 32bit mask for textures_used
* samplers and samplerviews are a 1:1 mapping for shader descriptors
* also according to spec this is always 32 per stage

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8457>

3 years agointel/genxml,anv,iris: Drop the legacy compute path from gen125.xml
Jason Ekstrand [Wed, 17 Jun 2020 19:04:02 +0000 (14:04 -0500)]
intel/genxml,anv,iris: Drop the legacy compute path from gen125.xml

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agoiris: Add support for COMPUTE_WALKER
Jordan Justen [Wed, 13 Feb 2019 19:11:43 +0000 (11:11 -0800)]
iris: Add support for COMPUTE_WALKER

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agoanv: Enable push constants on gen12-hp
Jason Ekstrand [Mon, 4 May 2020 23:08:35 +0000 (18:08 -0500)]
anv: Enable push constants on gen12-hp

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agointel/fs: Emit code for Gen12-HP indirect compute data
Jason Ekstrand [Mon, 4 May 2020 21:17:58 +0000 (16:17 -0500)]
intel/fs: Emit code for Gen12-HP indirect compute data

Reworks:
 * Jordan: Apply to gen > 12
 * Jordan: Adjust comment about loading constants

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agoanv: Add a general state pool
Jason Ekstrand [Mon, 4 May 2020 22:08:00 +0000 (17:08 -0500)]
anv: Add a general state pool

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agoanv: Use COMPUTE_WALKER for gen12-hp
Jordan Justen [Thu, 15 Nov 2018 00:51:00 +0000 (16:51 -0800)]
anv: Use COMPUTE_WALKER for gen12-hp

Rework: Rafael Antognolli, Jason Ekstrand
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agoanv: Don't use MEDIA_INTERFACE_DESCRIPTOR_LOAD for gen12-hp
Jordan Justen [Thu, 15 Nov 2018 00:48:57 +0000 (16:48 -0800)]
anv: Don't use MEDIA_INTERFACE_DESCRIPTOR_LOAD for gen12-hp

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agoanv: Emit CFE_STATE for gen12-hp
Jordan Justen [Wed, 14 Nov 2018 19:04:15 +0000 (11:04 -0800)]
anv: Emit CFE_STATE for gen12-hp

Rework:
 * make scratch TODO. (Jason)
 * emit_compute_cs_state => emit_compute_state. (Jason)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agointel/fs: Allow compute dispatch without a pushed subgroup ID on Gen12-HP
Jason Ekstrand [Wed, 17 Jun 2020 04:06:25 +0000 (23:06 -0500)]
intel/fs: Allow compute dispatch without a pushed subgroup ID on Gen12-HP

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agointel/compiler: Disable push constants on gen12-hp
Jordan Justen [Tue, 13 Nov 2018 22:26:23 +0000 (14:26 -0800)]
intel/compiler: Disable push constants on gen12-hp

We currently don't use push constants with the COMPUTE_WALKER command.
Make all uniforms to be pull constants.

The local group id previously was a push constant, but is now
available in R0.2[7:0].

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agointel/tools: Decode COMPUTE_WALKER
Jason Ekstrand [Mon, 15 Jun 2020 22:33:54 +0000 (17:33 -0500)]
intel/tools: Decode COMPUTE_WALKER

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agointel/genxml/gen125: Add CFE_STATE and COMPUTE_WALKER
Jordan Justen [Sun, 11 Nov 2018 10:14:53 +0000 (02:14 -0800)]
intel/genxml/gen125: Add CFE_STATE and COMPUTE_WALKER

Reworks:
 * Jason: Captalize COMPUTE_WALKER::BTD mode
 * Jason: Make COMPUTE_WALKER::InlineData an array
 * Jason: Remove stale fields, uint=>bool, add missing enum values.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8342>

3 years agodocs: update calendar for 21.0.0-rc1
Dylan Baker [Wed, 13 Jan 2021 18:28:20 +0000 (10:28 -0800)]
docs: update calendar for 21.0.0-rc1

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

3 years agodocs: update calendar and link releases notes for 20.3.3
Dylan Baker [Wed, 13 Jan 2021 18:27:45 +0000 (10:27 -0800)]
docs: update calendar and link releases notes for 20.3.3

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

3 years agodocs: Add sha256sum for 20.3.3
Dylan Baker [Wed, 13 Jan 2021 18:24:11 +0000 (10:24 -0800)]
docs: Add sha256sum for 20.3.3

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

3 years agodocs: add release notes for 20.3.3
Dylan Baker [Wed, 13 Jan 2021 18:06:42 +0000 (10:06 -0800)]
docs: add release notes for 20.3.3

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

3 years agopanfrost: Don't skip the test with a 4k shader
Boris Brezillon [Wed, 13 Jan 2021 10:26:54 +0000 (11:26 +0100)]
panfrost: Don't skip the test with a 4k shader

Commit bfcdc8f1747e ("pan/bi: Add some zero bytes after shaders on
Bifrost") should have fixed the problem.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8470>

3 years agonir/loop_unroll: unroll more aggressively if it can improve load scheduling
Rhys Perry [Tue, 1 Sep 2020 10:55:58 +0000 (11:55 +0100)]
nir/loop_unroll: unroll more aggressively if it can improve load scheduling

Significantly improves performance of a Control compute shader. Also seems
to increase FPS at the very start of the game by ~5% (RX 580, 1080p,
medium settings, no MSAA).

fossil-db (Sienna):
Totals from 81 (0.06% of 139391) affected shaders:
SGPRs: 3848 -> 4362 (+13.36%); split: -0.99%, +14.35%
VGPRs: 4132 -> 4648 (+12.49%)
CodeSize: 275532 -> 659188 (+139.24%)
MaxWaves: 986 -> 906 (-8.11%)
Instrs: 54422 -> 126865 (+133.11%)
Cycles: 1057240 -> 750464 (-29.02%); split: -42.61%, +13.60%
VMEM: 26507 -> 61829 (+133.26%); split: +135.56%, -2.30%
SMEM: 4748 -> 5895 (+24.16%); split: +31.47%, -7.31%
VClause: 1933 -> 6802 (+251.89%); split: -0.72%, +252.61%
SClause: 1179 -> 1810 (+53.52%); split: -3.14%, +56.66%
Branches: 1174 -> 1157 (-1.45%); split: -23.94%, +22.49%
PreVGPRs: 3219 -> 3387 (+5.22%); split: -0.96%, +6.18%

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/6538>

3 years agofreedreno/ir3: Remove legacy packed-struct encoding
Rob Clark [Mon, 11 Jan 2021 18:30:12 +0000 (10:30 -0800)]
freedreno/ir3: Remove legacy packed-struct encoding

Note that we can't actually remove the packed structs themselves yet,
because tu still uses them in some hand-coded blit shaders.

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

3 years agofreedreno/ir3/decode: Switch over to new disasm
Rob Clark [Fri, 8 Jan 2021 22:32:33 +0000 (14:32 -0800)]
freedreno/ir3/decode: Switch over to new disasm

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

3 years agofreedreno/ir3: Realign disasm shader stats
Rob Clark [Sat, 9 Jan 2021 20:36:08 +0000 (12:36 -0800)]
freedreno/ir3: Realign disasm shader stats

To better match up with what mesa shader-db stats look like, for easier
comparision.

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

3 years agofreedreno/ir3: Better sstall estimation
Rob Clark [Sat, 9 Jan 2021 20:12:37 +0000 (12:12 -0800)]
freedreno/ir3: Better sstall estimation

1) Take into account repeat/nop cycles
2) Clear sfu_delay after an (ss) sync

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

3 years agofreedreno/ir3: Small resinfo disasm tweak
Rob Clark [Thu, 31 Dec 2020 20:19:45 +0000 (12:19 -0800)]
freedreno/ir3: Small resinfo disasm tweak

Add the 'type' field.

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

3 years agofreedreno/ir3: Switch over to new encoder/decoder
Rob Clark [Wed, 30 Dec 2020 20:03:06 +0000 (12:03 -0800)]
freedreno/ir3: Switch over to new encoder/decoder

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

3 years agofreedreno/ir3/tests: Switch disasm test over to new decoder
Rob Clark [Thu, 31 Dec 2020 19:42:12 +0000 (11:42 -0800)]
freedreno/ir3/tests: Switch disasm test over to new decoder

Also, uncomment the `stc` test vectors (since the new decoder decodes
these properly) and comment out an instruction which looks suspiciously
like -6.0 in hex.

This also switches the parser back to `atomic.b.op` from `atomic.op.b`
which was a short-term workaround to make it easier for the legacy
disassembler.

Also switch the binary encoding for ldib to clear b0, because the new
disassembler warns about unexpected dontcare bits (which cases the
disasm to not match).

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

3 years agofreedreno/hw/isa: Add expression caching
Rob Clark [Tue, 15 Dec 2020 21:22:37 +0000 (13:22 -0800)]
freedreno/hw/isa: Add expression caching

Drops decoding an ~850KB collection of instructions from ~4min to ~1sec.

Granted for normal sized shaders, this probably doesn't matter.. but it
at reduces my cycle time for fixing things to match existing disasm
syntax using this massive collection of unique instructions.

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

3 years agofreedreno/hw/isa: Add description of ir3 ISA
Rob Clark [Mon, 14 Dec 2020 00:20:40 +0000 (16:20 -0800)]
freedreno/hw/isa: Add description of ir3 ISA

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

3 years agofreedreno/hw: Add isaspec mechanism for documenting/defining an ISA
Rob Clark [Mon, 14 Dec 2020 00:18:43 +0000 (16:18 -0800)]
freedreno/hw: Add isaspec mechanism for documenting/defining an ISA

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