platform/upstream/mesa.git
22 months agoAndroid.mk: Provide a custom entry name to ensure meson checks succeed
Alessandro Astone [Sun, 24 Jul 2022 19:10:41 +0000 (21:10 +0200)]
Android.mk: Provide a custom entry name to ensure meson checks succeed

When meson tests for the compability of some linker flags, not having
the default entry symbol "_start" defined makes the check fail for
a warning unrelated to the linker flag meson is testing.

Since these tests normally just try to compile a C program with a main,
use "main" as the ficticious entry point.

Specifically, this makes "-Wl,--build-id=sha1" recognised as valid
and allows its use for drivers that rely on it.

This is a temporary workaround that is required until Android.mk is
changed to support both shared libraries and executables.

Cc: "22.0" "22.1" "22.2" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17715>

22 months agoAndroid.mk: Filter out --build-id=md5 linker flag
Alessandro Astone [Sat, 23 Jul 2022 15:37:32 +0000 (17:37 +0200)]
Android.mk: Filter out --build-id=md5 linker flag

To avoid conflicts with meson-generated --build-id linker option

Cc: "22.0" "22.1" "22.2" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17715>

22 months agoutil: Fixes comment about debug_get_option
Yonggang Luo [Thu, 25 Aug 2022 01:28:15 +0000 (09:28 +0800)]
util: Fixes comment about debug_get_option

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18242>

22 months agoradv: Enable EXT_mesh_shader on RDNA2 with RADV_PERFTEST=ext_ms
Timur Kristóf [Thu, 20 Jan 2022 15:36:28 +0000 (16:36 +0100)]
radv: Enable EXT_mesh_shader on RDNA2 with RADV_PERFTEST=ext_ms

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>

22 months agoradv: Implement EXT_mesh_shader draw calls.
Timur Kristóf [Mon, 28 Feb 2022 13:25:19 +0000 (14:25 +0100)]
radv: Implement EXT_mesh_shader draw calls.

There is a new packet DISPATCH_MESH_INDIRECT_MULTI which we use
for indirect mesh shader only draws. This packet allows using
a 3D dispatch (however firstTask doesn't work with this packet).

Otherwise everything else works the same way as
the NV_mesh_shader draw calls.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>

22 months agoac/nir/ngg: Add EXT_mesh_shader vertex/primitive count.
Timur Kristóf [Mon, 28 Feb 2022 13:24:17 +0000 (14:24 +0100)]
ac/nir/ngg: Add EXT_mesh_shader vertex/primitive count.

In EXT_mesh_shader the vertex and primitive counts are set using a
built-in SetMeshOutputsEXT function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>

22 months agoac/nir/ngg: Add EXT_mesh_shader CullPrimitiveEXT output.
Timur Kristóf [Mon, 28 Feb 2022 19:12:00 +0000 (20:12 +0100)]
ac/nir/ngg: Add EXT_mesh_shader CullPrimitiveEXT output.

This is a per-primitive boolean output.
When set to 1, the primitive should be culled.

Implement this by using this boolean as the null primitive
flag for primitive exports.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>

22 months agoac/nir/ngg: Add EXT_mesh_shader primitive indices.
Timur Kristóf [Mon, 28 Feb 2022 08:15:44 +0000 (09:15 +0100)]
ac/nir/ngg: Add EXT_mesh_shader primitive indices.

In EXT_mesh_shader the indices output is an array of vectors
which is indexed by the primitive index.

(They practically behave like a per-primitive output, although
technically the spec does not treat them as per-primitive.)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18367>

22 months agozink: track min_samples state for per sample shading
SoroushIMG [Sat, 27 Aug 2022 00:08:46 +0000 (01:08 +0100)]
zink: track min_samples state for per sample shading

Vulkan pipeline state sampleShadingEnable and minSampleShading are directly related to GL_SAMPLE_SHADING_ARB.
Track min_samples provided by st and include it in pipeline state.
This was seen as failures in cts cases where per sample shading along with sample interpolation qualifiers are tested:
dEQP-GL45-ES31.functional.shaders.multisample_interpolation.sample_qualifier.*

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18314>

22 months agoRevert "ci: set venus on lavapipe to manual due to flakes"
Tomeu Vizoso [Mon, 5 Sep 2022 09:03:24 +0000 (11:03 +0200)]
Revert "ci: set venus on lavapipe to manual due to flakes"

Issue should be fixed now.

This reverts commit a03ce740bbbd2364e37bdd358d634b352ff515c7.

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

22 months agoci: Make sure that the Crosvm control socket has been removed
Tomeu Vizoso [Mon, 5 Sep 2022 09:01:00 +0000 (11:01 +0200)]
ci: Make sure that the Crosvm control socket has been removed

To avoid Crosvm bailing out at startup like this:

ERROR - dEQP error: [ERROR:src/main.rs:2826] invalid value "crosvm-14.sock": this socket path already exists

Closes: #7093

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

22 months agoac/surface: disallow 256KB swizzle modes on gfx11 APUs
Marek Olšák [Mon, 29 Aug 2022 04:21:44 +0000 (00:21 -0400)]
ac/surface: disallow 256KB swizzle modes on gfx11 APUs

It doesn't work.

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

22 months agoac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock
Marek Olšák [Mon, 29 Aug 2022 00:50:42 +0000 (20:50 -0400)]
ac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock

and update amdgpu_drm.h

Fixes: 50238f495869ce5 - amd/common: Remove redundant code for determining memory ops per clock
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7163

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

22 months agozink: clamp miplodbias when creating sampler
Erik Faye-Lund [Mon, 29 Aug 2022 13:50:54 +0000 (15:50 +0200)]
zink: clamp miplodbias when creating sampler

The Vulkan spec states that it's illegal to pass a mipLodBias larger
than maxSamplerLodBias, but the gallium value here hasn't been clamped.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7140
Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18295>

22 months agohasvk: expose VK_EXT_depth_clamp_zero_one
Lionel Landwerlin [Fri, 2 Sep 2022 10:32:22 +0000 (13:32 +0300)]
hasvk: expose VK_EXT_depth_clamp_zero_one

Simple enough to expose on hasvk.

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

22 months agoanv: enable EXT_depth_clamp_zero_one
Lionel Landwerlin [Fri, 2 Sep 2022 10:30:40 +0000 (13:30 +0300)]
anv: enable EXT_depth_clamp_zero_one

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

22 months agov3dv: switch to common code for command buffer lifecycles
Iago Toral Quiroga [Fri, 2 Sep 2022 09:32:59 +0000 (11:32 +0200)]
v3dv: switch to common code for command buffer lifecycles

This gives us the capacity to recycle command buffers in the pool.
Based on a similar change done by Jason to Anvil.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18388>

22 months agogallium/u_threaded: fix offset calculation for draw_multi slots
Max Kellermann [Mon, 22 Aug 2022 18:11:18 +0000 (20:11 +0200)]
gallium/u_threaded: fix offset calculation for draw_multi slots

This fixes a buffer corruption bug with glMultiDrawElementsEXT(): the
offset for the source index buffer is reset for each draw_multi slot,
copying only the first `dr` values to each slot's index buffer.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18189>

22 months agogallium/u_threaded: add missing reference counts for draw_multi slots
Max Kellermann [Mon, 22 Aug 2022 18:10:46 +0000 (20:10 +0200)]
gallium/u_threaded: add missing reference counts for draw_multi slots

If a glMultiDrawElementsEXT() call doesn't fit into a single slot, the
same pipe_resource pointer is copied into all following slots, the
completion of each will decrement the reference counter; however, it
was never incremented for all but the first slot.

This fixes a use-after-free bug with glMultiDrawElementsEXT().

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18189>

22 months agonv/nir: Set ssbo CacheMode from intrinsic access
M Henning [Sun, 12 Dec 2021 02:44:27 +0000 (21:44 -0500)]
nv/nir: Set ssbo CacheMode from intrinsic access

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18354>

22 months agoasahi: Identify stencil test enable
Alyssa Rosenzweig [Sun, 12 Jun 2022 13:49:24 +0000 (09:49 -0400)]
asahi: Identify stencil test enable

There are a pair of flags controlling the stencil test. One enables
stencil testing in general, the other enables two-sided stencil. Compare
the identical "twosided" flag in src/imagination/csbgen/rogue_ppp.xml's
STATE_ISPCTL structure, at the samebit offset even. Evidently this word of
the "Rasterizer" is, in fact, a derivative of STATE_ISPCTL.

Fixes

   dEQP-GLES2.functional.fragment_ops.depth_stencil.*
   dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.*
   dEQP-GLES2.functional.fragment_ops.random.*

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

22 months agoasahi: Fix depth/stencil buffers
Alyssa Rosenzweig [Sun, 15 May 2022 17:22:08 +0000 (13:22 -0400)]
asahi: Fix depth/stencil buffers

There are a bunch of bits we need to set right to get depth/stencil
loads/stores working, including with independent settings for each. The
kernel "helps" us here.

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

22 months agoasahi: Handle out-of-bounds clear_stencil
Alyssa Rosenzweig [Sat, 3 Sep 2022 21:06:09 +0000 (17:06 -0400)]
asahi: Handle out-of-bounds clear_stencil

Just use the bottom 8-bits (we have only 8-bit stencil formats),
otherwise we fail an assertion in GenXML. In this case the wrapping
behaviour is ok.

Fixes:

   dEQP-GLES2.functional.depth_stencil_clear.depth_stencil
   dEQP-GLES2.functional.depth_stencil_clear.stencil

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

22 months agoasahi: Add 1D and 1D Array enums
Alyssa Rosenzweig [Sat, 3 Sep 2022 19:02:20 +0000 (15:02 -0400)]
asahi: Add 1D and 1D Array enums

To finish out the enum.

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

22 months agoasahi: Correct SET_SHADER_EXTENDED disambig bit
Alyssa Rosenzweig [Sat, 3 Sep 2022 18:01:03 +0000 (14:01 -0400)]
asahi: Correct SET_SHADER_EXTENDED disambig bit

This is still a guess, but a considerably firmer one as it now corrects
handles the clear pipelines emitted by Metal as well as the regular
vertex/fragment shader, and gets rid of the preshader special cases
seen there. Fixes decode of clear pipeline's preshaders.

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

22 months agoasahi: Identify and use first level field of texture
Alyssa Rosenzweig [Sat, 3 Sep 2022 15:53:46 +0000 (11:53 -0400)]
asahi: Identify and use first level field of texture

As we recently discovered, the layout of level L of a mipmapped 2D image
of size WxH is /not/ the same as the layout of a non-mipmapped 2D image
of size minify(W, L) x minify(H, L). The difference occurs due to
subtleties of the "power of two" miptrees which can force a level to use
a larger tile size than it would have required at root level. To handle
this quirk correctly, the driver must not implement texture views with
address arithmetic -- it must supply instead the base width/height of a
texture and use first/last level fields on the texture descriptor to map
it. Similar issues occur when writing a particular level of a mipmapped
texture, which was handled correctly in the colour case but not the Z/S
case.

Fixes

   dEQP-GLES2.functional.texture.mipmap.cube.generate.*

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

22 months agoasahi: Fix "stride" for tiled textures
Alyssa Rosenzweig [Sat, 3 Sep 2022 03:19:54 +0000 (23:19 -0400)]
asahi: Fix "stride" for tiled textures

It doesn't exist, but there's a count of mip levels for writeable image
descs. Setting that appropriately matters at high mip levels.

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

22 months agoasahi: Fix nonmipmapped array textures
Alyssa Rosenzweig [Sat, 3 Sep 2022 02:39:07 +0000 (22:39 -0400)]
asahi: Fix nonmipmapped array textures

pot_level can be greater than the number of levels actually included --
don't overallocate. Fix the issue and add a representative unit test.
Fixes:

   dEQP-GLES2.functional.texture.size.cube.512x512_rgb888

Fixes: 6ff75da8aa4 ("ail: Introduce image layout module")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>

22 months agoasahi: Fix depth for cube maps
Alyssa Rosenzweig [Sat, 3 Sep 2022 02:23:05 +0000 (22:23 -0400)]
asahi: Fix depth for cube maps

For cube maps, depth=1 in the hardware (but 6 in Gallium). Likewise for
cube map arrays, depth=n in the hardware (but 6n in Gallium). We need to
divide to compensate. This will be relevant for cube map arrays in the
future -- add the dimension XML for cube map arrays too.

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

22 months agoasahi: Label batch flush reasons
Alyssa Rosenzweig [Fri, 17 Jun 2022 03:30:29 +0000 (23:30 -0400)]
asahi: Label batch flush reasons

This was helpful in identifying the bottleneck in Inochi2D (the clears).

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

22 months agoasahi: Relax assert in decoder
Alyssa Rosenzweig [Wed, 10 Aug 2022 01:53:59 +0000 (21:53 -0400)]
asahi: Relax assert in decoder

Seen == 0x8 with >4 render targets.

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

22 months agoasahi: Trim garbage at end of set shader
Alyssa Rosenzweig [Mon, 23 May 2022 16:35:39 +0000 (12:35 -0400)]
asahi: Trim garbage at end of set shader

Unfortunately the actual size of this data structure is unclear.

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

22 months agoasahi: Use util_blitter_clear
Alyssa Rosenzweig [Fri, 17 Jun 2022 03:29:18 +0000 (23:29 -0400)]
asahi: Use util_blitter_clear

To avoid flush, use util_blitter_clear to clear with rectangles when
there is already content in the scene. This ~doubles the performance of
Inochi2D, which does frequent stencil clears in the middle of the screen
to implement masking.

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

22 months agoasahi: Handle empty fragment shaders
Alyssa Rosenzweig [Thu, 1 Sep 2022 21:44:02 +0000 (17:44 -0400)]
asahi: Handle empty fragment shaders

When an empty fragment shader is used with Metal, the stop command is
still included but this special bit is set, suppressing tilebuffer
access. Failing to do so but using empty shaders for u_blitter depth
clears causes Glitch Lina:

   https://twitter.com/LinaAsahi/status/1537869064793575424

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

22 months agoasahi: Export agx_blitter_save
Alyssa Rosenzweig [Fri, 17 Jun 2022 03:10:06 +0000 (23:10 -0400)]
asahi: Export agx_blitter_save

So we can use it for clears.

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

22 months agoasahi: Make ctx->zs a pointer
Alyssa Rosenzweig [Fri, 17 Jun 2022 03:08:48 +0000 (23:08 -0400)]
asahi: Make ctx->zs a pointer

When we save ZSA state with u_blitter, u_blitter just records the
pointer for the state. It doesn't copy it. That requires an extra
indirection on the context (as other drivers do) to fix restores of ZSA
state with u_blitter.

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

22 months agoasahi: Note some more unknowns in the XML
Alyssa Rosenzweig [Thu, 2 Jun 2022 00:43:54 +0000 (20:43 -0400)]
asahi: Note some more unknowns in the XML

Lot of r/e waiting here...

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

22 months agoasahi: Split up unk 2b
Alyssa Rosenzweig [Mon, 23 May 2022 17:13:16 +0000 (13:13 -0400)]
asahi: Split up unk 2b

Seems to be flags.

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

22 months agoasahi: Fix Indexed Draw command
Alyssa Rosenzweig [Thu, 1 Sep 2022 22:20:38 +0000 (18:20 -0400)]
asahi: Fix Indexed Draw command

Add the missing stub in the decoder for it, so we can decode indexed
draws instead of reading back garbage, and fill in some known unknowns
in the structure.

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

22 months agoagx: Plumb through nir_op_txf
Alyssa Rosenzweig [Sat, 3 Sep 2022 19:31:15 +0000 (15:31 -0400)]
agx: Plumb through nir_op_txf

nir_op_txf maps to AGX's texture_load, which is encoded like
texture_sample. The one outstanding question with this commit is the
rules for the sample required ... in NIR and APIs (including Metal), txf
is samplerless, but the AGX instruction consumes a sampler. Hopefully
any sampler will do, though?

Passes dEQP-GLES3.functional.shaders.texture_functions.texelfetch.*

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

22 months agoagx: Defeature indirect vbufs
Alyssa Rosenzweig [Fri, 2 Sep 2022 03:08:26 +0000 (23:08 -0400)]
agx: Defeature indirect vbufs

vb_mask can include garbage vbufs, we can't rely on it. This will
prevent a regression when switching to u_blitter based clears. This is
also simpler and shrinks the VS shader key so all in all a good thing.

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

22 months agoagx: Don't hardcode uniform enums
Alyssa Rosenzweig [Fri, 2 Sep 2022 03:01:51 +0000 (23:01 -0400)]
agx: Don't hardcode uniform enums

Let the compiler number them for us, the numbers are meaningless.

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

22 months agoagx: Add more unit tests for float copyprop
Alyssa Rosenzweig [Sat, 3 Sep 2022 02:51:47 +0000 (22:51 -0400)]
agx: Add more unit tests for float copyprop

Would have caught the bug fixed by the previous commit.

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

22 months agoagx: Fix float copyprop of neg(neg) case
Alyssa Rosenzweig [Sat, 3 Sep 2022 02:53:59 +0000 (22:53 -0400)]
agx: Fix float copyprop of neg(neg) case

They should cancel each other. Fixes:

   dEQP-GLES2.functional.shaders.random.basic_expression.combined.0

Fixes: 28801b48493 ("agx: Add forward optimizing pass for fmov")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>

22 months agoagx: Fix tib access in internal shaders
Alyssa Rosenzweig [Fri, 2 Sep 2022 00:55:30 +0000 (20:55 -0400)]
agx: Fix tib access in internal shaders

The only case where tilebuffer access can be specially optimized is the
st_tile used in internal clear (or reload) shaders. However, other
shaders (like those used with u_blitter) may have nir->info.internal
set, so we can't key off that. Instead, add a special key for this
optimization to ensure correctness with other internal shaders.

Fixes flaky tests in dEQP-GLES2.functional.color_clear.*

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

22 months agoci: set venus on lavapipe to manual due to flakes
David Heidelberg [Sat, 3 Sep 2022 20:27:51 +0000 (22:27 +0200)]
ci: set venus on lavapipe to manual due to flakes

Flakes too often, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/7093

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

22 months agoisaspec: Move isa_decode(..) declaration
Christian Gmeiner [Sat, 3 Sep 2022 09:35:00 +0000 (11:35 +0200)]
isaspec: Move isa_decode(..) declaration

The implementation of isa_decode(..) is already part of isaspec. So lets
move the function declaration and some related structs to a src/isaspec.

Also make the header C++ safe.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18403>

22 months agoutil: Include stddef.h in util/macros.h
Matt Coster [Thu, 1 Sep 2022 11:24:50 +0000 (12:24 +0100)]
util: Include stddef.h in util/macros.h

This is required for offsetof, used by the container_of macro.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18368>

22 months agoci: remove missing-braces from no-error
Thomas H.P. Andersen [Sat, 3 Sep 2022 11:22:52 +0000 (13:22 +0200)]
ci: remove missing-braces from no-error

The last warnings for missing-braces were fixed in !18307

Remove it from the no-error list on the clang build to catch regressions

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18404>

22 months agovulkan: Dirty VP_VIEWPORTS/SCISSORS when copying viewports/scissors
Jason Ekstrand [Sat, 20 Aug 2022 17:57:06 +0000 (12:57 -0500)]
vulkan: Dirty VP_VIEWPORTS/SCISSORS when copying viewports/scissors

The only reason why we didn't notice before is because ANV always
re-emits all scissors and viewports if the count changes.

Fixes: fcedb1250bb8 ("vulkan: Add a common data structure for dynamic states")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18160>

22 months agogallivm: fixes for LLVM-15 opaque pointers in lp_bld_format_soa.c
Mihai Preda [Wed, 24 Aug 2022 11:22:07 +0000 (14:22 +0300)]
gallivm: fixes for LLVM-15 opaque pointers in lp_bld_format_soa.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: fixes for LLVM-15 opaque pointers in lp_bld_struct.c
Mihai Preda [Mon, 22 Aug 2022 13:34:30 +0000 (16:34 +0300)]
gallivm: fixes for LLVM-15 opaque pointers in lp_bld_struct.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: fixes for LLVM-15 opaque pointers in lp_bld_format_s3tc.c
Mihai Preda [Sat, 20 Aug 2022 10:50:04 +0000 (13:50 +0300)]
gallivm: fixes for LLVM-15 opaque pointers in lp_bld_format_s3tc.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: fixes for LLVM-15 opaque pointers in lp_bld_jit_types.c
Mihai Preda [Tue, 16 Aug 2022 19:55:47 +0000 (22:55 +0300)]
gallivm: fixes for LLVM-15 opaque pointers in lp_bld_jit_types.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: fixes for LLVM-15 opaque pointers in lp_bld_nir_soa.c
Mihai Preda [Tue, 26 Jul 2022 13:02:52 +0000 (16:02 +0300)]
gallivm: fixes for LLVM-15 opaque pointers in lp_bld_nir_soa.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: fixes for LLVM-15 opaque pointers in lp_bld_nir_aos.c
Mihai Preda [Tue, 26 Jul 2022 12:43:30 +0000 (15:43 +0300)]
gallivm: fixes for LLVM-15 opaque pointers in lp_bld_nir_aos.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallium: drop unused macros in draw_llvm.h
Mihai Preda [Tue, 16 Aug 2022 08:11:24 +0000 (11:11 +0300)]
gallium: drop unused macros in draw_llvm.h

The reason is that these macros use lp_build_struct_get(), which is
being replaced by lp_build_structure_get2() which takes the explicit
pointer type. Rather than attempt to update these unused macros, simply drop
them.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: drop unused "emit_load" in lp_llvm_buffer_member()
Mihai Preda [Tue, 16 Aug 2022 06:44:53 +0000 (09:44 +0300)]
gallivm: drop unused "emit_load" in lp_llvm_buffer_member()

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agogallivm: LLVM-15 opaque pointers: disable LLVMGetElementType(ptr_type)
Mihai Preda [Fri, 19 Aug 2022 08:56:35 +0000 (11:56 +0300)]
gallivm: LLVM-15 opaque pointers: disable LLVMGetElementType(ptr_type)

with opaque pointers, we can't query the element type of a pointer type

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18334>

22 months agollvmpipe: fix front/back face system value in the fs
Roland Scheidegger [Sat, 27 Aug 2022 03:26:34 +0000 (05:26 +0200)]
llvmpipe: fix front/back face system value in the fs

draw needs to inject the face information for tris in line/point fill
mode since llvmpipe only sees lines and points. But for the new style
face information (which is a system value and not an ordinary input
register) we forgot to tell draw.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18285>

22 months agovulkan: fixup 1.3.226 update
Lionel Landwerlin [Fri, 2 Sep 2022 21:24:40 +0000 (00:24 +0300)]
vulkan: fixup 1.3.226 update

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18397>

22 months agoanv: remove non present field in upstream spec
Lionel Landwerlin [Fri, 2 Sep 2022 21:31:07 +0000 (00:31 +0300)]
anv: remove non present field in upstream spec

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18397>

22 months agoEnable .VALVE_mutable_descriptor_type in physical_device
Dawn Han [Wed, 31 Aug 2022 18:02:20 +0000 (18:02 +0000)]
Enable .VALVE_mutable_descriptor_type in physical_device

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>

22 months agoTrack bitset when create descriptor pool
Dawn Han [Wed, 3 Aug 2022 05:40:20 +0000 (05:40 +0000)]
Track bitset when create descriptor pool

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>

22 months agoUpdate bitset when init descriptor layout.
Dawn Han [Wed, 3 Aug 2022 05:25:59 +0000 (05:25 +0000)]
Update bitset when init descriptor layout.

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>

22 months agoIncrease enum type in vn_descriptor_set.
Dawn Han [Mon, 11 Jul 2022 22:42:35 +0000 (22:42 +0000)]
Increase enum type in vn_descriptor_set.

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17505>

22 months agoci: uprev piglit 2022-08-30
David Heidelberg [Tue, 30 Aug 2022 09:40:17 +0000 (11:40 +0200)]
ci: uprev piglit 2022-08-30

Acked-by: Juan A. Suarez <jasuarez@igalia.com> # for broadcom
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> # for zink
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18318>

22 months agoutil/perf: use ALWAYS_INLINE for tracepoints
Chia-I Wu [Fri, 2 Sep 2022 18:26:05 +0000 (11:26 -0700)]
util/perf: use ALWAYS_INLINE for tracepoints

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

22 months agoutil/perf: simplify u_trace_instrument
Chia-I Wu [Tue, 30 Aug 2022 00:25:15 +0000 (17:25 -0700)]
util/perf: simplify u_trace_instrument

When ut_perfetto_enabled changes, update _u_trace_instrument as well.
This allows u_trace_instrument to check just a single variable.

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

22 months agoutil/perf: add u_trace_instrument
Chia-I Wu [Mon, 29 Aug 2022 23:38:30 +0000 (16:38 -0700)]
util/perf: add u_trace_instrument

It is called from tracepoints.  When it returns false, instrumentation
is disabled.

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

22 months agoutil/perf: remove u_trace::enabled
Chia-I Wu [Mon, 29 Aug 2022 23:46:57 +0000 (16:46 -0700)]
util/perf: remove u_trace::enabled

We can set ut_trace_instrument when either GPU_TRACE or
GPU_TRACE_INSTRUMENT is set.  This results in one less variable to check
in tracepoints.

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

22 months agoutil/perf: ignore ut->enabled for iterators
Chia-I Wu [Tue, 30 Aug 2022 00:01:17 +0000 (17:01 -0700)]
util/perf: ignore ut->enabled for iterators

With perfetto, instrumentation can be enabled in the middle of cmd
buffer recording even when ut->enabled is false.  It might be better to
be consistent and ignore ut->enabled for iterators.

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

22 months agomesa: add GLSL_SOURCE
Mike Blumenkrantz [Mon, 22 Aug 2022 14:48:45 +0000 (10:48 -0400)]
mesa: add GLSL_SOURCE

many times I just want to dump glsl and not a trillion lines of IR

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18280>

22 months agoanv: enable EXT_mesh_shader
Marcin Ślusarz [Sat, 30 Apr 2022 11:10:22 +0000 (13:10 +0200)]
anv: enable EXT_mesh_shader

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18371>

22 months agoanv: implement draw calls for EXT_mesh_shader
Marcin Ślusarz [Sat, 30 Apr 2022 11:09:53 +0000 (13:09 +0200)]
anv: implement draw calls for EXT_mesh_shader

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18371>

22 months agoanv: implement EXT_mesh_shader
Marcin Ślusarz [Sat, 30 Apr 2022 11:07:57 +0000 (13:07 +0200)]
anv: implement EXT_mesh_shader

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18371>

22 months agoanv: replace VK_SHADER_STAGE_[TASK|MESH]_BIT_NV with VK_SHADER_STAGE_[TASK|MESH]_BIT_EXT
Marcin Ślusarz [Sun, 8 May 2022 00:24:48 +0000 (02:24 +0200)]
anv: replace VK_SHADER_STAGE_[TASK|MESH]_BIT_NV with VK_SHADER_STAGE_[TASK|MESH]_BIT_EXT

They have the same numerical values, so nothing changes.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18371>

22 months agoanv: check EXT_mesh_shader whenever NV_mesh_shader is checked
Marcin Ślusarz [Sun, 8 May 2022 00:19:35 +0000 (02:19 +0200)]
anv: check EXT_mesh_shader whenever NV_mesh_shader is checked

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18371>

22 months agointel/compiler: implement EXT_mesh_shader
Marcin Ślusarz [Sat, 30 Apr 2022 11:06:42 +0000 (13:06 +0200)]
intel/compiler: implement EXT_mesh_shader

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18371>

22 months agoturnip: Treating non-d/s-write pipelines as not having d/s feedback loops.
Emma Anholt [Wed, 24 Aug 2022 22:34:26 +0000 (15:34 -0700)]
turnip: Treating non-d/s-write pipelines as not having d/s feedback loops.

A subpass in gfxbench has the depth buffer present, but not written to,
for a render pass using the depth buffer as an input attachment.  We can
skip single-prim-mode and the associated "oh no don't use sysmem" in that
case.

Improves gfxbench vk-5-normal perf by 1.56193% +/- 0.0743035% (n=14).
Part of #6327.

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

22 months agospirv, compiler: add "bool nv" to shader_info.mesh
Marcin Ślusarz [Tue, 7 Jun 2022 11:03:24 +0000 (13:03 +0200)]
spirv, compiler: add "bool nv" to shader_info.mesh

Not knowing whether we deal with the NV or EXT extension
makes implementation difficult for Intel HW.
NV support will be dropped at some point, so
this ugliness will go away eventually.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv, nir: Handle EmitMeshTasksEXT opcode.
Timur Kristóf [Sat, 19 Feb 2022 11:37:06 +0000 (12:37 +0100)]
spirv, nir: Handle EmitMeshTasksEXT opcode.

A task shader must use this instruction to specify the dimensions
of the launched mesh shader workgroups.
It is a terminating instruction.

When the task shader doesn't have the optional payload, use the
pre-existing launch_mesh_workgroups intrinsics.

When the task shader has a payload, use a new
launch_mesh_workgroups_with_payload_deref intrinsics which has
a deref that refers to the payload variable.

We also add this new intrinsic to nir_lower_io which lowers this
to the pre-existing explicit intrinsic.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv: Support TaskPayloadWorkgroupEXT storage class.
Timur Kristóf [Sat, 19 Feb 2022 11:31:18 +0000 (12:31 +0100)]
spirv: Support TaskPayloadWorkgroupEXT storage class.

Just use the task_payload NIR storage class for this.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv: Support the CullPrimitiveEXT mesh shader built-in.
Timur Kristóf [Fri, 21 Jan 2022 18:38:13 +0000 (19:38 +0100)]
spirv: Support the CullPrimitiveEXT mesh shader built-in.

This is a per-primitive builtin output which indicates that a
primitive should be culled (deleted) from the output.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv: Support EXT_mesh_shader SetMeshOutputsEXT.
Timur Kristóf [Thu, 20 Jan 2022 15:35:23 +0000 (16:35 +0100)]
spirv: Support EXT_mesh_shader SetMeshOutputsEXT.

Use the set_vertex_and_primitive_count intrinsic to
express the number of vertices and primitives that the
mesh shader workgroup outputs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv: Support EXT_mesh_shader mesh/task stages.
Timur Kristóf [Thu, 20 Jan 2022 15:35:01 +0000 (16:35 +0100)]
spirv: Support EXT_mesh_shader mesh/task stages.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv: Add mesh_shading capability for EXT_mesh_shader.
Timur Kristóf [Thu, 20 Jan 2022 15:34:37 +0000 (16:34 +0100)]
spirv: Add mesh_shading capability for EXT_mesh_shader.

Indicates support for the EXT_mesh_shader SPIR-V capabilities.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agospirv: Support EXT_mesh_shader indices and mark them per-primitive.
Timur Kristóf [Thu, 20 Jan 2022 15:33:27 +0000 (16:33 +0100)]
spirv: Support EXT_mesh_shader indices and mark them per-primitive.

They are not defined as per-primitive in the EXT, but they behave
like per-primitive outputs so it's easier to treat them like that.
They may still require special treatment in the backend in order to
control where and how they are stored.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18366>

22 months agovulkan, spirv: Update to Vulkan 1.3.226 and latest SPIR-V headers.
Timur Kristóf [Fri, 2 Sep 2022 07:38:15 +0000 (09:38 +0200)]
vulkan, spirv: Update to Vulkan 1.3.226 and latest SPIR-V headers.

Done using the "khronos-update.py" script, leaving out parts that
are not relevant to Vulkan.

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

22 months agopan/bi: Add and use bi_num_successors helper
Alyssa Rosenzweig [Thu, 28 Jul 2022 15:07:46 +0000 (11:07 -0400)]
pan/bi: Add and use bi_num_successors helper

Makes a few patterns easier to read.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Add and use bi_replace_src helper
Alyssa Rosenzweig [Tue, 26 Jul 2022 17:35:34 +0000 (13:35 -0400)]
pan/bi: Add and use bi_replace_src helper

This is a common pattern. Make it more ergonomic. With the help of Coccinelle:

   @@
   expression E;
   expression R;
   expression instruction;
   @@

   -instruction->src[E] = bi_replace_index(instruction->src[E], R);
   +bi_replace_src(instruction, E, R);

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Remove assert(bi_is_ssa(dest))
Alyssa Rosenzweig [Tue, 26 Jul 2022 16:27:27 +0000 (12:27 -0400)]
pan/bi: Remove assert(bi_is_ssa(dest))

Prior to register allocation, destinations must be in SSA form, except for the
"fake SSA" briefly used in the current RA (for which bi_is_ssa returns true
anyway). These asserts duplicate the asserts in the validator. If there's any
coverage lost here, that's just a sign the validator needs to run more often.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Strengenth assert in the validator
Alyssa Rosenzweig [Tue, 26 Jul 2022 16:25:19 +0000 (12:25 -0400)]
pan/bi: Strengenth assert in the validator

We should only see SSA now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Add and use bi_foreach_ssa_src macro
Alyssa Rosenzweig [Tue, 26 Jul 2022 16:22:34 +0000 (12:22 -0400)]
pan/bi: Add and use bi_foreach_ssa_src macro

Frequently, we want to iterate over the SSA variables read by an instruction,
while skipping over constants and uniforms. Add and use a macro for this
pattern. A few redundant asserts are removed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Simplify bi_get_index prototype
Alyssa Rosenzweig [Tue, 26 Jul 2022 15:52:29 +0000 (11:52 -0400)]
pan/bi: Simplify bi_get_index prototype

2/3 of its arguments are now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Remove bi_max_temp
Alyssa Rosenzweig [Mon, 25 Jul 2022 20:05:22 +0000 (16:05 -0400)]
pan/bi: Remove bi_max_temp

This is no longer needed given the flat indexing.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Inline node_to_index
Alyssa Rosenzweig [Mon, 25 Jul 2022 20:03:08 +0000 (16:03 -0400)]
pan/bi: Inline node_to_index

One user, now trivial.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Get rid of bi_get_node
Alyssa Rosenzweig [Mon, 25 Jul 2022 20:02:03 +0000 (16:02 -0400)]
pan/bi: Get rid of bi_get_node

Now that variables have flat naming (no more SSA/reg distinction), we can just
use .value directly. This cleans up the RA a bit.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Remove NIR registers from the IR
Alyssa Rosenzweig [Mon, 25 Jul 2022 20:48:53 +0000 (16:48 -0400)]
pan/bi: Remove NIR registers from the IR

They are now unused, so normal == SSA at this point.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

22 months agopan/bi: Move non-SSA liveness into RA
Alyssa Rosenzweig [Mon, 25 Jul 2022 19:19:01 +0000 (15:19 -0400)]
pan/bi: Move non-SSA liveness into RA

Now that non-SSA nodes are an internal implementation detail of RA, the
entrypoints should be made private to make sure no other passes use the
RA-specific liveness analysis.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>