platform/upstream/mesa.git
2 years agoac/gpu_info: set cu_mask correctly for Arcturus
Marek Olšák [Wed, 8 Dec 2021 04:23:21 +0000 (23:23 -0500)]
ac/gpu_info: set cu_mask correctly for Arcturus

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

2 years agoi915g: Turn off FP16 in the vertex shaders.
Emma Anholt [Mon, 20 Dec 2021 23:15:38 +0000 (15:15 -0800)]
i915g: Turn off FP16 in the vertex shaders.

This ended up being turned on in gallivm, but since we use nir_to_tgsi on
the VS and TGSI doesn't have FP16, we can't let that happen.

Fixes: f814a2449e2c ("llvmpipe: enable FP16 and update CL + traces piglit results.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14403>

2 years agoFix compilation on armv7l with gcc 11.2.0
satmandu [Fri, 10 Sep 2021 20:58:09 +0000 (20:58 +0000)]
Fix compilation on armv7l with gcc 11.2.0

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

2 years agoglsl/glcpp: make sure to expand new token after concatenation
Timothy Arceri [Tue, 7 Dec 2021 04:35:48 +0000 (15:35 +1100)]
glsl/glcpp: make sure to expand new token after concatenation

Previously the code was using a hack to change the token type from
INDETIFIER -> OTHER in order to avoid getting in an infinite loop
expanding the tokens. This worked ok until we got to a paste where
the replacement parameters had already had their type changed
to OTHER because the newly created paste token would then
inherit the OTHER type and never get expanded inself.

For example with the follow code:

   #define STEP_ONE() \
out_Color = vec4(0.0,1.0,0.0,1.0)

   #define GLUE(x,y) x ## _ ## y
   #define EVALUATE(x,y)  GLUE(x,y)
   #define STEP(stepname) EVALUATE(STEP, stepname)()
   #define PERFORM_RAYCASTING_STEP STEP(ONE)

This would get all the way to expanding PERFORM_RAYCASTING_STEP to
STEP_ONE() but because it was created via the paste `x ## _ ## y`
it would never get any further.

To fix this we remove the OTHER hack and instead just track if the
token has already been handled via a bool value `explanding`.

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

Fixes: 28842c2331e6 ("glcpp: Implement token pasting for non-function-like macros")

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14101>

2 years agotgsi/exec: Simplify indirects now that they always use the ADDR file.
Emma Anholt [Fri, 31 Dec 2021 00:09:50 +0000 (16:09 -0800)]
tgsi/exec: Simplify indirects now that they always use the ADDR file.

This was a lot of extra code in the hot path of getting though
fetch_src_file_channel().  No significant perf difference in softpipe,
though.

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

2 years agogallium: Delete PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS
Emma Anholt [Thu, 30 Dec 2021 23:59:15 +0000 (15:59 -0800)]
gallium: Delete PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS

Softpipe was the only driver still using this feature.  I had enabled it
in ba22f014f9db ("softpipe: Enable PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS;") for
an instr count win, but it's really not important to that driver and it's
not worth keeping the knob around just for that.

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

2 years agonir_to_tgsi: Use the same address reg mappings as GLSL-to-TGSI did.
Emma Anholt [Thu, 30 Dec 2021 03:23:14 +0000 (19:23 -0800)]
nir_to_tgsi: Use the same address reg mappings as GLSL-to-TGSI did.

It turns out r600 has a bunch of expectations about the Dimension being in
ADDR[1].x, and sampler or atomic indirects being in ADDR[2].x.  It's
simpler to just use this static assignment than our dynamic one, anyway.

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

2 years agokmsro: Add 'rcar-du' driver support
Biju Das [Thu, 16 Dec 2021 16:52:57 +0000 (16:52 +0000)]
kmsro: Add 'rcar-du' driver support

rcar-du is used by Renesas R-Car and RZ/G SOCs.
Driver is available in the mainline kernel [1]
[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/rcar-du

Suggested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Show Liu <show.liu.yj@renesas.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14393>

2 years agomesa: Remove unused _mesa_get_linear_format_srgb
Adam Jackson [Thu, 16 Dec 2021 02:32:58 +0000 (21:32 -0500)]
mesa: Remove unused _mesa_get_linear_format_srgb

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14220>

2 years agomesa: Remove unused _mesa_format_fallback_rgbx_to_rgba
Adam Jackson [Thu, 16 Dec 2021 02:32:19 +0000 (21:32 -0500)]
mesa: Remove unused _mesa_format_fallback_rgbx_to_rgba

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14220>

2 years agomesa: Remove unused _mesa_bind_texture
Adam Jackson [Thu, 16 Dec 2021 02:21:55 +0000 (21:21 -0500)]
mesa: Remove unused _mesa_bind_texture

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14220>

2 years agomesa: Remove unused _mesa_AllocTextureStorage_sw
Adam Jackson [Thu, 16 Dec 2021 01:56:52 +0000 (20:56 -0500)]
mesa: Remove unused _mesa_AllocTextureStorage_sw

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14220>

2 years agomesa: Remove unused _mesa_allow_light_in_model
Adam Jackson [Thu, 16 Dec 2021 01:02:14 +0000 (20:02 -0500)]
mesa: Remove unused _mesa_allow_light_in_model

ctx::_ForceEyeCoords is now never not false, so remove and simplify to
match.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14220>

2 years agoradv: Support VRS for mesh shaders.
Timur Kristóf [Fri, 17 Dec 2021 16:55:36 +0000 (17:55 +0100)]
radv: Support VRS for mesh shaders.

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

2 years agoaco: Emit VRS rate when it's per-primitive.
Timur Kristóf [Fri, 17 Dec 2021 16:54:12 +0000 (17:54 +0100)]
aco: Emit VRS rate when it's per-primitive.

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

2 years agoradv: Lower primitive shading rate for mesh shaders.
Timur Kristóf [Fri, 17 Dec 2021 16:51:18 +0000 (17:51 +0100)]
radv: Lower primitive shading rate for mesh shaders.

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

2 years agoradv: Note when a mesh shader writes the primitive shading rate.
Timur Kristóf [Fri, 17 Dec 2021 16:50:35 +0000 (17:50 +0100)]
radv: Note when a mesh shader writes the primitive shading rate.

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

2 years agoclover: Move min image support check
Rob Clark [Sun, 26 Dec 2021 20:45:49 +0000 (12:45 -0800)]
clover: Move min image support check

If the gallium driver supports images, but not the minimum image
requirements for CL, then simply don't claim to support images.  This
is better than not claiming to support CL at all.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14310>

2 years agoradv: add UMR markers for the vertex prolog
Samuel Pitoiset [Fri, 15 Oct 2021 11:30:16 +0000 (13:30 +0200)]
radv: add UMR markers for the vertex prolog

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

2 years agoradv: dump the VS prolog disassembly to the hang report
Samuel Pitoiset [Fri, 15 Oct 2021 09:03:04 +0000 (11:03 +0200)]
radv: dump the VS prolog disassembly to the hang report

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

2 years agoradv: save the vertex prolog to the trace BO for debugging
Samuel Pitoiset [Fri, 15 Oct 2021 08:52:09 +0000 (10:52 +0200)]
radv: save the vertex prolog to the trace BO for debugging

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

2 years agoradv,aco: keep track of the prolog disassembly if necessary
Samuel Pitoiset [Fri, 15 Oct 2021 08:03:21 +0000 (10:03 +0200)]
radv,aco: keep track of the prolog disassembly if necessary

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

2 years agoaco: do not print prologs disassembly if no disassembler
Samuel Pitoiset [Fri, 15 Oct 2021 07:56:56 +0000 (09:56 +0200)]
aco: do not print prologs disassembly if no disassembler

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

2 years agoaco: fix a dynamic-stack-buffer-overflow when printing instructions
Samuel Pitoiset [Wed, 29 Dec 2021 07:28:22 +0000 (08:28 +0100)]
aco: fix a dynamic-stack-buffer-overflow when printing instructions

Detected by ASAN.

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

2 years agomapi: generate correct dispatch for EXT_draw_instanced
Dave Airlie [Wed, 29 Dec 2021 18:57:07 +0000 (04:57 +1000)]
mapi: generate correct dispatch for EXT_draw_instanced

These APIs can be exposed in GLES2.0 via EXT_draw_instanced,
they were incorrectly being stuck on GLES 3.0 only.

Fixes piglit ext_draw_instanced-drawarrays

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14338>

2 years agor300: Remove broken optimization in rc_transform_KILL
Pavel Ondračka [Mon, 3 Jan 2022 14:47:43 +0000 (15:47 +0100)]
r300: Remove broken optimization in rc_transform_KILL

The logic was reversed so this was not only not working but it was
also removing random instructions around. The special IF-KILP-ENDIF
case this optimization was targeting is already transformed to
KILL_IF in the TGSI, so just remove this altogether.

This fixes piglit glsl-fs-discard-04
v2: Update the comment as well

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/343
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@zoho.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14378>

2 years agoci: debian-clang: drop -Wno-error=absolute-value
Thomas H.P. Andersen [Sat, 25 Dec 2021 17:26:34 +0000 (18:26 +0100)]
ci: debian-clang: drop -Wno-error=absolute-value

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14302>

2 years agobroadcom/compiler: fix compile warning -Wabsolute-value
Thomas H.P. Andersen [Sat, 25 Dec 2021 17:25:34 +0000 (18:25 +0100)]
broadcom/compiler: fix compile warning -Wabsolute-value

fixes a compile warning with clang

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14302>

2 years agoxa: fix compile warning for -Wabsolute-value
Thomas H.P. Andersen [Sat, 25 Dec 2021 17:24:05 +0000 (18:24 +0100)]
xa: fix compile warning for -Wabsolute-value

fixes a compile warning with clang

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14302>

2 years agoutil/u_trace: protect against reentrant calls
Lionel Landwerlin [Sat, 18 Dec 2021 14:48:00 +0000 (16:48 +0200)]
util/u_trace: protect against reentrant calls

With the Iris driver, the first tracepoint triggers the tracepoint for
"begin of command buffer" which leads to 2 tracepoints using the same
idx.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14254>

2 years agodriconf: enable glthread for Minecraft-FTB, Stellaris, Battletech
Marek Olšák [Sat, 1 Jan 2022 06:36:24 +0000 (01:36 -0500)]
driconf: enable glthread for Minecraft-FTB, Stellaris, Battletech

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

2 years agonouveau/nir: Lower 64-bit phis
M Henning [Thu, 30 Dec 2021 01:06:26 +0000 (20:06 -0500)]
nouveau/nir: Lower 64-bit phis

Fixes arb_gpu_shader_fp64-fs-non-uniform-control-flow-ubo
on kepler with NV50_PROG_USE_NIR=1

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14343>

2 years agoradeonsi: add a debug option that disables DCC for all exported buffers
Marek Olšák [Tue, 21 Dec 2021 17:56:38 +0000 (12:56 -0500)]
radeonsi: add a debug option that disables DCC for all exported buffers

requested internally

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

2 years agozink: malloc/sizeof mismatch
Thomas H.P. Andersen [Wed, 29 Dec 2021 10:19:39 +0000 (11:19 +0100)]
zink: malloc/sizeof mismatch

buffer_infos is VkBufferView* but malloc is using the
size of VkImageView. The size is the same but this
fixes a warning

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14335>

2 years agoci: debian-clang: -Wno-error for sometimes-uninitialized
Thomas H.P. Andersen [Thu, 23 Dec 2021 01:07:40 +0000 (02:07 +0100)]
ci: debian-clang: -Wno-error for sometimes-uninitialized

The last of this kind of warning is gone for CPP

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14296>

2 years agor600/sb: silence a sometimes-uninitialized warning
Thomas H.P. Andersen [Thu, 23 Dec 2021 01:05:47 +0000 (02:05 +0100)]
r600/sb: silence a sometimes-uninitialized warning

Fixes a warning from clang

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14296>

2 years agomesa/vbo: be more comprehensive for degenerate primitive conversion in dlists
Mike Blumenkrantz [Tue, 16 Nov 2021 15:57:24 +0000 (10:57 -0500)]
mesa/vbo: be more comprehensive for degenerate primitive conversion in dlists

these shouldn't result in any sort of draw, and passing the unsupported primtype
to the driver is invalid

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

2 years agopan/bi: Fix load_const of 1-bit booleans
Alyssa Rosenzweig [Sun, 2 Jan 2022 01:38:46 +0000 (20:38 -0500)]
pan/bi: Fix load_const of 1-bit booleans

For historical reasons, we ingest 1-bit booleans in NIR but expand them
to 16/32-bit booleans in the backend IR. We need to handle this case
when loading boolean constants, extending from 1-bit to 16/32-bit as
required. This issue is masked by effective constant folding for
booleans, but is visible in a shader from Firefox WebRender.

Fixes: 646e03c4519 ("pan/bi: Temporarily switch back to 0/~0 bools")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95
Closes: #5797
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14371>

2 years agoanv: enable adaptive sync for ANV
Uday Kiran Pichika [Tue, 28 Dec 2021 08:39:46 +0000 (10:39 +0200)]
anv: enable adaptive sync for ANV

Signed-off-by: Uday Kiran Pichika <pichika.uday.kiran@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6420>

2 years agoiris: enable adaptive sync for IRIS
Uday Kiran Pichika [Tue, 28 Dec 2021 08:39:03 +0000 (10:39 +0200)]
iris: enable adaptive sync for IRIS

Signed-off-by: Uday Kiran Pichika <pichika.uday.kiran@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6420>

2 years agopan/bi: Use fused dual source blending
Alyssa Rosenzweig [Mon, 8 Nov 2021 14:52:25 +0000 (09:52 -0500)]
pan/bi: Use fused dual source blending

Instead of emitting a pile of moves to fixed registers at codegen time
and hoping everything works out, add a second staging source to the
BLEND instruction in the intermediate representation containing the dual
source colour, and modify register allocation appropriately. This better
models the operation of blending render target #0 with two sources.

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

2 years agopan/bi: Allow an extra staging source
Alyssa Rosenzweig [Mon, 8 Nov 2021 14:50:43 +0000 (09:50 -0500)]
pan/bi: Allow an extra staging source

Useful for dual source blending.

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

2 years agopan/bi: Use is_staging_src helper
Alyssa Rosenzweig [Mon, 8 Nov 2021 14:49:19 +0000 (09:49 -0500)]
pan/bi: Use is_staging_src helper

This will allow us to have a separate set of staging sources, which will
be useful for dual-source blending.

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

2 years agopanfrost: Remove pan_nir_reorder_writeout
Alyssa Rosenzweig [Fri, 29 Oct 2021 14:01:22 +0000 (10:01 -0400)]
panfrost: Remove pan_nir_reorder_writeout

Now that dual source stores are fused, there's no ordering hazard so we
can remove this tricky code.

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

2 years agopanfrost: Combine dual source blends
Alyssa Rosenzweig [Fri, 29 Oct 2021 13:41:05 +0000 (09:41 -0400)]
panfrost: Combine dual source blends

Reuse the store_combined_output_pan infrastructure for dual source
blending as well. This simplifies ordering.

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

2 years agonir: Extend store_combined_output_pan
Alyssa Rosenzweig [Fri, 29 Oct 2021 12:48:46 +0000 (08:48 -0400)]
nir: Extend store_combined_output_pan

Extend store_combined_output_pan to take a dual source blend input in
addition to colour, depth, and stencil inputs. Use the last source for
this, and represent the type with the DEST_TYPE index. This is a hack
but there is no SRC2_TYPE and NIR doesn't seem to mind as long as we
know what we mean. This allows the backend to emit a combined "blend
render target #0" instruction taking two sources.

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

2 years agopanfrost: Simplify blend lowering pass
Alyssa Rosenzweig [Fri, 29 Oct 2021 13:02:37 +0000 (09:02 -0400)]
panfrost: Simplify blend lowering pass

Combine depth/stencil writeout redundancy. This simplifies the code and
will allow us to add dual source blend handling without duplicating even
more code.

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

2 years agonir: Eliminate store_combined_output_pan BASE
Alyssa Rosenzweig [Sat, 1 Jan 2022 15:11:33 +0000 (10:11 -0500)]
nir: Eliminate store_combined_output_pan BASE

It's meaningless for this intrinsic and is just adding noise to the
lowering pass.

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

2 years agopan/mdg: Don't read base for combined stores
Alyssa Rosenzweig [Sat, 1 Jan 2022 15:41:58 +0000 (10:41 -0500)]
pan/mdg: Don't read base for combined stores

`base` is meaningless for combined stores, so don't read it. This allows
us to remove the base index from the intrinsic and simplify the lowering
code generating the combined store intrinsic.

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

2 years agopan/bi: Don't read base for combined stores
Alyssa Rosenzweig [Sat, 1 Jan 2022 15:09:21 +0000 (10:09 -0500)]
pan/bi: Don't read base for combined stores

`base` is meaningless for combined stores, so don't read it. This allows
us to remove the base index from the intrinsic and simplify the lowering
code generating the combined store intrinsic.

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

2 years agoaco: lower masked swizzle to DPP8
Tatsuyuki Ishi [Sun, 28 Nov 2021 15:12:18 +0000 (00:12 +0900)]
aco: lower masked swizzle to DPP8

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

2 years agoaco: support DPP8
Tatsuyuki Ishi [Sun, 28 Nov 2021 15:12:04 +0000 (00:12 +0900)]
aco: support DPP8

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

2 years agogallium/aux: Move index offsetting from prim restart to primconvert
Jesse Natalie [Thu, 30 Dec 2021 00:56:53 +0000 (16:56 -0800)]
gallium/aux: Move index offsetting from prim restart to primconvert

Fixes: b34fed64 ("u_prim_restart: Fix index scanning with start offset")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5799
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14346>

2 years agoradv: Remove dependencies on vk_common entrypoints.
Bas Nieuwenhuizen [Fri, 31 Dec 2021 16:27:18 +0000 (17:27 +0100)]
radv: Remove dependencies on vk_common entrypoints.

Fixes: 91fe0b5629d ("radv: Delete lots of sync code.")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14366>

2 years agoradv: Rename submit2->submit.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 22:06:48 +0000 (23:06 +0100)]
radv: Rename submit2->submit.

Cleanup after the big switcheroo.

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

2 years agoradv: Remove syncobj reset mechanism.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 20:02:30 +0000 (21:02 +0100)]
radv: Remove syncobj reset mechanism.

Now done with the vulkan runtime.

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

2 years agoradv: Delete lots of sync code.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 18:38:08 +0000 (19:38 +0100)]
radv: Delete lots of sync code.

This make things all fall back to the common synchronization functions
which will switch things to the new submission path and to use
vk_fence and vk_semaphore.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
radv: Use common AcquireNextImage2KHR.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
radv: Use common functions for Metro Exodus layer.

Needs to be squashed with the big "switch the world" deletion patch
but kept it separate for review.

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

2 years agoradv: Add new submission path for use by the common sync framework.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 17:55:47 +0000 (18:55 +0100)]
radv: Add new submission path for use by the common sync framework.

Basically just a copy of radv's internal deferred submission handler.

This uses the new winsys submit2 to later be able to move the sem_info
to the winsys.

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

2 years agoradv: Add new cs_submit2 winsys call.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 16:51:23 +0000 (17:51 +0100)]
radv: Add new cs_submit2 winsys call.

A bit more runtime dependence so we can remove all the syncobj stuff
in radv itself.

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

2 years agoradv: Use vk_command_buffer for preambles.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 15:51:39 +0000 (16:51 +0100)]
radv: Use vk_command_buffer for preambles.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agoradv: Set horizontal sync types.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 15:38:06 +0000 (16:38 +0100)]
radv: Set horizontal sync types.

We basically use 2 types for amdgpu:

1) syncobj. This supports both binary & timeline and autodetects
  all the features.
2) emulated timelines if (1) doesn't detect timeline syncobj support.

Note that one has to put these in order of preference so that the
common CreateFence/CreateSemaphore functions decide on the right
type.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agoradv: Add function to allow WSI signalling fences/semaphores.
Bas Nieuwenhuizen [Thu, 30 Dec 2021 15:03:37 +0000 (16:03 +0100)]
radv: Add function to allow WSI signalling fences/semaphores.

Added but not enabled yet. Will enable in the big switchover.

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

2 years agoradv: Initialize vk device drm fd.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 12:39:21 +0000 (13:39 +0100)]
radv: Initialize vk device drm fd.

For common sync.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agomeson: Bump libdrm_amdgpu version req to 2.4.109.
Bas Nieuwenhuizen [Thu, 30 Dec 2021 15:21:06 +0000 (16:21 +0100)]
meson: Bump libdrm_amdgpu version req to 2.4.109.

For getting the fd from the device.

This uses the new function introduced with libdrm 2.4.109. This has
already been updated in CI and is already required for mesa common
bits so requiring it for libdrm_amdgpu is no big deal.

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

2 years agoradv: Use vulkan runtime for device lost.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 16:59:26 +0000 (17:59 +0100)]
radv: Use vulkan runtime for device lost.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agoradv: Use dispatch table for wsi_display.c
Bas Nieuwenhuizen [Sun, 28 Nov 2021 19:13:39 +0000 (20:13 +0100)]
radv: Use dispatch table for wsi_display.c

Pretty sure this could be moved into WSI.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agoradv: Use dispatch table for QueueWaitIdle in the SQTT layer.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 21:25:01 +0000 (22:25 +0100)]
radv: Use dispatch table for QueueWaitIdle in the SQTT layer.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agovulkan/runtime: Add sparse bind support.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 17:52:16 +0000 (18:52 +0100)]
vulkan/runtime: Add sparse bind support.

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

2 years agovulkan/runtime: Refactor queue submit to take an argument struct.
Bas Nieuwenhuizen [Sun, 28 Nov 2021 17:24:16 +0000 (18:24 +0100)]
vulkan/runtime: Refactor queue submit to take an argument struct.

For merging with the sparse binding structs.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13974>

2 years agoaco: don't split VOP3P definitions
Daniel Schürmann [Mon, 4 Oct 2021 10:29:04 +0000 (11:29 +0100)]
aco: don't split VOP3P definitions

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

2 years agoaco: use p_create_vector(v2b,v2b) in get_alu_src_vop3p()
Daniel Schürmann [Tue, 26 Oct 2021 16:11:30 +0000 (18:11 +0200)]
aco: use p_create_vector(v2b,v2b) in get_alu_src_vop3p()

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

2 years agoaco: use explicit zero-padding for 64bit image loads in expand_vector()
Daniel Schürmann [Wed, 15 Dec 2021 10:18:03 +0000 (11:18 +0100)]
aco: use explicit zero-padding for 64bit image loads in expand_vector()

Previously, this only worked because of regClass mismatches
in the allocated vector.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13576>

2 years agoaco/optimizer: apply extract from subdword p_split_vector
Daniel Schürmann [Mon, 25 Oct 2021 14:44:42 +0000 (16:44 +0200)]
aco/optimizer: apply extract from subdword p_split_vector

Totals from 1345 (1.00% of 134572) affected shaders: (GFX10.3)
VGPRs: 76752 -> 76744 (-0.01%); split: -0.02%, +0.01%
SpillSGPRs: 1459 -> 1460 (+0.07%)
SpillVGPRs: 1776 -> 1784 (+0.45%); split: -0.39%, +0.84%
CodeSize: 13310964 -> 13309420 (-0.01%); split: -0.06%, +0.05%
Scratch: 178176 -> 179200 (+0.57%)
Instrs: 2516874 -> 2516860 (-0.00%); split: -0.05%, +0.05%
Latency: 23228506 -> 23230338 (+0.01%); split: -0.14%, +0.15%
InvThroughput: 6002384 -> 6000158 (-0.04%); split: -0.24%, +0.21%
VClause: 41115 -> 41117 (+0.00%); split: -0.28%, +0.29%
SClause: 104639 -> 104664 (+0.02%); split: -0.07%, +0.09%
Copies: 185121 -> 184862 (-0.14%); split: -0.69%, +0.55%
Branches: 100740 -> 100735 (-0.00%); split: -0.01%, +0.00%
PreVGPRs: 70119 -> 69968 (-0.22%)

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

2 years agoaco/optimizer: optimize extract(extract())
Daniel Schürmann [Tue, 5 Oct 2021 12:09:02 +0000 (13:09 +0100)]
aco/optimizer: optimize extract(extract())

Totals from 53 (0.04% of 134572) affected shaders: (GFX10.3)
SpillVGPRs: 1780 -> 1776 (-0.22%); split: -0.34%, +0.11%
CodeSize: 968352 -> 963196 (-0.53%); split: -0.55%, +0.02%
Scratch: 180224 -> 178176 (-1.14%)
Instrs: 169800 -> 169158 (-0.38%); split: -0.39%, +0.01%
Latency: 6186064 -> 6141408 (-0.72%); split: -1.16%, +0.44%
InvThroughput: 2605044 -> 2582967 (-0.85%); split: -1.37%, +0.52%
VClause: 4851 -> 4866 (+0.31%); split: -0.16%, +0.47%
SClause: 1744 -> 1746 (+0.11%)
Copies: 42874 -> 42325 (-1.28%); split: -1.40%, +0.12%
Branches: 5762 -> 5765 (+0.05%); split: -0.02%, +0.07%

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

2 years agoaco/optimizer: apply extract from p_extract_vector
Daniel Schürmann [Mon, 4 Oct 2021 10:13:08 +0000 (11:13 +0100)]
aco/optimizer: apply extract from p_extract_vector

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

2 years agoaco/optimizer: keep instr_mod_labels after applying extract
Daniel Schürmann [Mon, 4 Oct 2021 10:03:14 +0000 (11:03 +0100)]
aco/optimizer: keep instr_mod_labels after applying extract

This allows to use clamp on SDWA and VOP3 opsel instructions.

Totals from 32 (0.02% of 134572) affected shaders: (GFX10.3)
SpillVGPRs: 1783 -> 1780 (-0.17%); split: -0.50%, +0.34%
CodeSize: 881480 -> 881496 (+0.00%); split: -0.15%, +0.15%
Instrs: 154400 -> 154388 (-0.01%); split: -0.13%, +0.12%
Latency: 5021791 -> 5033485 (+0.23%); split: -0.67%, +0.90%
InvThroughput: 2486454 -> 2492312 (+0.24%); split: -0.67%, +0.91%
VClause: 4763 -> 4755 (-0.17%); split: -0.52%, +0.36%
Copies: 42866 -> 42965 (+0.23%); split: -0.25%, +0.48%
Branches: 5640 -> 5639 (-0.02%)

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

2 years agoaco: don't allow SDWA on VOP3P instructions
Daniel Schürmann [Mon, 20 Dec 2021 09:46:43 +0000 (10:46 +0100)]
aco: don't allow SDWA on VOP3P instructions

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13576>

2 years agoradv: add drirc radv_disable_htile_layers and enable it for F1 2021
Samuel Pitoiset [Thu, 30 Dec 2021 17:24:10 +0000 (18:24 +0100)]
radv: add drirc radv_disable_htile_layers and enable it for F1 2021

To workaround some flickering issues in the main menu.
See https://github.com/HansKristian-Work/vkd3d-proton/issues/950

Cc: 21.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14354>

2 years agoradv: fix copying mutable descriptors to sampler descriptors
Samuel Pitoiset [Tue, 28 Dec 2021 10:01:38 +0000 (11:01 +0100)]
radv: fix copying mutable descriptors to sampler descriptors

This fixes a heap-buffer-overflow detected by ASAN.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14330>

2 years agoradv: Enable NV_mesh_shader with a perftest flag.
Timur Kristóf [Thu, 28 Oct 2021 19:25:48 +0000 (21:25 +0200)]
radv: Enable NV_mesh_shader with a perftest flag.

We don't plan to support NV_mesh_shader officially on RADV,
because it performs poorly on AMD hardware. However, we are
implementing this extension to get some experience with mesh
shader technology.

Users should not rely on this support because we are going
to remove it if/when a potential cross-vendor extension appears.

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

2 years agoradv: Implement NV_mesh_shader draw calls.
Timur Kristóf [Thu, 28 Oct 2021 19:18:35 +0000 (21:18 +0200)]
radv: Implement NV_mesh_shader draw calls.

The NV indirect command buffer format is not supported by
the hardware, so we have to emit several copy packets to
make it work.

Otherwise it works by emulating the number of launched
MS workgroups by setting the number of "input vertices".

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

2 years agoaco: Export per-primitive mesh shader output attributes.
Timur Kristóf [Thu, 21 Oct 2021 09:33:28 +0000 (11:33 +0200)]
aco: Export per-primitive mesh shader output attributes.

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

2 years agoaco: Use the correct outinfo for mesh shaders.
Timur Kristóf [Thu, 28 Oct 2021 19:04:16 +0000 (21:04 +0200)]
aco: Use the correct outinfo for mesh shaders.

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

2 years agoaco: Add 1D workgroup_id support for mesh shaders.
Timur Kristóf [Thu, 28 Oct 2021 14:41:41 +0000 (16:41 +0200)]
aco: Add 1D workgroup_id support for mesh shaders.

I'll add support for 3D workgroup_id later, but NV_mesh_shader only
supports 1D workgroups.

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

2 years agoaco: Update README about NGG and mesh shaders.
Timur Kristóf [Fri, 29 Oct 2021 12:22:15 +0000 (14:22 +0200)]
aco: Update README about NGG and mesh shaders.

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

2 years agoaco: Add Mesh and Task shader stages.
Timur Kristóf [Thu, 21 Oct 2021 09:33:10 +0000 (11:33 +0200)]
aco: Add Mesh and Task shader stages.

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

2 years agoradv: Add support for mesh shading pipelines in the command buffer.
Timur Kristóf [Thu, 28 Oct 2021 19:18:12 +0000 (21:18 +0200)]
radv: Add support for mesh shading pipelines in the command buffer.

- Prefetch mesh shaders
- Flush mesh shader descriptors
- Assert that input assembly, etc. are ignored.

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

2 years agoradv: Create mesh shading pipelines.
Timur Kristóf [Wed, 22 Dec 2021 20:25:23 +0000 (21:25 +0100)]
radv: Create mesh shading pipelines.

- Fill gfx10_ngg_info
- Allow NULL input assembly state
- Assert that the correct shader stages are used
- Program VGT_GS_MAX_VERT_OUT, GS_EN, GS_FAST_LAUNCH

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

2 years agoradv: Set output driver locations for mesh shaders.
Timur Kristóf [Thu, 28 Oct 2021 19:09:46 +0000 (21:09 +0200)]
radv: Set output driver locations for mesh shaders.

Ignore primitive count and indices which work differently.

Then, assign driver locations to per-vertex and per-primitive
outputs independently because we allocate separate LDS
areas for them.

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

2 years agoradv: Compile mesh shaders and apply the necessary NIR lowerings.
Timur Kristóf [Thu, 28 Oct 2021 19:08:29 +0000 (21:08 +0200)]
radv: Compile mesh shaders and apply the necessary NIR lowerings.

Mesh shaders use NGG, but the API allows many compute shader
features such as workgroups and shared memory.
Use the appropriate NIR lowerings for these, then
call ac_nir_lower_ngg_ms.

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

2 years agoradv: Setup shader arguments for mesh shaders.
Timur Kristóf [Thu, 28 Oct 2021 19:07:45 +0000 (21:07 +0200)]
radv: Setup shader arguments for mesh shaders.

Use the same code path as other NGG shaders, but with
a few special cases.

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

2 years agoradv: Add support for per-primitive mesh shader outputs.
Timur Kristóf [Thu, 28 Oct 2021 14:52:35 +0000 (16:52 +0200)]
radv: Add support for per-primitive mesh shader outputs.

Generic per-primitive outputs:

They work similarly to other NGG outputs.
In the ISA they are param export instructions that are executed
on the primitive threads. These per-primitive params must be
sorted last among both mesh shader outputs and pixel shader inputs.

PS can read these inputs using the same old VINTRP instructions.
They use the same amount of LDS space as per-vertex PS inputs.

Special per-primitive outputs:

The VRS rate x, y, viewport and layer are special per-primitive
outputs which must go to the second channel of the primitive
export instruction, which is enabled by EN_PRIM_PAYLOAD.

If the PS wants to read these, they must also be exported as
a generic param.

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

2 years agoradv: Cleanup VS output param assignment.
Timur Kristóf [Wed, 15 Dec 2021 10:18:39 +0000 (11:18 +0100)]
radv: Cleanup VS output param assignment.

Makes the code a little cleaner, and makes it easier to add
per-primitive PS inputs.

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

2 years agoradv: Cleanup PS input generation.
Timur Kristóf [Wed, 15 Dec 2021 09:56:54 +0000 (10:56 +0100)]
radv: Cleanup PS input generation.

This cleans up radv_pipeline_generate_ps_inputs.
Makes the code a little cleaner, and makes it easier to add
per-primitive PS inputs.

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

2 years agoradv: Add mesh shader specific info.
Timur Kristóf [Thu, 28 Oct 2021 14:45:18 +0000 (16:45 +0200)]
radv: Add mesh shader specific info.

Use the same old outinfo structure as other NGG shaders.
Additionally, store the output primitive type.

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

2 years agoradv: Add radv_pipeline_has_mesh helper.
Timur Kristóf [Thu, 28 Oct 2021 14:50:06 +0000 (16:50 +0200)]
radv: Add radv_pipeline_has_mesh helper.

This will be used to determine whether a pipeline uses
mesh shading or not.

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

2 years agoac/nir/ngg: Lower NV mesh shaders to NGG semantics.
Timur Kristóf [Sun, 29 Aug 2021 08:32:01 +0000 (10:32 +0200)]
ac/nir/ngg: Lower NV mesh shaders to NGG semantics.

Lower mesh shader outputs to shared memory.

At the end of the shader, read the outputs from shared memory
and export their values as NGG expects.

We allocate separate shared memory (LDS) areas for per-vertex,
per-primitive outputs, primitive indices, primitive count.

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

2 years agogitlab-ci: Disable radv-fossils again.
Timur Kristóf [Fri, 31 Dec 2021 12:33:28 +0000 (13:33 +0100)]
gitlab-ci: Disable radv-fossils again.

It gets a HTTP 504 error code when trying to access a git repo.
Disable it again until this issue is resolved.

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

2 years agoFixed you're to your
Markus_included [Sat, 11 Dec 2021 21:54:01 +0000 (21:54 +0000)]
Fixed you're to your

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

2 years agointel/compiler/test: Fix build with GCC 7
Henry Goffin [Thu, 30 Dec 2021 07:13:41 +0000 (07:13 +0000)]
intel/compiler/test: Fix build with GCC 7

Without this change, test_fs_scoreboard.cpp does not compile on GCC 7
due to the use of C99 initializers in a C++ source file.

Fixes: c847bfaaf5c ("intel/fs/gen12: Add tests for scoreboard pass")

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14349>