platform/upstream/mesa.git
15 months agozink: Do not reference nir_dest
Alyssa Rosenzweig [Mon, 14 Aug 2023 13:03:47 +0000 (09:03 -0400)]
zink: Do not reference nir_dest

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agopanfrost: Do not reference nir_dest
Alyssa Rosenzweig [Mon, 14 Aug 2023 12:59:04 +0000 (08:59 -0400)]
panfrost: Do not reference nir_dest

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agoasahi: Do not reference nir_dest
Alyssa Rosenzweig [Mon, 14 Aug 2023 12:57:58 +0000 (08:57 -0400)]
asahi: Do not reference nir_dest

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agopan/bi: Don't reference nir_dest
Alyssa Rosenzweig [Mon, 14 Aug 2023 12:55:17 +0000 (08:55 -0400)]
pan/bi: Don't reference nir_dest

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agopan/mdg: Don't reference nir_dest
Alyssa Rosenzweig [Mon, 14 Aug 2023 12:51:56 +0000 (08:51 -0400)]
pan/mdg: Don't reference nir_dest

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agoagx: Remove agx_nir_ssa_index
Alyssa Rosenzweig [Mon, 14 Aug 2023 12:48:11 +0000 (08:48 -0400)]
agx: Remove agx_nir_ssa_index

Deduplicated from agx_def_index.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agoagx: Stop passing nir_dest around
Alyssa Rosenzweig [Mon, 14 Aug 2023 12:46:28 +0000 (08:46 -0400)]
agx: Stop passing nir_dest around

Towards deleting nir_dest.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24674>

15 months agonir/from_ssa: Don't insert store_reg instructions before phis
Konstantin Seurer [Sat, 12 Aug 2023 12:32:25 +0000 (14:32 +0200)]
nir/from_ssa: Don't insert store_reg instructions before phis

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9528
Fixes: ae0408b ("nir/from_ssa: Support register intrinsics")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24647>

15 months agogallium/auxiliary/vl: Set correct csc matrix in set_buffer_layer
David Rosca [Thu, 10 Aug 2023 20:05:12 +0000 (22:05 +0200)]
gallium/auxiliary/vl: Set correct csc matrix in set_buffer_layer

Shaders used in set_buffer_layer will apply colorspace conversion,
so we need to set correct matrix depending on the input and output
surface formats.
Use BT.601 (default) for YUV to RGB and identity for RGB to RGB.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24626>

15 months agolavapipe: handle VkBufferUsageFlags2KHR
Mike Blumenkrantz [Fri, 11 Aug 2023 12:57:58 +0000 (08:57 -0400)]
lavapipe: handle VkBufferUsageFlags2KHR

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

15 months agolavapipe: handle VkPipelineCreateFlagBits2KHR
Mike Blumenkrantz [Fri, 11 Aug 2023 12:54:03 +0000 (08:54 -0400)]
lavapipe: handle VkPipelineCreateFlagBits2KHR

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

15 months agoci/baremetal: shorten BM_KERNEL to filename and BM_DTB to name only
David Heidelberg [Mon, 31 Jul 2023 07:48:09 +0000 (10:48 +0300)]
ci/baremetal: shorten BM_KERNEL to filename and BM_DTB to name only

We don't need the path, not at all when we use external kernel.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24646>

15 months agoci/baremetal: do not install curl, it's already there
David Heidelberg [Sun, 30 Jul 2023 17:33:14 +0000 (20:33 +0300)]
ci/baremetal: do not install curl, it's already there

curl is already installed in these images, drop it.

Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24646>

15 months agofreedreno: Use shared DIV_ROUND_UP instead div_round_up
Yonggang Luo [Fri, 4 Aug 2023 05:30:07 +0000 (13:30 +0800)]
freedreno: Use shared DIV_ROUND_UP instead div_round_up

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24666>

15 months agou/draw: skip zero-sized indirect draws
Mike Blumenkrantz [Fri, 11 Aug 2023 11:24:58 +0000 (07:24 -0400)]
u/draw: skip zero-sized indirect draws

cc: mesa-stable

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

15 months agoaco: summarize register demand after handling branches
Rhys Perry [Tue, 8 Aug 2023 20:02:21 +0000 (21:02 +0100)]
aco: summarize register demand after handling branches

Fixes various dEQP-VK.ray_query.builtin.rayqueryterminate.* crashes.

fossil-db (gfx1100):
Totals from 196 (0.15% of 133461) affected shaders:
PreSGPRs: 8342 -> 8558 (+2.59%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 5a536eca9ca7 ("aco: calculate correct register demand for branch instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24579>

15 months agoRevert "ci: disable Collabora's LAVA lab for maintance"
Sergi Blanch Torne [Tue, 1 Aug 2023 09:29:34 +0000 (11:29 +0200)]
Revert "ci: disable Collabora's LAVA lab for maintance"

This reverts commit https://gitlab.freedesktop.org/mesa/mesa/-/commit/0089d4507a4e8d5deb428c2455929d72cf349983

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24425>

15 months agoetnaviv: switch to S_FIXED(..) macro
Christian Gmeiner [Thu, 27 Jul 2023 13:12:59 +0000 (15:12 +0200)]
etnaviv: switch to S_FIXED(..) macro

In different traces for different GPU models I see the same pattern:
    0x00c80000, /*   [00A00] PA.VIEWPORT_SCALE_X = 200.000000 */
    0xff880000, /*   [00A04] PA.VIEWPORT_SCALE_Y = -120.000000 */

etna_f32_to_fixp16(..) handles the negative case differently then blob. In the
concrete example -120 gets converted to 0xff880001. Switch to S_FIXED(..) to
simplify our code and to get the same results as blob.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>

15 months agoetnaviv: switch to U_FIXED(..) macro
Christian Gmeiner [Thu, 27 Jul 2023 10:18:51 +0000 (12:18 +0200)]
etnaviv: switch to U_FIXED(..) macro

Lets have a look at trace from blob (GC3000):
    0x000b000b, /*   [10080] NTE.SAMPLER[0].SIZE := WIDTH=11,HEIGHT=11 */
    0x2001b86e, /*   [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=3.437500,HEIGHT=3.437500,ASTC=0,INT_FILTER=1,SRGB=0 */

If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x2001b86e) we can see that 0x6e is used for WIDTH and HEIGHT.

Lets have a look at an other texutre size 180x180:
    0x00b400b4, /*   [10080] NTE.SAMPLER[0].SIZE := WIDTH=180,HEIGHT=180 */
    0x2003bcef, /*   [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=7.468750,HEIGHT=7.468750,ASTC=0,INT_FILTER=1,SRGB=0 */

Lets use the same test on a different GPU that uses texture descriptors (GC7000):
    [44] SIZE: 0x000b000b WIDTH=11,HEIGHT=11
    ...
    [74] LOG_SIZE_EXT: 0x03750375 WIDTH=3.457031,HEIGHT=3.457031

If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x03750375) we can see that 0x375 is used for WIDTH and HEIGHT.

Lets have a look at an other texutre size 180x180:
    [44] SIZE: 0x00b400b4 WIDTH=180,HEIGHT=180
    ..
    [74] LOG_SIZE_EXT: 0x077d077d WIDTH=7.488281,HEIGHT=7.488281

etnaviv creates the following values for the two texture sizes:
  11 -> 0x6f
  180 -> 0xf0

Lets switch to U_FIXED(..) which results in equal values.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>

15 months agoetnaviv: switch to log2f(..)
Christian Gmeiner [Thu, 27 Jul 2023 10:12:08 +0000 (12:12 +0200)]
etnaviv: switch to log2f(..)

Drop our custom calculation of the logarithm base 2 and switch
to log2f(..).

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>

15 months agozink: fix crash in lower_pv_mode_gs_store
Mike Blumenkrantz [Fri, 11 Aug 2023 19:16:51 +0000 (15:16 -0400)]
zink: fix crash in lower_pv_mode_gs_store

src->parent can be null

Fixes: 39770c6503a ("zink: fix store subsitution in `lower_pv_mode_gs_store`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24642>

15 months agozink: fix null config screen creation
Mike Blumenkrantz [Fri, 11 Aug 2023 18:40:22 +0000 (14:40 -0400)]
zink: fix null config screen creation

Fixes: 6d60115be7c ("zink: Fix enumerate devices when running compositor")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24641>

15 months agoclc: use CLANG_RESOURCE_DIR for clang's resource path
Karol Herbst [Tue, 4 Jul 2023 00:15:03 +0000 (02:15 +0200)]
clc: use CLANG_RESOURCE_DIR for clang's resource path

With certain build configuration that value can be a non empty string and
needs to be used.

This will also require distributions to rebuild mesa if and only if
CLANG_RESOURCE_DIR changes between clang rebuilds or updates.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23981>

15 months agov3d: Use DIV_ROUND_UP instead div_round_up
Yonggang Luo [Fri, 4 Aug 2023 05:28:03 +0000 (13:28 +0800)]
v3d: Use DIV_ROUND_UP instead div_round_up

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24485>

15 months agoanv: don't try to access dynamic buffers from surface states
Lionel Landwerlin [Thu, 20 Jul 2023 13:43:08 +0000 (16:43 +0300)]
anv: don't try to access dynamic buffers from surface states

Even with direct descriptors, our current implementation works by
doing A64 messages to read/write dynamic buffers. This is so that we
can apply the sliding range view of the descriptor while having
robustness support.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 06dfd216d3 ("anv: add direct descriptor support to apply_layout")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24256>

15 months agoradv: Fixes mingw linkage error undefined reference to `radv_GetCalibratedTimestampsEXT'
Yonggang Luo [Thu, 10 Aug 2023 17:44:15 +0000 (01:44 +0800)]
radv: Fixes mingw linkage error undefined reference to `radv_GetCalibratedTimestampsEXT'

message:
../../src/amd/vulkan/radv_sqtt.c:812: undefined reference to `radv_GetCalibratedTimestampsEXT'

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

15 months agoci: disable Collabora's LAVA lab for maintance
Sergi Blanch Torne [Tue, 1 Aug 2023 09:22:27 +0000 (11:22 +0200)]
ci: disable Collabora's LAVA lab for maintance

This is to inform you of some planned downtime in the LAVA lab as follows:

* Start: 2023-08-14 08:00 BST (UTC+1)
* End: 2023-08-14 12:00 BST (UTC+1)

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24424>

15 months agogallium: move vertex stride to CSO
Mike Blumenkrantz [Fri, 30 Jun 2023 21:15:09 +0000 (17:15 -0400)]
gallium: move vertex stride to CSO

this simplifies code in most place and enables some optimizations in
frontends

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

15 months agonouveau: calloc vertex csos
Mike Blumenkrantz [Mon, 10 Jul 2023 18:37:34 +0000 (14:37 -0400)]
nouveau: calloc vertex csos

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

15 months agovirgl: fix some indentation
Mike Blumenkrantz [Wed, 5 Jul 2023 13:43:08 +0000 (09:43 -0400)]
virgl: fix some indentation

no functional changes

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

15 months agovirgl: move virgl_vertex_elements_state to header
Mike Blumenkrantz [Tue, 4 Jul 2023 14:55:37 +0000 (10:55 -0400)]
virgl: move virgl_vertex_elements_state to header

no functional changes

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

15 months agod3d10umd: use cso_context to set vertex buffers and elements
Mike Blumenkrantz [Fri, 30 Jun 2023 21:13:38 +0000 (17:13 -0400)]
d3d10umd: use cso_context to set vertex buffers and elements

should be no functional changes

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

15 months agonir: Drop nir_foreach_dest()
Faith Ekstrand [Sun, 13 Aug 2023 00:24:01 +0000 (19:24 -0500)]
nir: Drop nir_foreach_dest()

This requires an annoying bit of shuffling into nir_inline_helpers.h but
it's not horrible.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir/from_ssa: Use nir_foreach_def() instead of nir_foreach_dest()
Faith Ekstrand [Sun, 13 Aug 2023 00:23:23 +0000 (19:23 -0500)]
nir/from_ssa: Use nir_foreach_def() instead of nir_foreach_dest()

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agodxil: Use nir_foreach_def() instead of nir_foreach_dest()
Faith Ekstrand [Sun, 13 Aug 2023 00:19:21 +0000 (19:19 -0500)]
dxil: Use nir_foreach_def() instead of nir_foreach_dest()

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agost,zink,sfn: Use nir_foreach_def instead of nir_foreach_dest
Faith Ekstrand [Sun, 13 Aug 2023 00:18:51 +0000 (19:18 -0500)]
st,zink,sfn: Use nir_foreach_def instead of nir_foreach_dest

It's basically the same code in all three.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir: nir_foreach_ssa_def() -> nir_foreach_def()
Faith Ekstrand [Sun, 13 Aug 2023 00:10:24 +0000 (19:10 -0500)]
nir: nir_foreach_ssa_def() -> nir_foreach_def()

    s/nir_foreach_ssa_def/nir_foreach_def/g

followed by

    ninja -C _build clang-format

and a little hand clean-up in nir.c.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir: Drop nir_ssa_dest_init_for_type()
Faith Ekstrand [Sat, 12 Aug 2023 23:59:27 +0000 (18:59 -0500)]
nir: Drop nir_ssa_dest_init_for_type()

Replace it with a new nir_def_init_for_type()

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir: Drop nir_ssa_dest_init()
Faith Ekstrand [Sat, 12 Aug 2023 23:55:58 +0000 (18:55 -0500)]
nir: Drop nir_ssa_dest_init()

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir/serialize: [De]serialize nir_def nor nir_dest
Faith Ekstrand [Sat, 12 Aug 2023 23:53:42 +0000 (18:53 -0500)]
nir/serialize: [De]serialize nir_def nor nir_dest

This both gets rid of its use of nir_ssa_dest_init() but also will make
it easier to mechanically remove nir_dest entirely later.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir/clone: Clone nir_def nor nir_dest
Faith Ekstrand [Sat, 12 Aug 2023 23:53:12 +0000 (18:53 -0500)]
nir/clone: Clone nir_def nor nir_dest

This both gets rid of its use of nir_ssa_dest_init() but also will make
it easier to mechanically remove nir_dest entirely later.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir: Drop more instances of nir_ssa_dest_init()
Faith Ekstrand [Sun, 13 Aug 2023 00:01:17 +0000 (19:01 -0500)]
nir: Drop more instances of nir_ssa_dest_init()

Catching the cases that Coccinelle missed.  Mostly in C++ files using
gtest which causes Coccinelle to just give up and walk away.

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agonir: Drop most instances of nir_ssa_dest_init()
Faith Ekstrand [Sat, 12 Aug 2023 23:31:52 +0000 (18:31 -0500)]
nir: Drop most instances of nir_ssa_dest_init()

Generated using the following two semantic patches:

    @@
    expression I, J, NC, BS;
    @@

    -nir_ssa_dest_init(I, &J->dest, NC, BS);
    +nir_def_init(I, &J->dest.ssa, NC, BS);

    @@
    expression I, J, NC, BS;
    @@

    -nir_ssa_dest_init(I, &J->dest.dest, NC, BS);
    +nir_def_init(I, &J->dest.dest.ssa, NC, BS);

Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>

15 months agofrontends/va: Ignore requested size when creating VAEncCodedBufferType
David Rosca [Sun, 30 Jul 2023 15:36:06 +0000 (17:36 +0200)]
frontends/va: Ignore requested size when creating VAEncCodedBufferType

The buffer data is not directly accessible to application and it's
internally used to only store VACodedBufferSegment struct.
Ignore the size requested by application and instead allocate
sizeof(VACodedBufferSegment). Use calloc to zero out the struct.

This can save significant amount of memory, for example FFmpeg
will request up to tens of MB for single buffer.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6462

Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24410>

15 months agolavapipe: Use common physical device properties
Konstantin Seurer [Fri, 11 Aug 2023 10:55:05 +0000 (12:55 +0200)]
lavapipe: Use common physical device properties

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24629>

15 months agoclang-format: Disable formatting by default
Konstantin Seurer [Sat, 12 Aug 2023 08:53:39 +0000 (10:53 +0200)]
clang-format: Disable formatting by default

This should make `git clang-format` usable for patches that modify
clang formatted and manually formatted code.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9492
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24645>

15 months agonvk: Remove reference to genUserClip
M Henning [Sat, 12 Aug 2023 23:34:32 +0000 (19:34 -0400)]
nvk: Remove reference to genUserClip

GL uses this for adding clip distances to shaders that are missing them,
but the vulkan spec guarantees "A shader must write a single clip distance
for each enabled clip half-space"

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

15 months agonvk: Don't use nir_ssa_for_src()
Faith Ekstrand [Sat, 12 Aug 2023 20:42:21 +0000 (15:42 -0500)]
nvk: Don't use nir_ssa_for_src()

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

15 months agonir: Drop "SSA" from NIR language
Alyssa Rosenzweig [Sat, 12 Aug 2023 20:17:15 +0000 (16:17 -0400)]
nir: Drop "SSA" from NIR language

Everything is SSA now.

   sed -e 's/nir_ssa_def/nir_def/g' \
       -e 's/nir_ssa_undef/nir_undef/g' \
       -e 's/nir_ssa_scalar/nir_scalar/g' \
       -e 's/nir_src_rewrite_ssa/nir_src_rewrite/g' \
       -e 's/nir_gather_ssa_types/nir_gather_types/g' \
       -i $(git grep -l nir | grep -v relnotes)

   git mv src/compiler/nir/nir_gather_ssa_types.c \
          src/compiler/nir/nir_gather_types.c

   ninja -C build/ clang-format
   cd src/compiler/nir && find *.c *.h -type f -exec clang-format -i \{} \;

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24585>

15 months agonir: clang-format src/compiler/nir/*.[ch]
Faith Ekstrand [Tue, 8 Aug 2023 17:00:35 +0000 (12:00 -0500)]
nir: clang-format src/compiler/nir/*.[ch]

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

15 months agonir: Add a .clang-format file
Faith Ekstrand [Sat, 29 Jul 2023 16:37:48 +0000 (11:37 -0500)]
nir: Add a .clang-format file

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

15 months agonir: Add a do to the do/while in nir_const_value_t_array()
Faith Ekstrand [Wed, 9 Aug 2023 18:03:21 +0000 (13:03 -0500)]
nir: Add a do to the do/while in nir_const_value_t_array()

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

15 months agonir: Wrap pass macros in braces
Faith Ekstrand [Tue, 8 Aug 2023 16:53:39 +0000 (11:53 -0500)]
nir: Wrap pass macros in braces

This makes clang-format not mess them up so bad.  It's also probably a
good idea to make sure anything we declare in the macro is properly
scoped.

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

15 months agonir: Pretty format type mapping helpers
Faith Ekstrand [Tue, 8 Aug 2023 16:25:17 +0000 (11:25 -0500)]
nir: Pretty format type mapping helpers

One of them was even breaking after every return statement. Classy...

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

15 months agonir: More manual formatting
Faith Ekstrand [Tue, 8 Aug 2023 16:23:19 +0000 (11:23 -0500)]
nir: More manual formatting

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

15 months agonir: Don't clang-format debug print setup
Faith Ekstrand [Tue, 8 Aug 2023 16:11:56 +0000 (11:11 -0500)]
nir: Don't clang-format debug print setup

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

15 months agonir: Don't clang-format a couple typedefs
Faith Ekstrand [Sat, 29 Jul 2023 16:37:16 +0000 (11:37 -0500)]
nir: Don't clang-format a couple typedefs

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

15 months agonir: Don't clang-format const_value helpers
Faith Ekstrand [Sat, 29 Jul 2023 16:19:40 +0000 (11:19 -0500)]
nir: Don't clang-format const_value helpers

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

15 months agonir: Re-align a couple enums and add clang-format comments
Faith Ekstrand [Sat, 29 Jul 2023 15:53:09 +0000 (10:53 -0500)]
nir: Re-align a couple enums and add clang-format comments

I actually kinda care about the human-readable formatting of these
enums.  Keep clang-format from messing them up.

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

15 months agoclang-format: Set the default ColumnLimit to 0
Faith Ekstrand [Sat, 12 Aug 2023 19:07:42 +0000 (14:07 -0500)]
clang-format: Set the default ColumnLimit to 0

This is a better default than any actual limit because it causes
clang-format to mostly leave line wrapping alone.

Suggested-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>

15 months agoclang-format: nir_foreach_src is not a foreach macro
Faith Ekstrand [Tue, 8 Aug 2023 16:15:45 +0000 (11:15 -0500)]
clang-format: nir_foreach_src is not a foreach macro

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>

15 months agoclang-format: Add nir_foreach_reg_*
Faith Ekstrand [Sat, 29 Jul 2023 16:13:31 +0000 (11:13 -0500)]
clang-format: Add nir_foreach_reg_*

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24382>

15 months agoandroid: Introduce the Android buffer info abstraction
Roman Stratiienko [Tue, 23 Aug 2022 17:08:22 +0000 (20:08 +0300)]
android: Introduce the Android buffer info abstraction

Both EGL and Vulkan implementations require obtaining buffer metadata,
e.g., format, modifier, offsets, strides, etc.

Currently, mesa3d doesn't have a generic solution, and every Vulkan
implementation uses its getters. Most of the getters rely on
kernel metadata storage that is available for x86-based GPU drivers.

ARM-based Vulkan drivers rely on userspace metadata sharing, making it
important to use advanced metadata API. Otherwise, the driver will work
with limited functionality (no YUV, lack of support for modifiers, etc.)

Current EGL buffer getter implementation is advanced enough and used as
a base for a common Android buffer-getter logic.

Use example:

    void
    android_buffer_test(android_handle_type *a_handle)
    {
       // First, get the gralloc object. It will be created if it doesn't
       // exist. Use U_GRALLOC_TYPE_AUTO to let the implementation choose
       // the best gralloc
       struct u_gralloc *gralloc = u_gralloc_create(U_GRALLOC_TYPE_AUTO);

       // Prepare the internal handle structure (hal_format and
       // pixel_stride are required for the fallback implementation).
       // Both Vulkan and EGL clients expose HAL format / pixel stride
       // in their structures.
       u_gralloc_buffer_handle hnd = {
          .handle = a_handle->native_handle,
          .hal_format = a_handle->hal_format,
          .pixel_stride = a_handle->pixel_stride,
       };

       // Get the basic buffer info
       u_gralloc_buffer_basic_info basic_info;
       int ret = u_gralloc_get_buffer_basic_info(gralloc, &hnd, &basic_info);
       if (ret) {
          // Handle the error
       }

       // Get the color info
       u_gralloc_buffer_color_info color_info;
       ret = u_gralloc_get_buffer_color_info(gralloc, &hnd, &color_info);
       if (ret) {
          // Handle the error
       }

       // unref the gralloc object
       u_gralloc_destroy(&gralloc);
    }

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>

15 months agoutil: Add NONNULL macro
Roman Stratiienko [Thu, 10 Aug 2023 13:14:02 +0000 (16:14 +0300)]
util: Add NONNULL macro

Macro leverages __attribute__((__nonnull__)) to help users mark
the function parameter that isn't allowed to be NULL.

Suggested-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>

15 months agoci/deqp: really remove the uncompressed results.csv file
David Heidelberg [Sat, 12 Aug 2023 16:24:44 +0000 (18:24 +0200)]
ci/deqp: really remove the uncompressed results.csv file

Arguments are parsed in order, so the `-c` here causes that first `--rm`
won't get applied and then it gets overriden by `-o` which writes the file.

Sadly zstd won't report this as a issue, but that's being reported in [1],
so maybe in future versions zstd will warn about it.

[1] https://github.com/facebook/zstd/issues/3719

Fixes: d110299d77c9 ("ci/deqp-runner: compress results.csv before uploading it to GitLab")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24651>

15 months agoanv: move genX(rasterization_mode) to gfx8_cmd_buffer.c
Lionel Landwerlin [Sun, 4 Jun 2023 23:53:25 +0000 (02:53 +0300)]
anv: move genX(rasterization_mode) to gfx8_cmd_buffer.c

Only used there.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>

15 months agoanv: get rid of genX(emit_multisample)
Lionel Landwerlin [Tue, 1 Aug 2023 09:18:53 +0000 (12:18 +0300)]
anv: get rid of genX(emit_multisample)

The initialization can be simplified and the real programming moved
over to genX_pipeline.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>

15 months agointel/decoder: add options to decode surfaces/samplers
Lionel Landwerlin [Tue, 1 Aug 2023 20:16:43 +0000 (23:16 +0300)]
intel/decoder: add options to decode surfaces/samplers

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>

15 months agoanv: emit 3DSTATE_GS only once per pipeline
Lionel Landwerlin [Wed, 2 Aug 2023 06:30:05 +0000 (09:30 +0300)]
anv: emit 3DSTATE_GS only once per pipeline

Following 71ebd9b9d7, 3DSTATE_GS can be emitted as part of the
pipeline batch and as a dynamic state. Just do the latter.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 71ebd9b9d7 ("anv,hasvk: respect provoking vertex setting on geometry shaders")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>

15 months agoblorp: drop programming of 3DSTATE_(MESH|TASK)_SHADER
Lionel Landwerlin [Tue, 1 Aug 2023 08:51:36 +0000 (11:51 +0300)]
blorp: drop programming of 3DSTATE_(MESH|TASK)_SHADER

We can disable the MESH/TASK stages by just using the CONTROL
instruction and keep the rest of the HW programmed as before.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>

15 months agointel/decoder: constify some input parameters
Lionel Landwerlin [Fri, 4 Aug 2023 08:14:27 +0000 (11:14 +0300)]
intel/decoder: constify some input parameters

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>

15 months agoci/farms: enabled Microsoft job only when conditions are met
David Heidelberg [Thu, 10 Aug 2023 09:06:14 +0000 (11:06 +0200)]
ci/farms: enabled Microsoft job only when conditions are met

Otherwise it gets run by default on newly pushed fork branch.

In general, this is copy-paste of `.container-rules`.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24604>

15 months agozink/nir: add a zink specific intrinsic for push constants
antonino [Mon, 31 Jul 2023 15:54:52 +0000 (17:54 +0200)]
zink/nir: add a zink specific intrinsic for push constants

Push costants in Zink are not flat indexed like in vulkan drivers which
makes the `nir_intrinsic_load_push_constant` intrinsic inappropiate.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24401>

15 months agozink: remove unused indices from `nir_load_push_constant` calls
antonino [Mon, 31 Jul 2023 16:45:15 +0000 (18:45 +0200)]
zink: remove unused indices from `nir_load_push_constant` calls

Zink passes `base` and `range` indices to this intrinsic despite those
being ignored by nir_to_spirv. This change removes them completely.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24401>

15 months agoci/freedreno: document vs-nested-return-sibling-loop2 flake on Adreno 530
David Heidelberg [Fri, 11 Aug 2023 13:12:18 +0000 (15:12 +0200)]
ci/freedreno: document vs-nested-return-sibling-loop2 flake on Adreno 530

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24607>

15 months agoci/amd: add glx@glx-visuals-depth flake to raven
David Heidelberg [Fri, 11 Aug 2023 12:03:09 +0000 (14:03 +0200)]
ci/amd: add glx@glx-visuals-depth flake to raven

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24607>

15 months agoci/build: limit debian-build-testing to 30 minutes
David Heidelberg [Thu, 10 Aug 2023 10:04:39 +0000 (12:04 +0200)]
ci/build: limit debian-build-testing to 30 minutes

Previous 45 minutes is too much.

 - 5 - 15 minutes mesa LTO build
 - 5 - 15 minutes shader-db run

Should be safe, in case something fails, we still can make another run.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24607>

15 months agonir/opt_if: also rewrite uniform uses for read_invocation
Georg Lehmann [Thu, 10 Aug 2023 19:05:32 +0000 (21:05 +0200)]
nir/opt_if: also rewrite uniform uses for read_invocation

No Foz-DB changes, but maybe it matters in the future because dxil-spirv
will use read_invocation for WaveReadLaneFirst in fragment shaders.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24618>

15 months agovulkan: ignore VkPipelineColorWriteCreateInfoEXT if the state is dynamic
Samuel Pitoiset [Thu, 10 Aug 2023 07:16:34 +0000 (09:16 +0200)]
vulkan: ignore VkPipelineColorWriteCreateInfoEXT if the state is dynamic

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24601>

15 months agoegl/drm: fix EGL_EXT_buffer_age with gbm contexts
Erico Nunes [Fri, 11 Aug 2023 10:50:49 +0000 (12:50 +0200)]
egl/drm: fix EGL_EXT_buffer_age with gbm contexts

Fix remaining dri2 check from 3d59f4cfcbc, which caused gbm contexts to
not expose EGL_EXT_buffer_age anymore.

Fixes: 3d59f4cfcbc ("egl/drm: Use IMAGE_DRIVER instead of DRI2_LOADER")

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24630>

15 months agoasahi: Legalize compression before blitting
Alyssa Rosenzweig [Wed, 9 Aug 2023 18:15:35 +0000 (14:15 -0400)]
asahi: Legalize compression before blitting

Fixes invalid recursive blitting.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Do not allow creating vec8
Alyssa Rosenzweig [Thu, 10 Aug 2023 21:20:34 +0000 (17:20 -0400)]
agx: Do not allow creating vec8

mem_access_bit_size needs to split up 64x4 into 2 loads. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.64bit_compare.int64.comp_opiequal_vector

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Handle <32-bit local memory access
Alyssa Rosenzweig [Thu, 10 Aug 2023 21:09:14 +0000 (17:09 -0400)]
agx: Handle <32-bit local memory access

I don't know if this is possible to hit with GL, but it is with Vulkan. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.workgroup_memory.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Handle f2f16_rtne like f2f16
Alyssa Rosenzweig [Thu, 10 Aug 2023 18:28:55 +0000 (14:28 -0400)]
agx: Handle f2f16_rtne like f2f16

TBD whether we can control round modes later on.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Lower f2f16_rtz
Alyssa Rosenzweig [Thu, 10 Aug 2023 20:35:43 +0000 (16:35 -0400)]
agx: Lower f2f16_rtz

Based on what VIR does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Fix 64-bit immediate moves
Alyssa Rosenzweig [Fri, 11 Aug 2023 14:11:44 +0000 (10:11 -0400)]
agx: Fix 64-bit immediate moves

Don't truncate them in the builder. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.convertutof.uint64_to_float32_4294967296

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Fix uadd_sat packing
Alyssa Rosenzweig [Thu, 10 Aug 2023 20:21:19 +0000 (16:21 -0400)]
agx: Fix uadd_sat packing

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Handle conversions to 8-bit
Alyssa Rosenzweig [Thu, 10 Aug 2023 18:57:03 +0000 (14:57 -0400)]
agx: Handle conversions to 8-bit

These can't be lowered by nir_lower_bit_sizes but it doesn't actually matter.
Fixes SPIR-V conversions tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Lower f2u8/f2i8
Alyssa Rosenzweig [Fri, 11 Aug 2023 13:58:33 +0000 (09:58 -0400)]
agx: Lower f2u8/f2i8

The less 8-bit we need to emulate in the backend the better.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Handle blocks with no predecessors
Alyssa Rosenzweig [Thu, 10 Aug 2023 17:36:55 +0000 (13:36 -0400)]
agx: Handle blocks with no predecessors

This can come up with loops with SPIR-V. Fixes:

dEQP-VK.spirv_assembly.instruction.compute.loop_control.none

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoasahi: Fix incorrect BO bitmap reallocations
Asahi Lina [Fri, 11 Aug 2023 08:04:00 +0000 (17:04 +0900)]
asahi: Fix incorrect BO bitmap reallocations

If the BO handle is greater than 2x what fits inside the current bitmap
size, then we end up overflowing. Make sure to always reallocate to a
large enough bitmap, not just 2x the previous size.

Found while replaying firefox apitraces with looping (which apparently
leaks a ton of objects, but that might just be apitrace).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoasahi: Handle non-written RTs correctly
Asahi Lina [Fri, 11 Aug 2023 04:41:02 +0000 (13:41 +0900)]
asahi: Handle non-written RTs correctly

When a bound RT is not written to, we need to force the pass type to
translucent to ensure that this draw does not cull draws that do write
to that RT.

Fixes Inochi2D regression after c24b753378.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Move nir_lower_fragcolor out of agx_preprocess_nir
Mary [Fri, 11 Aug 2023 10:18:47 +0000 (12:18 +0200)]
agx: Move nir_lower_fragcolor out of agx_preprocess_nir

Do not apply "nir_lower_fragcolor" in the common code.

This fix a crash on agxv side when a frag shader have SSBO writes.

This is caused by "nir_lower_frag_color" assuming that every
"store_deref" will have a variable backing the
output.

Signed-off-by: Mary <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Stop setting forwarding bit
Alyssa Rosenzweig [Tue, 1 Aug 2023 01:42:10 +0000 (21:42 -0400)]
agx: Stop setting forwarding bit

We need actual analysis to set it properly, and improperly setting it can cause
random data dependency hazards it turns out. Stop setting it. Fixes some flaky
tests with shuffle code inserted.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Remove unused allocation
Alyssa Rosenzweig [Tue, 1 Aug 2023 13:29:40 +0000 (09:29 -0400)]
agx: Remove unused allocation

Relic from early RA attempts.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Don't reuse ssa_to_reg across blocks
Alyssa Rosenzweig [Tue, 1 Aug 2023 13:16:27 +0000 (09:16 -0400)]
agx: Don't reuse ssa_to_reg across blocks

This avoids an entire class of bugs with live range splitting. Fixes with
AGX_MESA_DEBUG=demand:

   dEQP-GLES31.functional.separate_shader.random.8

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Don't use ssa_to_reg across blocks
Alyssa Rosenzweig [Tue, 1 Aug 2023 13:13:02 +0000 (09:13 -0400)]
agx: Don't use ssa_to_reg across blocks

This is a footgun with live range spltiting.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Assert invariant stated in the comment
Alyssa Rosenzweig [Tue, 1 Aug 2023 13:07:31 +0000 (09:07 -0400)]
agx: Assert invariant stated in the comment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Use agx_replace_src
Alyssa Rosenzweig [Tue, 1 Aug 2023 12:33:13 +0000 (08:33 -0400)]
agx: Use agx_replace_src

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

15 months agoagx: Stop setting registers after the shader
Alyssa Rosenzweig [Tue, 1 Aug 2023 12:30:33 +0000 (08:30 -0400)]
agx: Stop setting registers after the shader

Leftover from before live range splitting. Should be a no-op.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>