platform/upstream/mesa.git
16 months agoagx: Disable tri merging with side effects
Alyssa Rosenzweig [Sun, 19 Feb 2023 20:30:10 +0000 (15:30 -0500)]
agx: Disable tri merging with side effects

As Metal does.

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

16 months agocrocus/meson: add dependency on libintel_dev also for versioned static libraries
David Heidelberg [Sat, 4 Mar 2023 16:20:15 +0000 (17:20 +0100)]
crocus/meson: add dependency on libintel_dev also for versioned static libraries

Fixes: a0fa31bcdd8 ("intel/dev: create a helper dependency for libintel_dev")

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21709>

16 months agovk/runtime: Use libdrm shim
Rob Clark [Wed, 1 Mar 2023 19:24:06 +0000 (11:24 -0800)]
vk/runtime: Use libdrm shim

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>

16 months agoloader: Use libdrm shim
Rob Clark [Wed, 1 Mar 2023 19:20:26 +0000 (11:20 -0800)]
loader: Use libdrm shim

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>

16 months agoturnip: Use libdrm shim
Rob Clark [Wed, 1 Mar 2023 00:10:13 +0000 (16:10 -0800)]
turnip: Use libdrm shim

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>

16 months agoutil: Add a simple no-op libdrm shim
Rob Clark [Wed, 1 Mar 2023 00:09:29 +0000 (16:09 -0800)]
util: Add a simple no-op libdrm shim

Make it easier to deal with build configs that do not have libdrm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>

16 months agoci/freedreno: rare flake KHR-GL45.sample_variables.mask.rgba8i.samples_4.mask_3
David Heidelberg [Sun, 5 Mar 2023 14:30:37 +0000 (15:30 +0100)]
ci/freedreno: rare flake KHR-GL45.sample_variables.mask.rgba8i.samples_4.mask_3

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

16 months agoci/lavapipe: add recent occasional flake
David Heidelberg [Sun, 5 Mar 2023 13:32:58 +0000 (14:32 +0100)]
ci/lavapipe: add recent occasional flake

Issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8441

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

16 months agor600/sfn: Fix atomic lowering
Gert Wollny [Fri, 3 Mar 2023 11:16:40 +0000 (12:16 +0100)]
r600/sfn: Fix atomic lowering

Fixes: 56dedf052f4af1903a0d312eb9c7721c69f36c69
  r600/sfn: add r600 specific lowering pass for atomics and use it

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

16 months agor600/sfn/tests: Add a test for the copy prop into a group
Gert Wollny [Tue, 28 Feb 2023 16:55:13 +0000 (17:55 +0100)]
r600/sfn/tests: Add a test for the copy prop into a group

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

16 months agor600/sfn: redirect copy propagation to alu parent group
Gert Wollny [Tue, 28 Feb 2023 16:54:46 +0000 (17:54 +0100)]
r600/sfn: redirect copy propagation to alu parent group

If an ALU instruction was emitted from the get-go as group, then
we have to make sure that replacing a source doesn't violate the
readport configuration in the group.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

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

16 months agor600/sfn: Add print method to AluReadportValidation
Gert Wollny [Tue, 28 Feb 2023 16:52:45 +0000 (17:52 +0100)]
r600/sfn: Add print method to AluReadportValidation

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

16 months agor600/sfn: Add method to AluGroup to replace sources
Gert Wollny [Tue, 28 Feb 2023 16:50:47 +0000 (17:50 +0100)]
r600/sfn: Add method to AluGroup to replace sources

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

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

16 months agor600/sfn: Split AluInstr replace_source into test and actual replace
Gert Wollny [Tue, 28 Feb 2023 16:52:12 +0000 (17:52 +0100)]
r600/sfn: Split AluInstr replace_source into test and actual replace

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

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

16 months agor600/sfn: Add AluGroup method to update readport validation from scratch
Gert Wollny [Tue, 28 Feb 2023 15:22:34 +0000 (16:22 +0100)]
r600/sfn: Add AluGroup method to update readport validation from scratch

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

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

16 months agoasahi/meta: Use lowered I/O
Alyssa Rosenzweig [Mon, 20 Feb 2023 01:00:39 +0000 (20:00 -0500)]
asahi/meta: Use lowered I/O

No point in creating a variable when we can just synthesize the store_output
directly.

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

16 months agoasahi: Bump shader buffers
Alyssa Rosenzweig [Sat, 18 Feb 2023 21:21:41 +0000 (16:21 -0500)]
asahi: Bump shader buffers

No reason to limit it, it's direct access anyway.

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

16 months agoagx: Only lower int64 late
Alyssa Rosenzweig [Tue, 28 Feb 2023 21:50:01 +0000 (16:50 -0500)]
agx: Only lower int64 late

This is required for address arithmetic to be lowered properly for compute
kernels, which may have u2u64 in the source NIR.

No shader-db changes (for GLES3.0).

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

16 months agoagx: Don't print pre-optimization shader
Alyssa Rosenzweig [Sun, 19 Feb 2023 17:48:29 +0000 (12:48 -0500)]
agx: Don't print pre-optimization shader

It's usually too noisy to be useful, especially before DCE. The optimized (but
pre-RA) shader is usually the useful bit.

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

16 months agoagx: Use agx_emit_collect for st_tile
Alyssa Rosenzweig [Thu, 16 Feb 2023 16:01:18 +0000 (11:01 -0500)]
agx: Use agx_emit_collect for st_tile

Instead of open coding.

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

16 months agoagx: Refactor vector creation
Alyssa Rosenzweig [Wed, 15 Feb 2023 04:54:30 +0000 (23:54 -0500)]
agx: Refactor vector creation

agx_vec4 is unused, drop in, and split out the common logic since we'll use it
in a new helper.

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

16 months agoagx: Constify agx_print
Alyssa Rosenzweig [Sun, 19 Feb 2023 01:48:22 +0000 (20:48 -0500)]
agx: Constify agx_print

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

16 months agoagx: Inline 16-bit load/store offsets
Alyssa Rosenzweig [Sat, 18 Feb 2023 22:06:16 +0000 (17:06 -0500)]
agx: Inline 16-bit load/store offsets

Most integer immediates are only 8-bit, but load/store instructions allow their
immediate offsets to be 16-bit instead. Take advantage of this in the optimizer.
This eliminates 36% of the instructions in
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.36, a fitting
percentage.

Insignificant effect on dEQP-GLES31.functional.ssbo.* performance... Only a
small % of our compile-time pie is actually spent in the backend anyway (as
opposed to NIR passes or GLSL IR).

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

16 months agoagx: Factor out allows_16bit_immediate check
Alyssa Rosenzweig [Sat, 18 Feb 2023 22:05:57 +0000 (17:05 -0500)]
agx: Factor out allows_16bit_immediate check

The optimizer needs this information to inline immediates effectively.

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

16 months agoagx: Clean up after lowering address arithmetic
Alyssa Rosenzweig [Wed, 15 Feb 2023 05:02:14 +0000 (00:02 -0500)]
agx: Clean up after lowering address arithmetic

This avoids creating silly preambles that don't actually do anything except push
a constant that we could've inlined for cheaper anyway, since nir_opt_preamble's
cost model is sensitive to e.g. constant folding.

This avoids a pointless preamble in split-hell.

As a nice bonus, this also improves compile-time on address-heavy shaders. With
a release build, CPU time in dEQP-GLES31.functional.ssbo.* reduces from 12.87s
to 10.77... a 16% improvement is nothing to sneeze at.

shader-db results are mostly noise.

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

16 months agoagx: Add AGX_MESA_DEBUG=nopreamble option
Alyssa Rosenzweig [Wed, 15 Feb 2023 04:38:58 +0000 (23:38 -0500)]
agx: Add AGX_MESA_DEBUG=nopreamble option

Useful both for ruling out issues with shader preambles as well as (in some
cases) making for a nicer reading experience of the compiled assembly.

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

16 months agoagx: Don't write sample mask from preambles
Alyssa Rosenzweig [Sat, 4 Mar 2023 16:43:04 +0000 (11:43 -0500)]
agx: Don't write sample mask from preambles

It doesn't make sense, they're basically little compute kernel environments.
Noticed while debugging dEQP-GLES31.functional.fbo.no_attachments.multisample.*

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

16 months agoasahi: Mark PIPE_FORMAT_NONE "supported"
Alyssa Rosenzweig [Sat, 4 Mar 2023 16:36:41 +0000 (11:36 -0500)]
asahi: Mark PIPE_FORMAT_NONE "supported"

Kinda silly but fixes
dEQP-GLES31.functional.state_query.integer.max_framebuffer_samples_* which
queries the number of samples of a NONE format, required for
ARB_framebuffer_no_attachments to make sense.

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

16 months agoagx: Fix 2D MSAA array texture register allocation
Alyssa Rosenzweig [Sat, 4 Mar 2023 16:21:57 +0000 (11:21 -0500)]
agx: Fix 2D MSAA array texture register allocation

Sample index and layer index are both 16-bits, even though they are zero
extended for compiler simplicity in some cases. In particular this means that 2D
MSAA arrays consume 6 half-regs for their coordinates, not 8. This is what the
IR translation (actually agx_nir_lower_texture) produces, we just need to fix
the calculation in agx_read_registers to agree.

Fixes validation failure in tests like
dEQP-GLES31.functional.texture.multisample.samples_4.use_texture_color_2d_array

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

16 months agoagx: Mask shifts in the backend
Alyssa Rosenzweig [Sun, 29 Jan 2023 18:29:32 +0000 (13:29 -0500)]
agx: Mask shifts in the backend

This gives our shifts SM5 behaviour at the cost of a little extra ALU. That way,
we match NIR's shifts.

This fixes unsoundness of GLSL expressions like "a << (b & 31)", where the &
would mistakenly get optimized away.

Closes: #8181
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21673>

16 months agoasahi: Advertise dual-source blending
Alyssa Rosenzweig [Sun, 26 Feb 2023 22:26:34 +0000 (17:26 -0500)]
asahi: Advertise dual-source blending

This is handled entirely in common code.

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

16 months agowsi/display: check alloc failure in wsi_display_alloc_connector()
Yogesh Mohan Marimuthu [Sat, 4 Mar 2023 05:09:15 +0000 (10:39 +0530)]
wsi/display: check alloc failure in wsi_display_alloc_connector()

vulkancts test dEQP-VK.wsi.direct_drm.surface.create_simulate_oom is failing
because in wsi_display_alloc_connector() function memory allocation for
connector is not checked for return NULL. create_simulate_oom test simulates
out of memory, hence memory allocation fails for connector and later when
tried to dereference connector program will segfault.

This patch fixes the dEQP-VK.wsi.direct_drm.surface.create_simulate_oom test
segfault issue by checking if connector is NULL afer memory allocation.

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21701>

16 months agofreedreno/a6xx: Fix mirror x/y blits
Rob Clark [Sat, 4 Mar 2023 17:31:28 +0000 (09:31 -0800)]
freedreno/a6xx: Fix mirror x/y blits

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

16 months agofreedreno/a6xx: Convert blitter to OUT_REG()
Rob Clark [Sat, 4 Mar 2023 16:00:49 +0000 (08:00 -0800)]
freedreno/a6xx: Convert blitter to OUT_REG()

We'll need this to add a7xx support, since some of the regs are
different btwn a6xx and a7xx and reg variants are not supported with
the legacy reg builders.

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

16 months agofreedreno/a6xx: Namespace reg/pkt packer vars
Rob Clark [Sat, 4 Mar 2023 15:48:54 +0000 (07:48 -0800)]
freedreno/a6xx: Namespace reg/pkt packer vars

Otherwise they could conflict with parameters to the reg/pkt.

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

16 months agopan/mdg: Use nir_lower_helper_writes
Alyssa Rosenzweig [Mon, 20 Feb 2023 19:17:12 +0000 (14:17 -0500)]
pan/mdg: Use nir_lower_helper_writes

It's now in common code, drop our (buggier) copy.

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

16 months agonir: Add nir_lower_helper_writes pass
Alyssa Rosenzweig [Mon, 20 Feb 2023 19:16:05 +0000 (14:16 -0500)]
nir: Add nir_lower_helper_writes pass

This NIR pass lowers stores in fragment shaders to:

   if (!gl_HelperInvocaton) {
      store();
   }

This implements the API requirement that helper invocations do not have visible
side effects, and the lowering is required on any hardware that cannot directly
mask helper invocation's side effects. The pass was originally written for
Midgard (which has this issue) but is also needed for Asahi. Let's share the
code, and fix it while we're at it.

Changes from the Midgard pass:

1. Add an option to only lower atomics.

   AGX hardware can mask helper invocations for "plain" stores but not for
   atomics.  Accordingly, the AGX compiler wants this lowering for atomics but
   not store_global. By contrast, Midgard cannot mask any stores and needs the
   lowering for all store intrinsics. Add an option to the common pass to
   accommodate both cases.

   This is an optimization for AGX. It is not required for correctness, this
   lowering is always legal.

2. Fix dominance issues.

   It's invalid to have NIR like

      if ... {
         ssa_1 = ...
      }

      foo ssa_1

   Instead we need to rewrite as

      if ... {
         ssa_1 = ...
      } else {
         ssa_2 = undef
      }
      ssa_3 = phi ssa_1, ssa_2

      foo ssa_3

   By default, neither nir_validate nor the backends check this, so this doesn't
   currently fix a (known) real bug. But it's still invalid and fails validation
   with NIR_DEBUG=validate_ssa_dominance.

   Fix this in lower_helper_writes for intrinsics that return data (atomics).

3. Assert that the pass is run only for fragment shaders. This encourages
   backends to be judicious about which passes they call instead of just
   throwing everything in a giant lower everything spaghetti.

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

16 months agoasahi: Assert on TIB strides > 64
Asahi Lina [Fri, 3 Mar 2023 17:56:54 +0000 (02:56 +0900)]
asahi: Assert on TIB strides > 64

These just don't seem to work. macOS falls back to eMRT here...

dEQP-GLES3.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.13
from Fail -> Crash. Proper solution will come when we implement eMRT later on.

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

16 months agonir/range_analysis: fix vectorized phis and intrinsics
Rhys Perry [Fri, 10 Feb 2023 16:24:22 +0000 (16:24 +0000)]
nir/range_analysis: fix vectorized phis and intrinsics

Found by inspection.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21288>

16 months agovk: be stricter about symbols check between android and other platforms
Eric Engestrom [Wed, 1 Mar 2023 17:15:26 +0000 (17:15 +0000)]
vk: be stricter about symbols check between android and other platforms

Don't allow HMI on non-Android, don't allow non-HMI on Android, and
don't allow missing HMI on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agoandroid/vk: drop unnecessary symbols
Eric Engestrom [Thu, 2 Mar 2023 17:36:24 +0000 (17:36 +0000)]
android/vk: drop unnecessary symbols

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agovn: add linker script to fix android symbols
Eric Engestrom [Fri, 3 Mar 2023 18:24:55 +0000 (18:24 +0000)]
vn: add linker script to fix android symbols

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agoanv: add linker script to fix android symbols
Eric Engestrom [Fri, 3 Mar 2023 17:04:41 +0000 (17:04 +0000)]
anv: add linker script to fix android symbols

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agotu: add linker script to fix android symbols
Eric Engestrom [Fri, 3 Mar 2023 16:42:06 +0000 (16:42 +0000)]
tu: add linker script to fix android symbols

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agov3dv: add linker script to fix android symbols
Eric Engestrom [Fri, 3 Mar 2023 16:41:58 +0000 (16:41 +0000)]
v3dv: add linker script to fix android symbols

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agovk: move radv's linker symbols scripts for use in all drivers
Eric Engestrom [Fri, 3 Mar 2023 16:40:57 +0000 (16:40 +0000)]
vk: move radv's linker symbols scripts for use in all drivers

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>

16 months agoanv: VK_EXT_image_sliced_view_of_3d
Lionel Landwerlin [Fri, 17 Feb 2023 08:03:38 +0000 (10:03 +0200)]
anv: VK_EXT_image_sliced_view_of_3d

Signed-off-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/21376>

16 months agoisl: Set Depth to array len for 3D storage images
Faith Ekstrand [Tue, 28 Feb 2023 17:16:06 +0000 (11:16 -0600)]
isl: Set Depth to array len for 3D storage images

This is necessary for RESINFO to work properly.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>

16 months agointel/blorp: Set array_len for 3D images properly
Faith Ekstrand [Tue, 28 Feb 2023 17:14:36 +0000 (11:14 -0600)]
intel/blorp: Set array_len for 3D images properly

We need to minify the depth so we don't set a size that's out-of-bounds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>

16 months agovulkan/runtime: only consider slice info with 3D image views
Lionel Landwerlin [Fri, 3 Mar 2023 10:50:45 +0000 (12:50 +0200)]
vulkan/runtime: only consider slice info with 3D image views

Because we can have 2D views of 3D images, we want to consider the
slice info only with 3D *image views*.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 66e3ccbcac ("vulkan/runtime: store parameters of VK_EXT_sliced_view_of_3d")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>

16 months agovulkan/runtime: Rename and document storage image Z range
Faith Ekstrand [Fri, 3 Mar 2023 17:36:36 +0000 (11:36 -0600)]
vulkan/runtime: Rename and document storage image Z range

This makes it more clear that the fields specifically apply to the Z
range and aren't array slices.

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

16 months agovenus: shader cache fossilize replay fix
Juston Li [Thu, 2 Mar 2023 18:40:03 +0000 (10:40 -0800)]
venus: shader cache fossilize replay fix

venus utilizes the host side shader cache.

This is a WA to generate shader cache files containing headers with
a unique cache id that will change based on host driver identifiers.
This allows fossilize replay to detect if the host side shader cache
is no longer up to date.
The shader cache is destroyed after creating the necessary files and
not utilized by venus.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21664>

16 months agoci/zink: add skip for the Single-GL46.enhanced_layouts.ssb_member_align_non_power_of_2
David Heidelberg [Sat, 4 Mar 2023 00:03:25 +0000 (01:03 +0100)]
ci/zink: add skip for the Single-GL46.enhanced_layouts.ssb_member_align_non_power_of_2

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>

16 months agoci: Retry, retry, retry... No one likes to trigger Marge more than once.
David Heidelberg [Fri, 3 Mar 2023 19:26:52 +0000 (20:26 +0100)]
ci: Retry, retry, retry... No one likes to trigger Marge more than once.

Sadly, have to decrease retry attempts from 2 to 1 for `runner_system_failure` since it's not doable while keeping one attempt for every other failure.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>

16 months agoci: deqp-runner: drop already unused function
David Heidelberg [Thu, 2 Mar 2023 22:29:49 +0000 (23:29 +0100)]
ci: deqp-runner: drop already unused function

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

16 months agoci: make meson build and test uncollapsed
David Heidelberg [Thu, 2 Mar 2023 22:15:45 +0000 (23:15 +0100)]
ci: make meson build and test uncollapsed

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8419

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

16 months agod3d12: VP9 Decode - Fix use_prev_in_find_mvs_refs calculation
Sil Vilerino [Fri, 3 Mar 2023 18:00:57 +0000 (13:00 -0500)]
d3d12: VP9 Decode - Fix use_prev_in_find_mvs_refs calculation

Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>

16 months agofrontend/va: Keep track of some VP9 previous frame data for current frame use_prev_in...
Sil Vilerino [Fri, 3 Mar 2023 18:00:25 +0000 (13:00 -0500)]
frontend/va: Keep track of some VP9 previous frame data for current frame use_prev_in_find_mvs_refs

Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>

16 months agoradv/rt: Use ushr for extracting the cull mask
Konstantin Seurer [Thu, 2 Mar 2023 16:21:13 +0000 (17:21 +0100)]
radv/rt: Use ushr for extracting the cull mask

Fixes the following tests:
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.ahit.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.ahit.16_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.chit.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.chit.16_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.isec.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.isec.16_bits

Fixes: 2d93ab7 ("radv/rt: Pre shift cull_mask")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21659>

16 months agoutil: Add util_format_get_array.
Timur Kristóf [Fri, 17 Feb 2023 19:14:00 +0000 (20:14 +0100)]
util: Add util_format_get_array.

This is a poor man's version of MESA_ARRAY_FORMAT.
Implemented based on a gigantic switch-case
with some help from the C preprocessor.
Thank you, preprocessor!

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21692>

16 months agoasahi: clang-format the world again
Asahi Lina [Fri, 3 Mar 2023 13:01:45 +0000 (22:01 +0900)]
asahi: clang-format the world again

Some things were missed (like winsys) and there's still some bad include
orders lying around and some other randomness.

We should set up CI checks for this soon... ^^;;

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

16 months agointel/vk/grl: genX-ify grl_cl_kernel_name()
Jordan Justen [Wed, 1 Feb 2023 02:37:36 +0000 (18:37 -0800)]
intel/vk/grl: genX-ify grl_cl_kernel_name()

I don't see any code calling this, but with multiple gens, the symbol
name would conflict.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>

16 months agointel/vk/grl: genX-ify genX_grl_uuid.cpp
Jordan Justen [Tue, 31 Jan 2023 23:10:17 +0000 (15:10 -0800)]
intel/vk/grl: genX-ify genX_grl_uuid.cpp

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>

16 months agointel/vk/grl: Allow grl/grl_cl_kernel.h to be included by C++ files
Jordan Justen [Tue, 31 Jan 2023 23:56:17 +0000 (15:56 -0800)]
intel/vk/grl: Allow grl/grl_cl_kernel.h to be included by C++ files

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>

16 months agointel/vk/grl: Allow genX_grl.h to be included by C++ files
Jordan Justen [Tue, 31 Jan 2023 23:52:26 +0000 (15:52 -0800)]
intel/vk/grl: Allow genX_grl.h to be included by C++ files

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>

16 months agointel/vk/grl: Don't include anv_private.h in genX_grl.h
Jordan Justen [Tue, 31 Jan 2023 23:40:42 +0000 (15:40 -0800)]
intel/vk/grl: Don't include anv_private.h in genX_grl.h

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>

16 months agoasahi/winsys: add .clang-format
Eric Engestrom [Fri, 3 Mar 2023 18:14:23 +0000 (18:14 +0000)]
asahi/winsys: add .clang-format

Copied from src/asahi/.clang-format

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21691>

16 months agoasahi: Destroy the renderonly context on screen destroy
Asahi Lina [Fri, 3 Mar 2023 07:11:25 +0000 (16:11 +0900)]
asahi: Destroy the renderonly context on screen destroy

This fixes an fd leak due to leaving behind the dup'd renderonly fd.

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

16 months agoasahi: Fix device fd leak in agx_close_device
Asahi Lina [Fri, 3 Mar 2023 07:03:36 +0000 (16:03 +0900)]
asahi: Fix device fd leak in agx_close_device

I'm not sure if this was always broken downstream or just got dropped at
some point, but it's definitely UAPI-agnostic and missing now that we
have all the non-UAPI bits upstream.

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

16 months agoasahi/decode: Handle VDM barriers
Alyssa Rosenzweig [Sat, 25 Feb 2023 16:21:37 +0000 (11:21 -0500)]
asahi/decode: Handle VDM barriers

We emit these now (for transform feedback).

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

16 months agodocs/feature: Mark ARB_sync as done on Asahi
Alyssa Rosenzweig [Wed, 15 Feb 2023 20:09:07 +0000 (15:09 -0500)]
docs/feature: Mark ARB_sync as done on Asahi

Strictly, this extension was already advertised, but it didn't seem nice to mark
it DONE when there was no sync support in the driver whatsoever. Mark it done
now that we do have proper explicit sync (well, in conjunction with the "add
Linux UAPI" patches that are blocked on getting the kernel driver upstream, but
that's needed for *any* of these extensions to be there!)

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

16 months agoradv: Emulate VGT_ESGS_ITEMSIZE in shaders on GFX9+.
Timur Kristóf [Mon, 20 Feb 2023 23:30:21 +0000 (00:30 +0100)]
radv: Emulate VGT_ESGS_ITEMSIZE in shaders on GFX9+.

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

16 months agoaco: make IDSet sparse
Rhys Perry [Tue, 31 Jan 2023 16:15:50 +0000 (16:15 +0000)]
aco: make IDSet sparse

Improves compilation time of huge shaders.

A ray tracing pipeline of Hellblade: Senua's Sacrifice compiles in about
half the time, with this patch.

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

16 months agoasahi: Fix scissor culling check when out of bounds for FB/viewport
Asahi Lina [Fri, 3 Mar 2023 08:15:54 +0000 (17:15 +0900)]
asahi: Fix scissor culling check when out of bounds for FB/viewport

Fixes a bunch of the `assert(maxx > minx && maxy > miny)` failures in
dEQP-EGL and probably others.

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

16 months agoasahi: Do not overread user index buffers
Asahi Lina [Fri, 3 Mar 2023 12:35:56 +0000 (21:35 +0900)]
asahi: Do not overread user index buffers

We need to align the extent to 4 for the GPU, but we can't copy more
than the original size out of the user buffer. Always alloc the exact
size we need.

This does mean the GPU gets an IB extent that could include some other
stuff later in the pool, if not aligned. This is probably safe? Given
the base alignment, it should never cross a page boundary and fault or
anything like that.

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

16 months agoiris: Add iris_bo_set_caching()
José Roberto de Souza [Fri, 21 Oct 2022 15:58:11 +0000 (08:58 -0700)]
iris: Add iris_bo_set_caching()

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21688>

16 months agoiris: Move iris_bo_madvise() to i915/iris_bufmgr.c
José Roberto de Souza [Fri, 21 Oct 2022 14:19:59 +0000 (07:19 -0700)]
iris: Move iris_bo_madvise() to i915/iris_bufmgr.c

Start to split functions that are not in hot paths to specific i915
files.

Also making it static as iris_bo_madvise() is only called from
iris_bufmgr.c and adding a enum iris_madvice to be used among all
backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21688>

16 months agoaco/tests: add tests for v_fma_f32 with 2 fp16 literals
Rhys Perry [Wed, 1 Mar 2023 17:57:07 +0000 (17:57 +0000)]
aco/tests: add tests for v_fma_f32 with 2 fp16 literals

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21633>

16 months agoblorp: add dependency on idep_intel_dev
Lionel Landwerlin [Fri, 3 Mar 2023 09:36:55 +0000 (11:36 +0200)]
blorp: add dependency on idep_intel_dev

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8421
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21679>

16 months agocrocus/meson: add back dependency on libintel_dev
Marcin Ślusarz [Fri, 3 Mar 2023 10:53:52 +0000 (11:53 +0100)]
crocus/meson: add back dependency on libintel_dev

Fixes: a0fa31bcdd8 ("intel/dev: create a helper dependency for libintel_dev")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21679>

16 months agoanv: add gfx9 generated draw support
Lionel Landwerlin [Sun, 1 Jan 2023 22:58:46 +0000 (00:58 +0200)]
anv: add gfx9 generated draw support

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: remove unused item_count parameter
Lionel Landwerlin [Mon, 2 Jan 2023 16:26:03 +0000 (18:26 +0200)]
anv: remove unused item_count parameter

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

16 months agoanv: use a list of generated shaders
Lionel Landwerlin [Sun, 1 Jan 2023 22:42:59 +0000 (00:42 +0200)]
anv: use a list of generated shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: move common shader code into header
Lionel Landwerlin [Sun, 1 Jan 2023 19:08:04 +0000 (21:08 +0200)]
anv: move common shader code into header

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: pack more data into generated draws input
Lionel Landwerlin [Sat, 31 Dec 2022 17:00:34 +0000 (19:00 +0200)]
anv: pack more data into generated draws input

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: use 64bit int support in generation shaders
Lionel Landwerlin [Sat, 31 Dec 2022 14:16:15 +0000 (16:16 +0200)]
anv: use 64bit int support in generation shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: rename generated draws for Gfx11
Lionel Landwerlin [Fri, 30 Dec 2022 12:12:29 +0000 (14:12 +0200)]
anv: rename generated draws for Gfx11

We'll need different shaders for Gfx9

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: use a single generation shader for indirect draws
Lionel Landwerlin [Mon, 2 Jan 2023 00:01:48 +0000 (02:01 +0200)]
anv: use a single generation shader for indirect draws

The indirect draw count shader can be used as a more generic case of
the indirect draw one. We'll never enter the last condition of the
shader (writing the MI_BATCH_BUFFER_START) with non count variants of
draws.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: remove MI_NOOPs at the end of the generation batch
Lionel Landwerlin [Thu, 5 Jan 2023 17:55:34 +0000 (19:55 +0200)]
anv: remove MI_NOOPs at the end of the generation batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: make sure mi_memcpy lands before push constant loads
Lionel Landwerlin [Thu, 5 Jan 2023 17:38:22 +0000 (19:38 +0200)]
anv: make sure mi_memcpy lands before push constant loads

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e2dc32d755 ("anv: move functions around to plan for generated draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: fix indirect draws VF cache tracking of index buffer
Lionel Landwerlin [Thu, 5 Jan 2023 15:30:19 +0000 (17:30 +0200)]
anv: fix indirect draws VF cache tracking of index buffer

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e2dc32d755 ("anv: move functions around to plan for generated draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: fix 3DSTATE_PS emission in generation shaders
Lionel Landwerlin [Tue, 3 Jan 2023 00:50:54 +0000 (02:50 +0200)]
anv: fix 3DSTATE_PS emission in generation shaders

We have to use the helper and also were missing the vector mask
programming.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: remove commented code
Lionel Landwerlin [Mon, 2 Jan 2023 23:01:19 +0000 (01:01 +0200)]
anv: remove commented code

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: remove pre hasvk split assert
Lionel Landwerlin [Mon, 2 Jan 2023 16:48:37 +0000 (18:48 +0200)]
anv: remove pre hasvk split assert

With softpin we should not always expect a BO in addresses.

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

16 months agoanv: limit push constant dirtyness with generation shaders
Lionel Landwerlin [Thu, 5 Jan 2023 19:22:01 +0000 (21:22 +0200)]
anv: limit push constant dirtyness with generation shaders

We only use the fragment shader push constants.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: correctly program 3DSTATE_SF in generation shaders
Lionel Landwerlin [Mon, 2 Jan 2023 23:01:00 +0000 (01:01 +0200)]
anv: correctly program 3DSTATE_SF in generation shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: remove BTI related flush in generation shaders
Lionel Landwerlin [Mon, 2 Jan 2023 02:17:53 +0000 (04:17 +0200)]
anv: remove BTI related flush in generation shaders

Earlier versions of the generation shaders were using the binding
table. We since switch to A64 messages. So the flush can be removed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: remove copied code from generation shader
Lionel Landwerlin [Sun, 1 Jan 2023 23:05:26 +0000 (01:05 +0200)]
anv: remove copied code from generation shader

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: fix generated forward jump with more than 67M draws
Lionel Landwerlin [Mon, 2 Jan 2023 16:20:48 +0000 (18:20 +0200)]
anv: fix generated forward jump with more than 67M draws

The issue here is that for draw indirect count variants, we want to
jump after the last generated draw call to the next location where
commands are. But if we have more than 67M draws (8k * 8k chunks), we
only know the location once we've generated each of the 8k * 8k
chunks.

This change adds a CPU side pointer in the push constant struct so
that we can create a single linked list of chunks to edit and go
through to write the correct jump address after all the generated
space has been allocated.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>

16 months agoanv: correctly reset generation address on command buffer reset
Lionel Landwerlin [Thu, 5 Jan 2023 13:30:33 +0000 (15:30 +0200)]
anv: correctly reset generation address on command buffer reset

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