platform/upstream/mesa.git
15 months agozink: add spirv builder function for terminate
Mike Blumenkrantz [Wed, 17 Aug 2022 22:05:21 +0000 (18:05 -0400)]
zink: add spirv builder function for terminate

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

15 months agollvmpipe: fix handling of unused color attachments
Mike Blumenkrantz [Thu, 23 Mar 2023 16:48:53 +0000 (12:48 -0400)]
llvmpipe: fix handling of unused color attachments

if an attachment doesn't have blending or color output from the shader,
nothing should touch the attachment

this is consistent with vulkan spec and needed for upcoming cts coverage

cc: mesa-stable

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

15 months agollvmpipe: fix linear fs analysis with nonzero fs outputs
Mike Blumenkrantz [Thu, 23 Mar 2023 16:10:37 +0000 (12:10 -0400)]
llvmpipe: fix linear fs analysis with nonzero fs outputs

linear fs only works with output 0

cc: mesa-stable

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

15 months agoradv: copy ia_multi_vgt_param to the cmdbuf state
Samuel Pitoiset [Wed, 29 Mar 2023 16:50:27 +0000 (18:50 +0200)]
radv: copy ia_multi_vgt_param to the cmdbuf state

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

15 months agoradv: copy uses_{drawid,baseinstance} to the cmdbuf state
Samuel Pitoiset [Wed, 22 Mar 2023 16:14:35 +0000 (17:14 +0100)]
radv: copy uses_{drawid,baseinstance} to the cmdbuf state

As well as the vertex user sgpr info. This also needs to be copied
for merged shaders (ie. VS+TCS).

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

15 months agoradv: copy rast_prim to the cmdbuf state
Samuel Pitoiset [Wed, 22 Mar 2023 16:26:06 +0000 (17:26 +0100)]
radv: copy rast_prim to the cmdbuf state

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

15 months agoradv: add a helper that returns the current rasterized primitive
Samuel Pitoiset [Thu, 30 Mar 2023 09:43:47 +0000 (11:43 +0200)]
radv: add a helper that returns the current rasterized primitive

For tess/geom/mesh the rasterized primitive is part of the shader
info and primitive topology should be ignored.

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

15 months agoradv: copy custom blend mode to the cmdbuf state
Samuel Pitoiset [Wed, 22 Mar 2023 15:11:46 +0000 (16:11 +0100)]
radv: copy custom blend mode to the cmdbuf state

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

15 months agoradv: rework emitting inner coverage when a fragment shader is bound
Samuel Pitoiset [Mon, 27 Mar 2023 13:42:31 +0000 (15:42 +0200)]
radv: rework emitting inner coverage when a fragment shader is bound

To stop relying on the pipeline. The state is now flagged when a new
fragment shader with a different inner coverage setting is bound.

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

15 months agoradv: remove radv_graphics_pipeline::vb_desc_alloc_size
Samuel Pitoiset [Wed, 29 Mar 2023 14:27:02 +0000 (16:27 +0200)]
radv: remove radv_graphics_pipeline::vb_desc_alloc_size

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

15 months agoradv: remove radv_graphics_pipeline::vb_desc_usage_mask
Samuel Pitoiset [Wed, 29 Mar 2023 14:21:52 +0000 (16:21 +0200)]
radv: remove radv_graphics_pipeline::vb_desc_usage_mask

Use the VS shader info instead.

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

15 months agoradv: adjust vb_desc_usage_mask for dynamic VS inputs in the info pass
Samuel Pitoiset [Wed, 29 Mar 2023 14:33:51 +0000 (16:33 +0200)]
radv: adjust vb_desc_usage_mask for dynamic VS inputs in the info pass

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

15 months agoaco: remove unused aco_shader_info::vb_desc_usage_mask
Samuel Pitoiset [Wed, 29 Mar 2023 14:16:01 +0000 (16:16 +0200)]
aco: remove unused aco_shader_info::vb_desc_usage_mask

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

15 months agoradv: remove radv_graphics_pipeline::can_use_simple_input
Samuel Pitoiset [Wed, 29 Mar 2023 14:12:09 +0000 (16:12 +0200)]
radv: remove radv_graphics_pipeline::can_use_simple_input

Use the VS shader info instead.

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

15 months agoradv: remove radv_graphics_pipeline::next_vertex_stage
Samuel Pitoiset [Wed, 29 Mar 2023 14:05:32 +0000 (16:05 +0200)]
radv: remove radv_graphics_pipeline::next_vertex_stage

Use the active stages bitfield instead.

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

15 months agoradv: remove radv_graphics_pipeline::last_vertex_attrib_bit
Samuel Pitoiset [Wed, 29 Mar 2023 13:53:06 +0000 (15:53 +0200)]
radv: remove radv_graphics_pipeline::last_vertex_attrib_bit

Use the VS shader info instead.

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

15 months agoradv: remove radv_graphics_pipeline::use_per_attribute_vb_descs
Samuel Pitoiset [Wed, 29 Mar 2023 13:49:47 +0000 (15:49 +0200)]
radv: remove radv_graphics_pipeline::use_per_attribute_vb_descs

Use the VS shader info instead.

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

15 months agointel: fix memory leak related to brw_nir_create_passthrough_tcs()
Patrick Lerda [Mon, 27 Mar 2023 09:45:12 +0000 (11:45 +0200)]
intel: fix memory leak related to brw_nir_create_passthrough_tcs()

Indeed, the parameter "mem_ctx" was not processed.

For instance, this issue is triggered with the crocus driver and
"piglit/bin/shader_runner tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test -auto -fbo":
SUMMARY: AddressSanitizer: 235216 byte(s) leaked in 48 allocation(s).

Fixes: 96ba0344db8f ("intel: Use common helpers for TCS passthrough shaders")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22173>

15 months agoradeonsi: don't use alignment_log2 of imported buffers
Pierre-Eric Pelloux-Prayer [Tue, 28 Mar 2023 16:31:05 +0000 (18:31 +0200)]
radeonsi: don't use alignment_log2 of imported buffers

This value isn't passed to the importer by the kernel
so we can't check it.

Fixes: f7a4051b836 ("radeonsi: Check pitch and offset for validity.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8431
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22170>

15 months agodocs: use version-number as toctree-title for relnotes
Erik Faye-Lund [Thu, 16 Mar 2023 13:11:13 +0000 (14:11 +0100)]
docs: use version-number as toctree-title for relnotes

Using the full titles makes most of these take up two lines in the
toctree. The version number is really the only thing we should care
about, though.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21956>

15 months agodocs: move old relnotes to _extra directory
Erik Faye-Lund [Fri, 17 Mar 2023 12:58:44 +0000 (13:58 +0100)]
docs: move old relnotes to _extra directory

These aren't built, so they won't get copied out into the public folder
unless we put is inside the _extra folder.

This has been broken all since the conversion to Sphinx, whoops!

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21956>

15 months agovenus: Enable VK_EXT_memory_budget
Lina Versace [Thu, 23 Mar 2023 20:57:08 +0000 (13:57 -0700)]
venus: Enable VK_EXT_memory_budget

Tested dEQP-VK.info.device_memory_budget on Intel with vtest.  When the
test is ran at approximately the same time on the native driver and on
vtest, the qpa result files each report approximately the same memory
budget.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>

15 months agovenus: Refactor vn_physical_device_init_memory_properties
Lina Versace [Thu, 23 Mar 2023 20:57:08 +0000 (13:57 -0700)]
venus: Refactor vn_physical_device_init_memory_properties

Improve readability.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>

15 months agovenus: Delete vn_renderer_info::has_cache_management
Lina Versace [Thu, 23 Mar 2023 20:57:07 +0000 (13:57 -0700)]
venus: Delete vn_renderer_info::has_cache_management

It has been false since commit 247232d59692, when Venus was merged
upstream in April 2021.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>

15 months agovenus: Update protocol for VK_EXT_memory_budget
Lina Versace [Thu, 23 Mar 2023 20:57:07 +0000 (13:57 -0700)]
venus: Update protocol for VK_EXT_memory_budget

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>

15 months agonvc0: enable fp helper invocation memory loads on Turing+
Karol Herbst [Wed, 22 Mar 2023 21:10:55 +0000 (22:10 +0100)]
nvc0: enable fp helper invocation memory loads on Turing+

Starting with GSP this will be the only way of doing so, for older gens
we'll just fix it up on the kernel side.

Cc: mesa-stable
Acked-by: M Henning <drawoc@darkrefraction.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21989>

15 months agoradv: use serialized NIR for graphics libs with the RETAIN flag
Samuel Pitoiset [Mon, 27 Mar 2023 16:00:39 +0000 (18:00 +0200)]
radv: use serialized NIR for graphics libs with the RETAIN flag

Cloning NIR shaders consumes too much RAM and this can easily explode
in memory for games that create a ton of graphics libraries. Using
serialized NIR shaders help considerably.

This reduces RAM usage in dota2 with GPL from 3GiB to 400MiB.

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

15 months agoci/broadcom: slightly increase coverage of vk tests
Eric Engestrom [Mon, 13 Mar 2023 22:40:40 +0000 (22:40 +0000)]
ci/broadcom: slightly increase coverage of vk tests

The previous commit has freed up a couple of runners, so let's repurpose
them to make vk test jobs take less time; with that spare time, let's
increase the coverage a little bit.

Most jobs now take 10-12 minutes, just like they used to.

Stress-tested over 40+ runs.

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

15 months agoci/broadcom: consolidate v3d-rpi4* jobs into a single v3d-rpi4-gl:armhf
Eric Engestrom [Mon, 13 Mar 2023 19:14:05 +0000 (19:14 +0000)]
ci/broadcom: consolidate v3d-rpi4* jobs into a single v3d-rpi4-gl:armhf

Using now 12 instead of 14 runners, most jobs take 11-13 minutes, which
is about the same as when they were all running separately (10-13 min).

Stress-tested over 8 runs.

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

15 months agoci/broadcom: consolidate vc4-rpi3* jobs into a single vc4-rpi3-gl:armhf
Eric Engestrom [Mon, 13 Mar 2023 19:10:57 +0000 (19:10 +0000)]
ci/broadcom: consolidate vc4-rpi3* jobs into a single vc4-rpi3-gl:armhf

Without reducing the coverage and using 4 runners instead of 9, most
runs take 10-13 minutes instead of 12-13 minutes for the egl job, 9-11
minutes for the piglit job, and 6-8 minutes for the deqp job.

Stress-tested over 40+ runs.

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

15 months agoRevert "CI: Disable freedreno"
Rob Clark [Tue, 28 Mar 2023 15:48:02 +0000 (08:48 -0700)]
Revert "CI: Disable freedreno"

This reverts commit 6a16ed8d7949424f160cb2f1a17bc71d892ee66e.

The proxy has been rebooted

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

15 months agoradv: Move I/O lowering functions into a new file.
Timur Kristóf [Wed, 29 Mar 2023 20:30:45 +0000 (22:30 +0200)]
radv: Move I/O lowering functions into a new file.

Also ran clang-format on the affected code.

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

15 months agoradv, ac/nir: Move sin/cos lowering to a common pass.
Timur Kristóf [Wed, 29 Mar 2023 17:28:42 +0000 (19:28 +0200)]
radv, ac/nir: Move sin/cos lowering to a common pass.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_export_multiview to new file.
Timur Kristóf [Wed, 29 Mar 2023 17:12:41 +0000 (19:12 +0200)]
radv: Move radv_nir_export_multiview to new file.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_lower_viewport_to_zero to new file.
Timur Kristóf [Wed, 29 Mar 2023 17:12:06 +0000 (19:12 +0200)]
radv: Move radv_nir_lower_viewport_to_zero to new file.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_lower_view_index to new file.
Timur Kristóf [Thu, 16 Mar 2023 20:25:16 +0000 (13:25 -0700)]
radv: Move radv_nir_lower_view_index to new file.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_lower_intrinsics_early to new file.
Timur Kristóf [Wed, 29 Mar 2023 16:54:07 +0000 (18:54 +0200)]
radv: Move radv_nir_lower_intrinsics_early to new file.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_lower_fs_intrinsics to new file.
Timur Kristóf [Wed, 29 Mar 2023 16:46:11 +0000 (18:46 +0200)]
radv: Move radv_nir_lower_fs_intrinsics to new file.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_lower_primitive_shading_rate to new file.
Timur Kristóf [Thu, 16 Mar 2023 20:05:07 +0000 (13:05 -0700)]
radv: Move radv_nir_lower_primitive_shading_rate to new file.

Also ran clang-format on the affected code.

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

15 months agoradv: Move radv_nir_* to a new folder.
Timur Kristóf [Tue, 28 Mar 2023 20:13:23 +0000 (22:13 +0200)]
radv: Move radv_nir_* to a new folder.

Also ran clang-format on the affected code.

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

15 months agokopper: apply ancillary invalidation through glthread on swapbuffers
Mike Blumenkrantz [Tue, 14 Mar 2023 20:54:07 +0000 (16:54 -0400)]
kopper: apply ancillary invalidation through glthread on swapbuffers

this fixes invalidations with tc's renderpass parsing so they get picked
up before the renderpass ends

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

15 months agoglthread: add _mesa_glthread_invalidate_zsbuf()
Mike Blumenkrantz [Tue, 14 Mar 2023 20:53:46 +0000 (16:53 -0400)]
glthread: add _mesa_glthread_invalidate_zsbuf()

this allows frontends to trigger ancillary invalidation before syncing

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

15 months agomapi: add InternalInvalidateFramebufferAncillaryMESA
Mike Blumenkrantz [Tue, 14 Mar 2023 20:53:15 +0000 (16:53 -0400)]
mapi: add InternalInvalidateFramebufferAncillaryMESA

this allows glthread to handle ancillary buffer invalidation

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

15 months agolavapipe: move default rasterizer state values to rendering_state init
Mike Blumenkrantz [Mon, 13 Mar 2023 18:19:03 +0000 (14:19 -0400)]
lavapipe: move default rasterizer state values to rendering_state init

these should always be set

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

15 months agolavapipe: avoid uniformly unsetting gs_output_lines
Mike Blumenkrantz [Mon, 13 Mar 2023 17:36:30 +0000 (13:36 -0400)]
lavapipe: avoid uniformly unsetting gs_output_lines

instead fix the conditional now that it's possible to tell whether
a gs is bound

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

15 months agolavapipe: only unset tess_states pointers on tes bind
Mike Blumenkrantz [Mon, 13 Mar 2023 17:36:03 +0000 (13:36 -0400)]
lavapipe: only unset tess_states pointers on tes bind

this is otherwise irrelevant

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

15 months agolavapipe: only update shader access for bind/unbind stages
Mike Blumenkrantz [Mon, 13 Mar 2023 17:33:55 +0000 (13:33 -0400)]
lavapipe: only update shader access for bind/unbind stages

also squash a loop

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

15 months agolavapipe: split out gfx stage unbinding
Mike Blumenkrantz [Mon, 13 Mar 2023 17:23:07 +0000 (13:23 -0400)]
lavapipe: split out gfx stage unbinding

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

15 months agolavapipe: don't double unbind gfx stages on pipeline bind
Mike Blumenkrantz [Mon, 13 Mar 2023 17:22:47 +0000 (13:22 -0400)]
lavapipe: don't double unbind gfx stages on pipeline bind

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

15 months agolavapipe: dynamically bind noop fs at draw time when needed
Mike Blumenkrantz [Mon, 13 Mar 2023 17:21:56 +0000 (13:21 -0400)]
lavapipe: dynamically bind noop fs at draw time when needed

this is simpler than special casing it everywhere

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

15 months agolavapipe: unify lvp_pipeline_nir creation
Mike Blumenkrantz [Tue, 7 Mar 2023 17:09:09 +0000 (12:09 -0500)]
lavapipe: unify lvp_pipeline_nir creation

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

15 months agolavapipe: add a ref for the tess_ccw nir on creation
Mike Blumenkrantz [Tue, 7 Mar 2023 16:58:31 +0000 (11:58 -0500)]
lavapipe: add a ref for the tess_ccw nir on creation

not sure if it matters but good to be consistent

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

15 months agolavapipe: refactor pipeline destroy a bit
Mike Blumenkrantz [Tue, 7 Mar 2023 15:15:56 +0000 (10:15 -0500)]
lavapipe: refactor pipeline destroy a bit

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

15 months agolavapipe: delete unused struct member
Mike Blumenkrantz [Mon, 6 Mar 2023 22:30:36 +0000 (17:30 -0500)]
lavapipe: delete unused struct member

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

15 months agolavapipe: break out all the important parts of gfx pipeline setting for reuse
Mike Blumenkrantz [Mon, 6 Mar 2023 22:19:07 +0000 (17:19 -0500)]
lavapipe: break out all the important parts of gfx pipeline setting for reuse

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

15 months agolavapipe: pull out dynamic tess origin check in gfx pipeline bind
Mike Blumenkrantz [Mon, 6 Mar 2023 22:10:21 +0000 (17:10 -0500)]
lavapipe: pull out dynamic tess origin check in gfx pipeline bind

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

15 months agolavapipe: don't access pipeline shader structs as much during bind
Mike Blumenkrantz [Mon, 6 Mar 2023 22:07:28 +0000 (17:07 -0500)]
lavapipe: don't access pipeline shader structs as much during bind

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

15 months agolavapipe: PIPE_SHADER_ -> MESA_SHADER_
Mike Blumenkrantz [Mon, 6 Mar 2023 22:05:02 +0000 (17:05 -0500)]
lavapipe: PIPE_SHADER_ -> MESA_SHADER_

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

15 months agolavapipe: merge some loops in handle_graphics_pipeline()
Mike Blumenkrantz [Mon, 6 Mar 2023 22:01:13 +0000 (17:01 -0500)]
lavapipe: merge some loops in handle_graphics_pipeline()

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

15 months agolavapipe: refactor compute shader binding
Mike Blumenkrantz [Mon, 6 Mar 2023 21:50:53 +0000 (16:50 -0500)]
lavapipe: refactor compute shader binding

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

15 months agolavapipe: stop using rendering_state::pipeline
Mike Blumenkrantz [Mon, 6 Mar 2023 21:46:32 +0000 (16:46 -0500)]
lavapipe: stop using rendering_state::pipeline

access shaders directly now

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

15 months agolavapipe: add a device member to rendering_state
Mike Blumenkrantz [Mon, 6 Mar 2023 21:46:03 +0000 (16:46 -0500)]
lavapipe: add a device member to rendering_state

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

15 months agolavapipe: track bound shader stages on rendering_state
Mike Blumenkrantz [Mon, 6 Mar 2023 21:45:36 +0000 (16:45 -0500)]
lavapipe: track bound shader stages on rendering_state

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

15 months agolavapipe: refactor shader compile functions to not take pipeline params
Mike Blumenkrantz [Mon, 6 Mar 2023 21:44:30 +0000 (16:44 -0500)]
lavapipe: refactor shader compile functions to not take pipeline params

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

15 months agolavapipe: don't memcpy tess_ccw when copying pipeline library shaders
Mike Blumenkrantz [Wed, 15 Mar 2023 11:27:12 +0000 (07:27 -0400)]
lavapipe: don't memcpy tess_ccw when copying pipeline library shaders

this gets handled later

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

15 months agolavapipe: always copy streamout info when creating shaders
Mike Blumenkrantz [Mon, 6 Mar 2023 21:28:23 +0000 (16:28 -0500)]
lavapipe: always copy streamout info when creating shaders

llvmpipe should be smart enough to figure this out internally

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

15 months agoci/radeonsi: Skip really slow tests on stoney
Daniel Stone [Tue, 14 Mar 2023 16:01:50 +0000 (16:01 +0000)]
ci/radeonsi: Skip really slow tests on stoney

These allocate way more memory than is reasonable, a bunch of times. I'd
guess they pushed the machine pretty deep into memory pressure which is
why it was all taking like 3 minutes.

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

15 months agoci/radeonsi: sort and dedup stoney skips
Daniel Stone [Tue, 14 Mar 2023 16:00:33 +0000 (16:00 +0000)]
ci/radeonsi: sort and dedup stoney skips

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

15 months agoaco: add tests for neg(mul) with opsel
Georg Lehmann [Sun, 26 Mar 2023 20:38:24 +0000 (22:38 +0200)]
aco: add tests for neg(mul) with opsel

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

15 months agoaco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11
Georg Lehmann [Sun, 26 Mar 2023 20:25:02 +0000 (22:25 +0200)]
aco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11

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

15 months agoaco: add test for min/max combining with opsel
Georg Lehmann [Sun, 26 Mar 2023 20:01:57 +0000 (22:01 +0200)]
aco: add test for min/max combining with opsel

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

15 months agoaco: add tests for cmp ordering with opsel
Georg Lehmann [Sun, 26 Mar 2023 19:31:48 +0000 (21:31 +0200)]
aco: add tests for cmp ordering with opsel

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

15 months agoaco: add tests for swap operand with opsel
Georg Lehmann [Sun, 26 Mar 2023 19:00:55 +0000 (21:00 +0200)]
aco: add tests for swap operand with opsel

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

15 months agoaco: add tests for dpp with opsel
Georg Lehmann [Sun, 26 Mar 2023 18:26:08 +0000 (20:26 +0200)]
aco: add tests for dpp with opsel

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

15 months agoaco: add tests for fma with opsel
Georg Lehmann [Tue, 21 Mar 2023 13:24:28 +0000 (14:24 +0100)]
aco: add tests for fma with opsel

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

15 months agoaco/optimizer: remove to_SDWA
Georg Lehmann [Wed, 22 Mar 2023 18:58:28 +0000 (19:58 +0100)]
aco/optimizer: remove to_SDWA

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

15 months agoaco: keep label_mul/usedef/minmax in apply_extract
Georg Lehmann [Thu, 9 Mar 2023 13:53:34 +0000 (14:53 +0100)]
aco: keep label_mul/usedef/minmax in apply_extract

16bit int mad/fma/minmax combining can work with opsel set.

All other optimizations should already check if the instruction uses sdwa,
because we don't check this when applying the label initially.

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

15 months agoaco/optimizer: use opsel for VOP12C
Georg Lehmann [Tue, 21 Mar 2023 12:29:15 +0000 (13:29 +0100)]
aco/optimizer: use opsel for VOP12C

Foz-DB GFX1100:
Totals from 11759 (8.72% of 134864) affected shaders:
VGPRs: 848288 -> 844556 (-0.44%); split: -0.44%, +0.00%
SpillSGPRs: 8527 -> 8543 (+0.19%)
SpillVGPRs: 1411 -> 1423 (+0.85%); split: -0.21%, +1.06%
CodeSize: 114337120 -> 113882472 (-0.40%); split: -0.40%, +0.01%
Scratch: 128768 -> 129024 (+0.20%); split: -0.20%, +0.40%
MaxWaves: 250962 -> 252014 (+0.42%)
Instrs: 22187426 -> 22062378 (-0.56%); split: -0.57%, +0.00%
Latency: 232655375 -> 232376977 (-0.12%); split: -0.20%, +0.08%
InvThroughput: 28292530 -> 28217699 (-0.26%); split: -0.45%, +0.18%
VClause: 352463 -> 352364 (-0.03%); split: -0.12%, +0.10%
SClause: 659282 -> 659354 (+0.01%); split: -0.02%, +0.04%
Copies: 1371369 -> 1342340 (-2.12%); split: -2.30%, +0.19%
Branches: 495903 -> 495941 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 867295 -> 863664 (-0.42%)
PreVGPRs: 793480 -> 790549 (-0.37%)

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

15 months agoaco/gfx11: allow opsel for VOP12C
Georg Lehmann [Tue, 21 Mar 2023 12:26:19 +0000 (13:26 +0100)]
aco/gfx11: allow opsel for VOP12C

Foz-DB GFX1100:
Totals from 515 (0.38% of 134864) affected shaders:
CodeSize: 2768228 -> 2761076 (-0.26%)
Instrs: 520301 -> 518523 (-0.34%)
Latency: 5190860 -> 5187254 (-0.07%)
InvThroughput: 2120844 -> 2119447 (-0.07%)
Copies: 57238 -> 56101 (-1.99%)

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

15 months agoaco: don't label mul with opsel as abs/neg
Georg Lehmann [Fri, 24 Mar 2023 12:35:07 +0000 (13:35 +0100)]
aco: don't label mul with opsel as abs/neg

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

15 months agoaco/ir: copy opsel when converting to DPP
Georg Lehmann [Thu, 23 Mar 2023 12:14:05 +0000 (13:14 +0100)]
aco/ir: copy opsel when converting to DPP

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

15 months agoaco: swap opsel when swapping VOP2/C operands
Georg Lehmann [Thu, 23 Mar 2023 12:10:58 +0000 (13:10 +0100)]
aco: swap opsel when swapping VOP2/C operands

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

15 months agoaco: return true in usesModifiers for VOP12C with opsel
Georg Lehmann [Fri, 24 Mar 2023 16:08:56 +0000 (17:08 +0100)]
aco: return true in usesModifiers for VOP12C with opsel

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

15 months agoaco: support neg(mul)/abs(mul) optimization in more cases
Georg Lehmann [Fri, 24 Mar 2023 12:30:01 +0000 (13:30 +0100)]
aco: support neg(mul)/abs(mul) optimization in more cases

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

15 months agoaco: support v_cvt_f32_f16 with opsel in combine_mad_mix
Georg Lehmann [Fri, 24 Mar 2023 10:13:45 +0000 (11:13 +0100)]
aco: support v_cvt_f32_f16 with opsel in combine_mad_mix

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

15 months agoaco: update match_op3_for_vop3 for VOP12C opsel
Georg Lehmann [Wed, 22 Mar 2023 18:31:17 +0000 (19:31 +0100)]
aco: update match_op3_for_vop3 for VOP12C opsel

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

15 months agoaco: handle opsel in combine_constant_comparison_ordering
Georg Lehmann [Tue, 28 Mar 2023 19:48:04 +0000 (21:48 +0200)]
aco: handle opsel in combine_constant_comparison_ordering

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

15 months agoaco: handle opsel in combine_ordering_test
Georg Lehmann [Wed, 22 Mar 2023 18:52:10 +0000 (19:52 +0100)]
aco: handle opsel in combine_ordering_test

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

15 months agoaco: handle opsel in combine_comparison_ordering
Georg Lehmann [Wed, 22 Mar 2023 18:41:21 +0000 (19:41 +0100)]
aco: handle opsel in combine_comparison_ordering

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

15 months agoaco/optimizer: preserve opsel when fusing fma
Georg Lehmann [Tue, 21 Mar 2023 12:19:59 +0000 (13:19 +0100)]
aco/optimizer: preserve opsel when fusing fma

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

15 months agoaco/ra: prepare for VOP12C opsel
Georg Lehmann [Tue, 21 Mar 2023 11:39:26 +0000 (12:39 +0100)]
aco/ra: prepare for VOP12C opsel

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

15 months agoaco/to_hw_instr: use VOP1 opsel for v_mov_b16
Georg Lehmann [Tue, 21 Mar 2023 11:27:28 +0000 (12:27 +0100)]
aco/to_hw_instr: use VOP1 opsel for v_mov_b16

Foz-DB GFX1100:
Totals from 4661 (3.46% of 134864) affected shaders:
CodeSize: 36500568 -> 36391704 (-0.30%)

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

15 months agoaco: validate VOP12C opsel
Georg Lehmann [Tue, 21 Mar 2023 11:07:51 +0000 (12:07 +0100)]
aco: validate VOP12C opsel

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

15 months agoaco/assembler: support VOP12C opsel
Georg Lehmann [Tue, 21 Mar 2023 10:54:33 +0000 (11:54 +0100)]
aco/assembler: support VOP12C opsel

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

15 months agoaco/vn: hash opsel for VOP12C
Georg Lehmann [Wed, 22 Mar 2023 10:32:04 +0000 (11:32 +0100)]
aco/vn: hash opsel for VOP12C

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

15 months agoaco/ra: don't reallocate VOP3 instruction for non-vcc lane mask
Georg Lehmann [Wed, 29 Mar 2023 15:59:15 +0000 (17:59 +0200)]
aco/ra: don't reallocate VOP3 instruction for non-vcc lane mask

This would need to copy opsel soon but we can just reuse the old instruction.

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

15 months agoaco: Un-swap addressable VGPRs/SGPRs in RT prolog
Friedrich Vock [Wed, 29 Mar 2023 14:51:24 +0000 (16:51 +0200)]
aco: Un-swap addressable VGPRs/SGPRs in RT prolog

Fixes: 6446b791681 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>

15 months agoradv/rt: Also adjust the SGPR count in postprocess_rt_config
Friedrich Vock [Wed, 29 Mar 2023 14:04:54 +0000 (16:04 +0200)]
radv/rt: Also adjust the SGPR count in postprocess_rt_config

Fixes: bea022d1f6a ("radv/rt: Add shader config combination/postprocessing utils")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>

15 months agoperfetto: Move intel's cmdbuf/queue annotation code to the shared util.
Emma Anholt [Thu, 16 Mar 2023 22:46:46 +0000 (15:46 -0700)]
perfetto: Move intel's cmdbuf/queue annotation code to the shared util.

This will let other drivers use the same way of presenting annotations
without duplicating the whole hash table thing.

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

15 months agoperfetto: Deduplicate clock sync packet emit from renderstage sources.
Emma Anholt [Thu, 16 Mar 2023 20:21:44 +0000 (13:21 -0700)]
perfetto: Deduplicate clock sync packet emit from renderstage sources.

This is way more horrifying than I hoped -- I can't figure out a way to
have the method be on TraceContext, so it's a static method of the
datasource, but then you have to name the templated types over and over.
You have to pass in a TraceContext because intel emits the clock sync
packet within a Trace(), and perfetto just silently corrupts the trace if
you Trace() in a Trace().

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