platform/upstream/mesa.git
13 months agovtn: Assume use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:43:43 +0000 (16:43 -0400)]
vtn: Assume use_scoped_barrier

True for all backends supporting barriers. This lets us collapse lots of code,
since scoped_barriers are based on the SPIR-V definition.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agoglsl: Assume use_scoped_barrier
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:43:26 +0000 (16:43 -0400)]
glsl: Assume use_scoped_barrier

True for all backends supporting barriers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agoac/llvm: Drop memory_barrier_buffer impl
Alyssa Rosenzweig [Tue, 6 Jun 2023 20:37:50 +0000 (16:37 -0400)]
ac/llvm: Drop memory_barrier_buffer impl

Both radeonsi and radv use scoped barriers, so this should not be possible to
hit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agontt: Use scoped barriers
Alyssa Rosenzweig [Tue, 23 May 2023 17:55:43 +0000 (13:55 -0400)]
ntt: Use scoped barriers

In addition to bringing us one backend closer to the scoped-only future, this
improves the generated code in cases like:

   memoryBarrierBuffer();
   memoryBarrierShared();
   controlBarrier();

With scoped_barriers + nir_opt_combine_barriers, we now emit only one MEMBAR
instruction (and a BARRIER) rather than two MEMBARs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agottn: Emit scoped barriers when needed
Alyssa Rosenzweig [Tue, 23 May 2023 17:41:59 +0000 (13:41 -0400)]
ttn: Emit scoped barriers when needed

As we start converting more backends over.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agoir3: Drop reference to unsupported intrinsic
Alyssa Rosenzweig [Tue, 23 May 2023 14:52:02 +0000 (10:52 -0400)]
ir3: Drop reference to unsupported intrinsic

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agovtn: Handle atomic counter semantics
Alyssa Rosenzweig [Wed, 7 Jun 2023 11:59:26 +0000 (07:59 -0400)]
vtn: Handle atomic counter semantics

This can happen for GLSL-environment SPIR-V.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Suggested-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23191>

13 months agoci: temporarily disable lima farm
Erico Nunes [Tue, 13 Jun 2023 11:37:36 +0000 (13:37 +0200)]
ci: temporarily disable lima farm

The lab is currently experiencing network instability with the ISP.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23623>

13 months agor600: tgsi cleanup
Thomas H.P. Andersen [Thu, 8 Jun 2023 21:51:53 +0000 (23:51 +0200)]
r600: tgsi cleanup

337dc7d76604e646f1a85615ab2d9d238427bf46 removed the usage of these
fields in struct r600_shader_ctx

Cleaning this up will let us drop tgsi_array_info in a later MR

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

13 months agodocs: improve OpenCL features
Karol Herbst [Tue, 13 Jun 2023 14:02:23 +0000 (16:02 +0200)]
docs: improve OpenCL features

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed by Nora Allen <blackcatgames@protonmail.com>

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

13 months agoradv: Leave primitive reset index at max on GFX8+.
Timur Kristóf [Tue, 6 Jun 2023 08:17:16 +0000 (10:17 +0200)]
radv: Leave primitive reset index at max on GFX8+.

GFX8+ only compares the bits according to the index type by default
(GFX9 can be changed by VGT_MULTI_PRIM_IB_RESET_EN.MATCH_ALL_BITS),
so we can always leave the programmed value at the maximum.

This reduces context rolls on GFX8+ when primitive restart is used.

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

13 months agoradv: Remove primitive reset index from late scissor workaround.
Timur Kristóf [Tue, 6 Jun 2023 08:17:16 +0000 (10:17 +0200)]
radv: Remove primitive reset index from late scissor workaround.

Primitive reset has a corresponding dirty state which is already
included the used_states so it is not necessary to also check
the primitive reset index here.

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

13 months agoetnaviv: add support for performance warnings
Christian Gmeiner [Wed, 7 Jun 2023 15:14:49 +0000 (17:14 +0200)]
etnaviv: add support for performance warnings

These performance warnings should help to get a better understanding
where we doing non performance optimal things.

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

13 months agoanv: use workaround framework for 1408224581, 14014097488
Tapani Pälli [Mon, 12 Jun 2023 13:37:06 +0000 (16:37 +0300)]
anv: use workaround framework for 140822458114014097488

This makes sure we apply WA only when it is required, these issues
do not happen for later MTL steppings.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23596>

13 months agoiris: use workaround framework for 1408224581, 14014097488
Tapani Pälli [Mon, 12 Jun 2023 13:25:18 +0000 (16:25 +0300)]
iris: use workaround framework for 140822458114014097488

This makes sure we apply WA only when it is required, these issues
do not happen for later MTL steppings.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23596>

13 months agointel/dev: add parentheses around intel_needs_workaround macro
Tapani Pälli [Mon, 12 Jun 2023 18:26:38 +0000 (21:26 +0300)]
intel/dev: add parentheses around intel_needs_workaround macro

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23596>

13 months agor300: be more agressive when merging A0 loads
Pavel Ondračka [Wed, 7 Jun 2023 13:48:00 +0000 (15:48 +0200)]
r300: be more agressive when merging A0 loads

Specifically we would bail out previously when encountering any
control flow, now we would optimize it even when the second ARL/ARR
is inside a lower level if/else branch.

shader-db

RV530:
total instructions in shared programs: 132020 -> 131924 (-0.07%)
instructions in affected programs: 3374 -> 3278 (-2.85%)
helped: 4
HURT: 0

RV370:
no change (no control flow there)

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

13 months agor300: remove duplicate ARRs
Pavel Ondračka [Wed, 7 Jun 2023 13:36:16 +0000 (15:36 +0200)]
r300: remove duplicate ARRs

We already do this for ARL, so just generalize the pass.

shader-db

RV530:
total instructions in shared programs: 132235 -> 132020 (-0.16%)
instructions in affected programs: 8492 -> 8277 (-2.53%)
helped: 41
HURT: 1
total temps in shared programs: 16900 -> 16887 (-0.08%)
temps in affected programs: 83 -> 70 (-15.66%)
helped: 13
HURT: 0

RV370:
total instructions in shared programs: 82395 -> 82320 (-0.09%)
instructions in affected programs: 4715 -> 4640 (-1.59%)
helped: 33
HURT: 1
total temps in shared programs: 12316 -> 12305 (-0.09%)
temps in affected programs: 75 -> 64 (-14.67%)
helped: 11
HURT: 0

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

13 months agor300: optimize the load A0 pattern from wined3d
Pavel Ondračka [Fri, 9 Jun 2023 12:32:47 +0000 (14:32 +0200)]
r300: optimize the load A0 pattern from wined3d

Shader-db

RV530:
total instructions in shared programs: 129701 -> 128733 (-0.75%)
instructions in affected programs: 7011 -> 6043 (-13.81%)
helped: 48
HURT: 0
total loops in shared programs: 15 -> 11 (-26.67%)
loops in affected programs: 4 -> 0
helped: 4
HURT: 0
total temps in shared programs: 16819 -> 16832 (0.08%)
temps in affected programs: 70 -> 83 (18.57%)
helped: 0
HURT: 13
total consts in shared programs: 90830 -> 90813 (-0.02%)
consts in affected programs: 4335 -> 4318 (-0.39%)
helped: 17
HURT: 0

RV370:
total instructions in shared programs: 82027 -> 81215 (-0.99%)
instructions in affected programs: 5456 -> 4644 (-14.88%)
helped: 39
HURT: 0
total temps in shared programs: 12262 -> 12273 (0.09%)
temps in affected programs: 64 -> 75 (17.19%)
helped: 0
HURT: 11
total consts in shared programs: 79119 -> 79104 (-0.02%)
consts in affected programs: 3825 -> 3810 (-0.39%)
helped: 15
HURT: 0
GAINED:5

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9157
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

13 months agor300: move the ROUND+ARL->ARR fusing to main optimization loop
Pavel Ondračka [Wed, 7 Jun 2023 12:02:47 +0000 (14:02 +0200)]
r300: move the ROUND+ARL->ARR fusing to main optimization loop

Its particularly important to have the copy-propagate pass run first.
So that when the round is vectorized, we don't have to follow the MOVs
to find out if it leads to ARL or not (we don't vectorize ARR/ARL at the
moment).

No shader-db change.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

13 months agor300: move the ARL merging pass up in the opt loop
Pavel Ondračka [Wed, 7 Jun 2023 10:44:28 +0000 (12:44 +0200)]
r300: move the ARL merging pass up in the opt loop

Specifically after the first copy propagate run but before the
second one. Removal of ARLs will enable the copy propagate to be more
aggresive, as it is very carefull in such cases.

shader-db

RV530:
total instructions in shared programs: 131861 -> 131503 (-0.27%)
instructions in affected programs: 23949 -> 23591 (-1.49%)
helped: 199
HURT: 15
total temps in shared programs: 16997 -> 16903 (-0.55%)
temps in affected programs: 767 -> 673 (-12.26%)
helped: 69
HURT: 9

RV370:
total instructions in shared programs: 82360 -> 82027 (-0.40%)
instructions in affected programs: 19516 -> 19183 (-1.71%)
helped: 183
HURT: 15
total temps in shared programs: 12370 -> 12262 (-0.87%)
temps in affected programs: 664 -> 556 (-16.27%)
helped: 73
HURT: 0

The hurt programs are due to some constant load being copy propagated
which leads to bad interaction with source conflict resolve pass later.

v2: add missing shader type initialized to the tests. Previously we were
checking for has_omod which also practically means we have a fragment
shader, however its less readable.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

13 months agor300: move nir stuff to r300_nir file
Pavel Ondračka [Wed, 7 Jun 2023 13:11:47 +0000 (15:11 +0200)]
r300: move nir stuff to r300_nir file

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23560>

13 months agozink/ci: enable zink-radv-vangogh-valve for pre-merge testing
Martin Roukala (né Peres) [Mon, 6 Mar 2023 13:30:07 +0000 (15:30 +0200)]
zink/ci: enable zink-radv-vangogh-valve for pre-merge testing

This should allow us to catch regressions without me having to bisect
them after they land :p

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8396
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21730>

13 months agozink/ci: add more tests to the flake list of vangogh
Martin Roukala (né Peres) [Sat, 10 Jun 2023 08:07:02 +0000 (11:07 +0300)]
zink/ci: add more tests to the flake list of vangogh

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21730>

13 months agoci/b2c: change the default first-console-activity timeout to 2 minutes
Martin Roukala (né Peres) [Sun, 11 Jun 2023 06:24:34 +0000 (09:24 +0300)]
ci/b2c: change the default first-console-activity timeout to 2 minutes

Having a high value for the first activity timeout made sense back in
the days when the machine may not be associated with salad early... but
this isn't the case anymore!

So let's go with a very conservative value of 2 minutes to boot :)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21730>

13 months agobroadcom/ci: update expected results
Juan A. Suarez Romero [Tue, 13 Jun 2023 09:05:01 +0000 (11:05 +0200)]
broadcom/ci: update expected results

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23617>

13 months agogallium: Rename dri_init_screen_helper into dri_init_screen
Corentin Noël [Tue, 13 Jun 2023 09:25:38 +0000 (11:25 +0200)]
gallium: Rename dri_init_screen_helper into dri_init_screen

Makes it more obvious that this function is actually initializing the dri_screen
and not some helper.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agogallium: Use the common destroy function on screen initialization failure
Corentin Noël [Wed, 24 May 2023 14:41:57 +0000 (16:41 +0200)]
gallium: Use the common destroy function on screen initialization failure

Avoid leaking configuration options on initialization failure.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agogallium: Only call dri_init_options when the screen is actually created
Corentin Noël [Wed, 24 May 2023 14:32:26 +0000 (16:32 +0200)]
gallium: Only call dri_init_options when the screen is actually created

Avoid calling this function on screen creation failure as we will discard its
result right after.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agopipe-loader: Do not destroy the winsys on screen creation failure
Corentin Noël [Wed, 24 May 2023 14:23:35 +0000 (16:23 +0200)]
pipe-loader: Do not destroy the winsys on screen creation failure

The winsys is always destroyed on pipe_loader_device release.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9020
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agopipe-loader: Document the behavior regarding screen creating failures
Corentin Noël [Wed, 24 May 2023 14:23:02 +0000 (16:23 +0200)]
pipe-loader: Document the behavior regarding screen creating failures

Avoid inconsistent behavior on screen creation failures which might lead
to double free issues.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agogallium: Rename dri_destroy_screen_helper into dri_release_screen
Corentin Noël [Wed, 24 May 2023 14:10:18 +0000 (16:10 +0200)]
gallium: Rename dri_destroy_screen_helper into dri_release_screen

This function is actually used before the use of dri_init_screen_helper so
it is not exactly releasing the memory allocated by the screen helper.

Also clear the base.screen variable after destroy to make this function
reentrant.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agogallium: Incorporate the device release in dri_destroy_screen_helper
Corentin Noël [Wed, 24 May 2023 14:02:18 +0000 (16:02 +0200)]
gallium: Incorporate the device release in dri_destroy_screen_helper

The code to release the device was actually always used after the call
to this function.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>

13 months agoradv/ci: update the list of expected failures on STONEY
Samuel Pitoiset [Thu, 25 May 2023 09:58:37 +0000 (11:58 +0200)]
radv/ci: update the list of expected failures on STONEY

Spurious changes but the failures are weird anyways.

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

13 months agoradv: disable HTILE compression only when layouts are compressed
Samuel Pitoiset [Wed, 24 May 2023 14:10:43 +0000 (16:10 +0200)]
radv: disable HTILE compression only when layouts are compressed

On RDNA2, VRS rates are part of the HTILE buffer but if we disable
HTILE completely for eg. GENERAL, VRS rates aren't read by the hw.

Fix this by disabling HTILE compression which should have the same
effect without VRS.

Fixes recent
dEQP-VK.fragment_shading_rate.renderpass2.monolithic.attachment_rate.misc.*

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

13 months agoradv: emit DB_RENDER_CONTROL as part of the framebuffer
Samuel Pitoiset [Wed, 24 May 2023 13:56:08 +0000 (15:56 +0200)]
radv: emit DB_RENDER_CONTROL as part of the framebuffer

DB_RENDER_CONTROL controls whether depth/stencil rendering should be
compressed. Emitting this register as part of the framebuffer will
allow us to keep HTILE enabled for VRS rates, instead of disabling it
completely.

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

13 months agoradv: reset more DB registers when emitting a null ds target
Samuel Pitoiset [Thu, 25 May 2023 07:15:16 +0000 (09:15 +0200)]
radv: reset more DB registers when emitting a null ds target

PAL does that.

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

13 months agoradv: add a helper for emitting a null depth/stencil target
Samuel Pitoiset [Thu, 25 May 2023 06:53:26 +0000 (08:53 +0200)]
radv: add a helper for emitting a null depth/stencil target

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

13 months agoradeonsi: enable aco support for compute shader
Qiang Yu [Tue, 6 Jun 2023 02:04:11 +0000 (10:04 +0800)]
radeonsi: enable aco support for compute shader

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

13 months agoradeonsi: fix crash when AMD_DEBUG=cs,initnir
Qiang Yu [Wed, 7 Jun 2023 06:47:12 +0000 (14:47 +0800)]
radeonsi: fix crash when AMD_DEBUG=cs,initnir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

13 months agoac/llvm,radeonsi: lower nir_load_user_data_amd in abi
Qiang Yu [Tue, 6 Jun 2023 03:26:56 +0000 (11:26 +0800)]
ac/llvm,radeonsi: lower nir_load_user_data_amd in abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

13 months agoradeonsi: add scratch_offset arg for aco cs
Qiang Yu [Tue, 6 Jun 2023 02:04:52 +0000 (10:04 +0800)]
radeonsi: add scratch_offset arg for aco cs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23540>

13 months agost/glsl: move linking code to the same st file
Timothy Arceri [Fri, 9 Jun 2023 04:49:01 +0000 (14:49 +1000)]
st/glsl: move linking code to the same st file

Since they call one another this makes it easier to see what is
going on without looking in multiple files.

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

13 months agodxil: Remove custom SSBO lowering
Jesse Natalie [Mon, 22 May 2023 22:15:09 +0000 (15:15 -0700)]
dxil: Remove custom SSBO lowering

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

13 months agomicrosoft/compiler: Don't over-align raw buffer load/store intrinsics
Jesse Natalie [Mon, 22 May 2023 23:38:25 +0000 (16:38 -0700)]
microsoft/compiler: Don't over-align raw buffer load/store intrinsics

DXC doesn't generate these for raw loads/stores, only structured, and
old WARP had bugs with this.

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

13 months agomicrosoft/compiler: Don't lower bit sizes for movs
Jesse Natalie [Mon, 22 May 2023 22:11:55 +0000 (15:11 -0700)]
microsoft/compiler: Don't lower bit sizes for movs

Otherwise we run into problems by putting this optimization loop
before I/O lowering, where there might still be 8-bit values that
haven't been lowered to 16 or 32. Once that's done, any remaining
movs or vec ops will have higher bit sizes already.

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

13 months agodxil: Delete load_ubo_dxil intrinsic
Jesse Natalie [Mon, 22 May 2023 17:03:36 +0000 (10:03 -0700)]
dxil: Delete load_ubo_dxil intrinsic

Instead of splitting unaligned UBO loads while still using derefs,
and then lowering load_ubo to load_ubo_dxil in lower_loads_stores_to_dxil,
use lower_mem_access_bit_sizes and lower_ubo_vec4 to handle load size and
alignment restrictions while converting to load_ubo_vec4 instead, which
has the same semantics as load_ubo_dxil.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3842
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23173>

13 months agodxil: Don't generate load_ubo_dxil directly
Jesse Natalie [Mon, 22 May 2023 16:59:56 +0000 (09:59 -0700)]
dxil: Don't generate load_ubo_dxil directly

Just use load_ubo and let it get lowered appropriately later on.

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

13 months agomicrosoft/compiler: Support load_ubo_vec4
Jesse Natalie [Mon, 22 May 2023 16:56:27 +0000 (09:56 -0700)]
microsoft/compiler: Support load_ubo_vec4

Add support for 16-bit UBO loads, delete handling of byte-addressed
UBO loads (which I think was never used anyway) and add handling
for the component const index to optimize out unneeded extractResults.

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

13 months agospirv2dxil: Don't lower shared/temp to explicit I/O
Jesse Natalie [Fri, 19 May 2023 19:27:07 +0000 (12:27 -0700)]
spirv2dxil: Don't lower shared/temp to explicit I/O

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

13 months agomicrosoft/compiler: Un-lower shared/scratch to derefs
Jesse Natalie [Fri, 19 May 2023 17:28:08 +0000 (10:28 -0700)]
microsoft/compiler: Un-lower shared/scratch to derefs

Derefs have index-based access semantics, which means we don't need
custom intrinsics to encode an index instead of a byte offset.

Remove the "masked" store intrinsics and just emit the pair of atomics
directly. This massively reduces duplication between scratch, shared,
and constant, while also moving more things into nir so more optimizations
can be done.

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

13 months agomicrosoft/compiler: Use mem_constant instead of shader_temp for consts
Jesse Natalie [Fri, 19 May 2023 16:11:34 +0000 (09:11 -0700)]
microsoft/compiler: Use mem_constant instead of shader_temp for consts

We still use shader_temp as a temporary variable mode to differentiate
which variables have simple deref patterns vs ones that need to be
lowered to ssbo, but then we put it back to mem_constant when we're
done to restore sanity.

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

13 months agomicrosoft/compiler: Emit const accesses as load_deref
Jesse Natalie [Fri, 19 May 2023 15:57:03 +0000 (08:57 -0700)]
microsoft/compiler: Emit const accesses as load_deref

There's a few changes in here that are very inter-related.

First, we stop lowering load_deref on shader_temp to load_ptr_dxil,
and just leave it as load_deref. In order for that to work, we need
the derefs to be in a shape that's acceptable to DXIL, so the only
current producer of shader_temp loads (the CLC frontend) needs to
run some lowering passes on them first.

The DXIL backend is augmented to just write out deref indices while
walking a deref chain, which will get combined in the load op into
a GEP instruction. For non-mesh/raytracing shaders, these are required
to be single-level scalar arrays, but the complexity here is preparation
for when we don't need to do that anymore.

Additionally, the const lookups are changed from using a hash table
to just putting an index on the variable.

All of this together is enough to enable the authored-forever-ago test
which uses indirect array access into a const packed struct. The
load_ptr_dxil handling didn't deal with packed structs / unaligned
accesses, but now that we're in a logical address space with derefs
instead of physical, there's no alignment to deal with anymore and
the fact that it's packed goes out the window.

This removes one custom DXIL intrinsic.

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

13 months agomicrosoft/compiler: Add some more lowering passes for derefs
Jesse Natalie [Thu, 18 May 2023 23:29:40 +0000 (16:29 -0700)]
microsoft/compiler: Add some more lowering passes for derefs

DXIL requires GEP chains to point to a global variable that's a flat
array of primitive types. If we're converting deref chains to GEP
chains, we're effectively in a logical address space, which means
we can do things like change sizes of variables, since we know
they won't alias with anything else. If they could alias, we'd be
lowering them to an explicit I/O op instead. That means we can
start disabling some of the low-bit-size lowering.

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

13 months agomicrosoft/compiler: Improvements to constant -> shader_temp pass used for CL
Jesse Natalie [Thu, 18 May 2023 23:25:45 +0000 (16:25 -0700)]
microsoft/compiler: Improvements to constant -> shader_temp pass used for CL

Now that we try harder for memcpys, we can use nir's complex usage helper.
We also can just mark the vars instead of using a hash map, since location
doesn't mean anything for constant vars.

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

13 months agomicrosoft/compiler: Support vec/struct const vals
Jesse Natalie [Thu, 18 May 2023 23:22:25 +0000 (16:22 -0700)]
microsoft/compiler: Support vec/struct const vals

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

13 months agomicrosoft/clc: Fix progress reporting for some lowering
Jesse Natalie [Mon, 22 May 2023 17:09:06 +0000 (10:09 -0700)]
microsoft/clc: Fix progress reporting for some lowering

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

13 months agomicrosoft/clc: Try harder to optimize memcpys before lowering them
Jesse Natalie [Thu, 18 May 2023 17:49:04 +0000 (10:49 -0700)]
microsoft/clc: Try harder to optimize memcpys before lowering them

For the case of memset, the SPIR-V translator produces a copy from
a byte array of 0s. If we wait to lower memcpys until after types
are sized, we can potentially turn those 0s into SSA zeros and remove
the entire constant array.

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

13 months agonir: Optimize unpacking 16 bit values that were originally packed
Jesse Natalie [Tue, 23 May 2023 22:49:38 +0000 (15:49 -0700)]
nir: Optimize unpacking 16 bit values that were originally packed

I was seeing u2u64 still in my final shader after pack/unpack were
lowered, which sounds to me like some other optimizations are missing
for detecting the post-lowering pack/unpack patterns, but let's at
least add some patterns for the simple cases.

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

13 months agonir: Fix constant expression for unpack_64_4x16
Jesse Natalie [Tue, 23 May 2023 22:48:22 +0000 (15:48 -0700)]
nir: Fix constant expression for unpack_64_4x16

Cc: Mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23173>

13 months agonir_lower_mem_access_bit_sizes: Support unaligned stores via a pair of atomics
Jesse Natalie [Mon, 22 May 2023 22:09:30 +0000 (15:09 -0700)]
nir_lower_mem_access_bit_sizes: Support unaligned stores via a pair of atomics

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

13 months agonir_lower_mem_access_bit_sizes: Move options into a struct
Jesse Natalie [Mon, 12 Jun 2023 21:26:24 +0000 (14:26 -0700)]
nir_lower_mem_access_bit_sizes: Move options into a struct

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

13 months agonir_lower_mem_access_bit_sizes: Add a bit_size input to the callback
Jesse Natalie [Mon, 22 May 2023 16:49:23 +0000 (09:49 -0700)]
nir_lower_mem_access_bit_sizes: Add a bit_size input to the callback

We'd like to use this callback to adjust loads and stores from things
that are unsupported to things that are supported, but if the input
is already supported, we'd prefer not to change it. Rather than making
up a bit size that'd work and doing a bunch of pack/unpack bit math,
only return a different bit size if the input one doesn't work for us
(i.e. can't load enough memory or just an unsupported size entirely).

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

13 months agonir_lower_ubo_vec4: Delete an invalid assert
Jesse Natalie [Mon, 22 May 2023 16:52:21 +0000 (09:52 -0700)]
nir_lower_ubo_vec4: Delete an invalid assert

This pass handles 16-component 8-bit loads, 8-component 16-bit loads,
and 2-component 64-bit loads. The number of components for the fallback
case doesn't need to be 4.

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

13 months agonir: Allow atomics as non-complex uses for var-splitting passes
Jesse Natalie [Fri, 19 May 2023 21:40:17 +0000 (14:40 -0700)]
nir: Allow atomics as non-complex uses for var-splitting passes

The var splitting pass can rearrange the variables as long as their
position in memory doesn't matter. For block-arranged variables,
or things like memcpys or casts, the layout matters, but atomics
don't imply anything about the layout of the overall variable, so
don't treat them as "complex" for this use case.

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

13 months agonir_split_struct_vars: Support more modes and constant initializers
Jesse Natalie [Thu, 18 May 2023 23:16:50 +0000 (16:16 -0700)]
nir_split_struct_vars: Support more modes and constant initializers

Idiomatic DXIL has constants contained within global variables rather
than a big blob of data. Doing this allows us to have 16-bit and 64-bit
data as well, where normally bitcasts would be disallowed on variable
GEP chains.

Unfortunately, DXIL validation requires SOA to be turned into AOS,
which means we need to split structs. We want to be able to run this
on nir_var_mem_constant variables which have constant initializers,
so add a bit of logic to handle that case, and relax the mode validation.
There's nothing special about the modes it was set up to handle.

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

13 months agovtn: Set is_null_constant
Jesse Natalie [Thu, 18 May 2023 17:47:23 +0000 (10:47 -0700)]
vtn: Set is_null_constant

Note that pointers are not considered to be nir null constants, since
a null pointer value might not be 0s.

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

13 months agonir: Add is_null_constant to nir_constant
Jesse Natalie [Thu, 18 May 2023 17:31:50 +0000 (10:31 -0700)]
nir: Add is_null_constant to nir_constant

Indicates that the values contained within are 0s, regardless of
type. Enables some optimizations.

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

13 months agonir_opt_constant_folding: Fix nir_deref_path leak
Jesse Natalie [Thu, 18 May 2023 17:46:54 +0000 (10:46 -0700)]
nir_opt_constant_folding: Fix nir_deref_path leak

Cc: Mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23173>

13 months agomeson: Key whether to build batch decoder on expat
Dylan Baker [Mon, 12 Jun 2023 17:53:58 +0000 (10:53 -0700)]
meson: Key whether to build batch decoder on expat

Instead of on Android. Which allows an end user to turn off expat
without breaking or disabling Intel support. I've additionally
refactored to separate expat and xmlconfig a bit more in the root
meson.build

This does make expat a hard dependency for building Intel tools, despite
the fact that only aubinator actually requires it. This simplifies the
build for the common case, and in the event that someone wants to build
the Intel tools and doesn't have libexpat, they can fall back to the
meson wrap for expat instead.

fixes: 75276deebcf76f8fafa68f4e4ecb29768d98c764
closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8791

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23605>

13 months agodzn: Don't support VK R4G4B4A4_UNORM_PACK16 unless we have B4G4R4A4
Jesse Natalie [Mon, 12 Jun 2023 17:35:42 +0000 (10:35 -0700)]
dzn: Don't support VK R4G4B4A4_UNORM_PACK16 unless we have B4G4R4A4

Fixes: a4ce095bad9 ("dzn: Use A4B4G4R4 instead of B4G4R4A4 when available")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23602>

13 months agomapi: Delete execmem support code.
Emma Anholt [Mon, 5 Jun 2023 23:20:55 +0000 (16:20 -0700)]
mapi: Delete execmem support code.

No longer used now that we don't dynamically generate dispatch stubs.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agomapi: Drop the unused_functions table.
Emma Anholt [Mon, 5 Jun 2023 23:01:49 +0000 (16:01 -0700)]
mapi: Drop the unused_functions table.

Since we don't support loading an older driver with newer loader any more,
we don't need to bother tracking entrypoints that Mesa no longer supports.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agomesa: Drop the aliases from the remap table.
Emma Anholt [Mon, 5 Jun 2023 22:29:11 +0000 (15:29 -0700)]
mesa: Drop the aliases from the remap table.

Mesa core doesn't need to have mapi sanity check that our aliases all map
to the same offset.  That's a build-time decision.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agomapi: Clean up mapi_stub struct.
Emma Anholt [Mon, 5 Jun 2023 22:14:02 +0000 (15:14 -0700)]
mapi: Clean up mapi_stub struct.

We no longer use the address field, and the name is always a size_t offset
in the string pool (never a dynamic strduped name).

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agomesa: Drop the function parameter spec from the remap table.
Emma Anholt [Mon, 5 Jun 2023 22:08:43 +0000 (15:08 -0700)]
mesa: Drop the function parameter spec from the remap table.

Since we don't generate dynamic dispatch stubs any more, we don't need
this data.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agomapi: Delete dynamic stub generation.
Emma Anholt [Mon, 5 Jun 2023 21:16:15 +0000 (14:16 -0700)]
mapi: Delete dynamic stub generation.

Since Mesa drivers are now version-locked to the loader, that means that
we never need to support a newer hardware driver than the loader, and thus
don't need to generate dynamic dispatch stubs.  This is great news, given
that we don't test those paths, and it involved delightful features like
arrays of hex for code to be pasted into executable memory.

More code removal will follow, this is the first cut of "don't generate,
and DCE generation code".

Fixes: #9158

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agomapi: clang-format _glapi_add_dispatch().
Emma Anholt [Mon, 5 Jun 2023 21:40:29 +0000 (14:40 -0700)]
mapi: clang-format _glapi_add_dispatch().

The formatting was so broken I couldn't follow what was going on.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>

13 months agonir: Add interleave_agx instruction
Alyssa Rosenzweig [Wed, 31 May 2023 14:12:58 +0000 (10:12 -0400)]
nir: Add interleave_agx instruction

While this is a generic bit twiddling ALU instruction, it's especially useful
for address calculations, since the architecture's tiled textures use Morton
coding within the tiles.

This will be used when lowering image_texel_address on AGX, as part of the image
atomics implementation. I don't know if there's any other neat uses I could
detect with opt_algebraic, this doesn't seem like an operation a shader would
open-code... Maybe useful for BVH building or something...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23513>

13 months agoagx: Use common nir_steal_tex_src
Alyssa Rosenzweig [Wed, 7 Jun 2023 21:55:45 +0000 (17:55 -0400)]
agx: Use common nir_steal_tex_src

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-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/23513>

13 months agonir/lower_tex: Use nir_steal_tex_src
Alyssa Rosenzweig [Wed, 7 Jun 2023 22:00:45 +0000 (18:00 -0400)]
nir/lower_tex: Use nir_steal_tex_src

The find-remove-use pattern is quite natural for texture lowering :)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-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/23513>

13 months agonir/builder: Add steal_tex_src helper
Alyssa Rosenzweig [Wed, 7 Jun 2023 21:55:10 +0000 (17:55 -0400)]
nir/builder: Add steal_tex_src helper

I have this in the AGX compiler but I want to use it in more places.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-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/23513>

13 months agoaco: validate ir for prologs and after lower_to_hw_instr
Georg Lehmann [Fri, 9 Jun 2023 12:00:06 +0000 (14:00 +0200)]
aco: validate ir for prologs and after lower_to_hw_instr

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23507>

13 months agoaco: don't validate p_constaddr_addlo/p_resumeaddr_addlo operands
Georg Lehmann [Mon, 12 Jun 2023 14:03:58 +0000 (16:03 +0200)]
aco: don't validate p_constaddr_addlo/p_resumeaddr_addlo operands

These can have two literals so validation would fail.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23507>

13 months agoaco: move cfg validation to its own function
Georg Lehmann [Fri, 9 Jun 2023 11:58:18 +0000 (13:58 +0200)]
aco: move cfg validation to its own function

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23507>

13 months agoaco: make validation work without SSA temps
Georg Lehmann [Wed, 7 Jun 2023 18:36:56 +0000 (20:36 +0200)]
aco: make validation work without SSA temps

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23507>

13 months agoradv: Add driconf to force wave64 for RT
Friedrich Vock [Sun, 11 Jun 2023 13:47:50 +0000 (15:47 +0200)]
radv: Add driconf to force wave64 for RT

...and enable it for Hellblade: Senua's Sacrifice.

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

13 months agor600: fix cayman_convert_border_color() swizzle behavior
Patrick Lerda [Mon, 22 May 2023 11:40:31 +0000 (13:40 +0200)]
r600: fix cayman_convert_border_color() swizzle behavior

This change fixes a buffer overflow by implementing the
special swizzles. This behavior is already available with
evergreen_convert_border_color().

For instance, this issue is triggered on a cayman gpu with
"piglit/bin/texwrap bordercolor -auto -fbo" or "piglit/bin/max-samplers -auto -fbo":
==5610==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000012d20 at pc 0x7fb798cb876f bp 0x7ffd78670460 sp 0x7ffd78670458
READ of size 4 at 0x603000012d20 thread T0
    #0 0x7fb798cb876e in cayman_convert_border_color ../src/gallium/drivers/r600/evergreen_state.c:2444
    #1 0x7fb798cb876e in evergreen_emit_sampler_states ../src/gallium/drivers/r600/evergreen_state.c:2539
    #2 0x7fb7989e6cb2 in r600_emit_atom ../src/gallium/drivers/r600/r600_pipe.h:655
    #3 0x7fb7989e6cb2 in r600_draw_vbo ../src/gallium/drivers/r600/r600_state_common.c:2333
    #4 0x7fb7985082c7 in u_vbuf_draw_vbo ../src/gallium/auxiliary/util/u_vbuf.c:1497
    #5 0x7fb796ef2eda in cso_draw_vbo ../src/gallium/auxiliary/cso_cache/cso_context.h:262
    #6 0x7fb796ef2eda in st_draw_gallium_multimode ../src/mesa/state_tracker/st_draw.c:170
    #7 0x7fb7970d9cfd in vbo_exec_vtx_flush ../src/mesa/vbo/vbo_exec_draw.c:341
    #8 0x7fb7970d32d7 in vbo_exec_FlushVertices_internal ../src/mesa/vbo/vbo_exec_api.c:693
    #9 0x7fb7970d32d7 in vbo_exec_FlushVertices ../src/mesa/vbo/vbo_exec_api.c:1193
    #10 0x7fb7975f237c in enable_texture ../src/mesa/main/enable.c:337

Fixes: 923d635357f6 ("r600: fix some border color swizzles on CAYMAN")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23435>

13 months agomesa/atifs: Rename the header guard.
Emma Anholt [Thu, 18 May 2023 21:59:06 +0000 (14:59 -0700)]
mesa/atifs: Rename the header guard.

Just a bit more cleanup as I grep around for "what TGSI is left in the GL
frontend?"

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

13 months agomesa: Drop dead TGSI serialization prototypes.
Emma Anholt [Thu, 18 May 2023 21:58:38 +0000 (14:58 -0700)]
mesa: Drop dead TGSI serialization prototypes.

Fixes: 7221cc765799 ("mesa/st: Remove now unused TGSI paths from disk cache.")

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

13 months agomesa: Simplify st_get_nir_compiler_options().
Emma Anholt [Thu, 18 May 2023 21:36:43 +0000 (14:36 -0700)]
mesa: Simplify st_get_nir_compiler_options().

Since b167203cfe07 ("mesa/st: Always generate NIR from GLSL, and use
nir_to_tgsi for TGSI drivers."), it's always set in the context.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agomesa: Drop TGSI token handling
Emma Anholt [Thu, 18 May 2023 21:12:06 +0000 (14:12 -0700)]
mesa: Drop TGSI token handling

Nothing generates TGSI tokens in the frontend any more.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agomesa: Always query our compute params against IR_NIR.
Emma Anholt [Thu, 18 May 2023 20:57:33 +0000 (13:57 -0700)]
mesa: Always query our compute params against IR_NIR.

We only emit NIR IR, so no sense having this code for querying TGSI
instead.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agosvga: Stop asserting that compute params are queried against TGSI.
Emma Anholt [Thu, 18 May 2023 20:55:35 +0000 (13:55 -0700)]
svga: Stop asserting that compute params are queried against TGSI.

The GL frontend is about to start only querying against NIR, since it only
generates NIR.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agomesa/drawtex: Cut out the TGSI semantic translation.
Emma Anholt [Thu, 18 May 2023 20:36:47 +0000 (13:36 -0700)]
mesa/drawtex: Cut out the TGSI semantic translation.

Now that we don't have to generate TGSI, we can drop an indirection.
Fixing up the types here prompted a little fixup of
st_nir_make_passthrough_shader()'s types.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agogallium: Drop PIPE_SHADER_CAP_PREFERRED_IR.
Emma Anholt [Thu, 18 May 2023 19:58:48 +0000 (12:58 -0700)]
gallium: Drop PIPE_SHADER_CAP_PREFERRED_IR.

Now everyone's saying NIR, and doing any NTT internally.  The only returns
of TGSI were in gallivm_get_shader_param() and
tgsi_exec_get_shader_param(), but the drivers were returning NIR instead
of calling down to them.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agonine: Drop the nir_vs/nir_ps env vars.
Emma Anholt [Thu, 18 May 2023 20:15:09 +0000 (13:15 -0700)]
nine: Drop the nir_vs/nir_ps env vars.

Now that all drivers prefer NIR, there's no need for these.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agosvga: Switch to preferring NIR by default.
Emma Anholt [Thu, 18 May 2023 20:17:13 +0000 (13:17 -0700)]
svga: Switch to preferring NIR by default.

The flag has been here for a long time, it's time for SVGA to start
ingesting NIR like other drivers do.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agonouveau: Delete the NV50_PROG_USE_TGSI env var.
Emma Anholt [Thu, 18 May 2023 20:05:17 +0000 (13:05 -0700)]
nouveau: Delete the NV50_PROG_USE_TGSI env var.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>

13 months agor300: Drop RADEON_DEBUG=use_tgsi.
Emma Anholt [Thu, 18 May 2023 20:20:12 +0000 (13:20 -0700)]
r300: Drop RADEON_DEBUG=use_tgsi.

The NIR path is default, and well-trodden at this point.  By dropping
support for input as TGSI, we get rely on the NIR trig lowering.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23114>