platform/upstream/mesa.git
2 years agopvr: csbgen: Remove "dim" functionality from Group
Matt Coster [Fri, 13 May 2022 09:19:51 +0000 (10:19 +0100)]
pvr: csbgen: Remove "dim" functionality from Group

This allowed for nested groups rendered as arrays. Support for this had
mostly been removed already; this removes the additional value to make
typing easier.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>

2 years agopvr: csbgen: Cleanup imports
Matt Coster [Fri, 13 May 2022 09:34:35 +0000 (10:34 +0100)]
pvr: csbgen: Cleanup imports

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>

2 years agopvr: csbgen: Make some loops more pythonic
Matt Coster [Fri, 13 May 2022 09:31:37 +0000 (10:31 +0100)]
pvr: csbgen: Make some loops more pythonic

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>

2 years agopvr: csbgen: Add a missing @staticmethod decorator
Matt Coster [Mon, 23 May 2022 08:48:39 +0000 (09:48 +0100)]
pvr: csbgen: Add a missing @staticmethod decorator

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>

2 years agopvr: csbgen: Formatting pass (PEP-8 plus other minor changes)
Matt Coster [Fri, 13 May 2022 09:30:05 +0000 (10:30 +0100)]
pvr: csbgen: Formatting pass (PEP-8 plus other minor changes)

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16884>

2 years agoradv: Implement mesh shader scratch ring.
Timur Kristóf [Fri, 20 May 2022 16:12:36 +0000 (18:12 +0200)]
radv: Implement mesh shader scratch ring.

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

2 years agoac/nir/ngg: Use variables for outputs without cross-invocation access.
Timur Kristóf [Thu, 26 May 2022 17:54:48 +0000 (19:54 +0200)]
ac/nir/ngg: Use variables for outputs without cross-invocation access.

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

2 years agoac/nir/ngg: Use mesh shader scratch ring when outputs don't fit LDS.
Timur Kristóf [Fri, 20 May 2022 16:09:12 +0000 (18:09 +0200)]
ac/nir/ngg: Use mesh shader scratch ring when outputs don't fit LDS.

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

2 years agoac/nir/ngg: Clean up mesh shader output LDS layout.
Timur Kristóf [Fri, 20 May 2022 13:27:03 +0000 (15:27 +0200)]
ac/nir/ngg: Clean up mesh shader output LDS layout.

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

2 years agonir: Introduce new intrinsics for AMD specific mesh shader task ring.
Timur Kristóf [Wed, 1 Jun 2022 12:32:39 +0000 (14:32 +0200)]
nir: Introduce new intrinsics for AMD specific mesh shader task ring.

The mesh shader task ring is a buffer in VRAM which we will use to
store some mesh shader outputs that don't fit into LDS.

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

2 years agoradv: Implement task shader draw and payload rings.
Timur Kristóf [Wed, 11 May 2022 22:40:39 +0000 (00:40 +0200)]
radv: Implement task shader draw and payload rings.

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

2 years agoac: Add task shader ring information.
Timur Kristóf [Tue, 31 May 2022 11:20:23 +0000 (13:20 +0200)]
ac: Add task shader ring information.

Similarly to tessellation rings information, move the task
rings info to ac_gpu_info.

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

2 years agoac: Add RDNA2 task+mesh shader draw packet opcodes.
Timur Kristóf [Tue, 31 May 2022 16:43:52 +0000 (18:43 +0200)]
ac: Add RDNA2 task+mesh shader draw packet opcodes.

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

2 years agopvr: Fix incorrect samples to cr_isp_aa_mode conversion.
Karmjit Mahil [Mon, 30 May 2022 10:30:07 +0000 (11:30 +0100)]
pvr: Fix incorrect samples to cr_isp_aa_mode conversion.

This commit fixes the use of 'case 3' where 'case 4' should have
been.

Reported-by: Matt Coster <matt.coster@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16883>

2 years agopvr: Write immutable descriptor words in vkAllocateDescriptorSets().
Karmjit Mahil [Fri, 25 Feb 2022 17:06:38 +0000 (17:06 +0000)]
pvr: Write immutable descriptor words in vkAllocateDescriptorSets().

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16883>

2 years agopvr: Add csb enum helper funciton header.
Karmjit Mahil [Thu, 26 May 2022 13:22:08 +0000 (14:22 +0100)]
pvr: Add csb enum helper funciton header.

A new header is introduced which groups all vk, uint, rogue types
to csb enum type conversions.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16883>

2 years agoradv, aco: Lower txf offset in NIR.
Georg Lehmann [Sat, 4 Jun 2022 18:04:13 +0000 (20:04 +0200)]
radv, aco: Lower txf offset in NIR.

Foz-DB Navi21:
Totals from 384 (0.28% of 134913) affected shaders:
VGPRs: 29736 -> 29536 (-0.67%)
CodeSize: 2455796 -> 2452652 (-0.13%); split: -0.13%, +0.01%
MaxWaves: 6350 -> 6358 (+0.13%)
Instrs: 457743 -> 456273 (-0.32%); split: -0.33%, +0.01%
Latency: 6680266 -> 6730612 (+0.75%); split: -0.03%, +0.78%
InvThroughput: 1562936 -> 1599375 (+2.33%); split: -0.05%, +2.38%
VClause: 9258 -> 9291 (+0.36%); split: -0.14%, +0.50%
SClause: 15713 -> 15707 (-0.04%); split: -0.08%, +0.04%
Copies: 26878 -> 27021 (+0.53%); split: -0.03%, +0.56%
PreVGPRs: 27259 -> 27230 (-0.11%); split: -0.11%, +0.01%

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16869>

2 years agoradeonsi: set size in si_texture_get_handle
Pierre-Eric Pelloux-Prayer [Wed, 1 Jun 2022 08:48:58 +0000 (10:48 +0200)]
radeonsi: set size in si_texture_get_handle

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

2 years agova/surface: set the correct size in vaExportSurfaceHandle
Pierre-Eric Pelloux-Prayer [Wed, 1 Jun 2022 08:46:11 +0000 (10:46 +0200)]
va/surface: set the correct size in vaExportSurfaceHandle

The size must be the size of the total object, not the size
of the resource.
For instance, when using a single object for a multi-plane
format, the size of each plane should be equal to the size
of the underlying object to match libva's documentation:

        /** Total size of this object (may include regions which are
         *  not part of the surface). */
        uint32_t size;

Fixes: 13b79266e47 ("frontend/va: Setting the size of VADRMPRIMESurfaceDescriptor")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16813>

2 years agogallium: add size attribute to winsys_handle
Pierre-Eric Pelloux-Prayer [Wed, 1 Jun 2022 08:45:09 +0000 (10:45 +0200)]
gallium: add size attribute to winsys_handle

This is needed at least for the VA-API frontend where the exporter
needs to know the total size of the object.

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

2 years agogallium: update winsys_handle documentation
Pierre-Eric Pelloux-Prayer [Wed, 1 Jun 2022 08:45:01 +0000 (10:45 +0200)]
gallium: update winsys_handle documentation

The function names are resource_***_handle, not textures_***_handles.

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

2 years agozink: only update layout when doing mixed zs attachment renderpass check
Mike Blumenkrantz [Tue, 7 Jun 2022 00:54:53 +0000 (20:54 -0400)]
zink: only update layout when doing mixed zs attachment renderpass check

avoid doing any sort of extra work here and avoid multi-context weirdness

cc: mesa-stable

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

2 years agozink: break out of zs mixed layout update loop when work is done
Mike Blumenkrantz [Tue, 7 Jun 2022 00:54:25 +0000 (20:54 -0400)]
zink: break out of zs mixed layout update loop when work is done

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

2 years agointel: Build mi_builder_test whenever build-tests is set
Jordan Justen [Tue, 7 Jun 2022 06:15:27 +0000 (23:15 -0700)]
intel: Build mi_builder_test whenever build-tests is set

Previously `install-intel-gpu-tests` controlled this, but now
`install-intel-gpu-tests` will only be used to decide if it should be
installed.

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

2 years agolavapipe: Use vk_image_buffer_copy_layout
Jason Ekstrand [Mon, 6 Jun 2022 13:52:24 +0000 (08:52 -0500)]
lavapipe: Use vk_image_buffer_copy_layout

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agopanvk: Use vk_image_buffer_copy_layout
Jason Ekstrand [Mon, 6 Jun 2022 13:27:41 +0000 (08:27 -0500)]
panvk: Use vk_image_buffer_copy_layout

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agoradv: Use vk_image_buffer_copy_layout
Jason Ekstrand [Mon, 6 Jun 2022 13:22:12 +0000 (08:22 -0500)]
radv: Use vk_image_buffer_copy_layout

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

2 years agovulkan,radv: Steal some image offset/extent helpers from radv
Jason Ekstrand [Sun, 5 Jun 2022 04:30:21 +0000 (23:30 -0500)]
vulkan,radv: Steal some image offset/extent helpers from radv

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agoanv: Use the common image<->buffer copy helper
Jason Ekstrand [Sun, 5 Jun 2022 04:07:51 +0000 (23:07 -0500)]
anv: Use the common image<->buffer copy helper

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

2 years agovulkan: Add a helper for image<->buffer copies
Jason Ekstrand [Sun, 5 Jun 2022 04:00:51 +0000 (23:00 -0500)]
vulkan: Add a helper for image<->buffer copies

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agovulkan/format: Add a vk_format_get_aspect_format helper
Jason Ekstrand [Mon, 6 Jun 2022 16:32:43 +0000 (11:32 -0500)]
vulkan/format: Add a vk_format_get_aspect_format helper

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agovulkan,radv: Move vk_format_get_plane_format to common code
Jason Ekstrand [Mon, 6 Jun 2022 16:25:45 +0000 (11:25 -0500)]
vulkan,radv: Move vk_format_get_plane_format to common code

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agoradv: Use the common image offset/extent sanitize helpers
Jason Ekstrand [Sun, 5 Jun 2022 03:33:37 +0000 (22:33 -0500)]
radv: Use the common image offset/extent sanitize helpers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agovulkan,anv: Move the image offset/extent sanitize helpers to common code
Jason Ekstrand [Sun, 5 Jun 2022 03:22:15 +0000 (22:22 -0500)]
vulkan,anv: Move the image offset/extent sanitize helpers to common code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16873>

2 years agottn: Populate the images/textures/samplers_used fields in shader_info
Jason Ekstrand [Tue, 7 Jun 2022 15:59:23 +0000 (10:59 -0500)]
ttn: Populate the images/textures/samplers_used fields in shader_info

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6630
Fixes: 625b352f14b7 ("nir: Set image_buffers and msaa_images in lower_samplers_as_deref")
Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16910>

2 years agod3d12: Report PIPE_CAP_ACCELERATED as 0 on WARP
Jesse Natalie [Mon, 6 Jun 2022 16:30:59 +0000 (09:30 -0700)]
d3d12: Report PIPE_CAP_ACCELERATED as 0 on WARP

Acked-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16892>

2 years agodocs: Fixes dispatch.rst with __THREAD_INITIAL_EXEC
Yonggang Luo [Sat, 9 Apr 2022 14:50:04 +0000 (22:50 +0800)]
docs: Fixes dispatch.rst with __THREAD_INITIAL_EXEC

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16858>

2 years agopvr: Remove clang-format off comment from vk_format.h
Rajnesh Kanwal [Tue, 24 May 2022 13:17:09 +0000 (14:17 +0100)]
pvr: Remove clang-format off comment from vk_format.h

This enables clang formatting for vk_format.h. This was disabled
as we were using tabs for indentation and vk_format.h uses three
spaces for indentation.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Move transfer logic to pvr_job_transfer.[ch]
Rajnesh Kanwal [Tue, 19 Apr 2022 16:21:16 +0000 (17:21 +0100)]
pvr: Move transfer logic to pvr_job_transfer.[ch]

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Add services winsys transfer cmd submit interface.
Rajnesh Kanwal [Tue, 19 Apr 2022 15:36:43 +0000 (16:36 +0100)]
pvr: Add services winsys transfer cmd submit interface.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Change ALIGN macro to ALIGN_ATTR.
Rajnesh Kanwal [Mon, 30 May 2022 15:57:55 +0000 (16:57 +0100)]
pvr: Change ALIGN macro to ALIGN_ATTR.

ALIGN is defined as a function in u_math.h and same name is
used to define a macro in pvr_rogue_fwif_shared.h. This commit
resolves this conflict.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Fix UTIL_ARCH_BIG_ENDIAN check in vk_format.h.
Rajnesh Kanwal [Mon, 16 May 2022 15:53:18 +0000 (16:53 +0100)]
pvr: Fix UTIL_ARCH_BIG_ENDIAN check in vk_format.h.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Restrict argument to dev_info where possible.
Rajnesh Kanwal [Mon, 16 May 2022 15:37:32 +0000 (16:37 +0100)]
pvr: Restrict argument to dev_info where possible.

Avoid passing whole device structure. In most of the cases
we only need dev_info from device pointer to check for
features and ERNs.
This commits simply avoids the need to carry device pointer
where ever we go.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Fix ISP_RENDER_MODE_TYPE enum in rogue_cr.xml
Rajnesh Kanwal [Mon, 16 May 2022 15:29:31 +0000 (16:29 +0100)]
pvr: Fix ISP_RENDER_MODE_TYPE enum in rogue_cr.xml

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Add transfer 3d parameter heap support.
Rajnesh Kanwal [Mon, 16 May 2022 13:52:13 +0000 (14:52 +0100)]
pvr: Add transfer 3d parameter heap support.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Remove vk_format_is_pure_integer and use common helper.
Rajnesh Kanwal [Mon, 16 May 2022 13:45:31 +0000 (14:45 +0100)]
pvr: Remove vk_format_is_pure_integer and use common helper.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Allow signal_sync pointer to be NULL in job submission.
Rajnesh Kanwal [Mon, 16 May 2022 13:28:43 +0000 (14:28 +0100)]
pvr: Allow signal_sync pointer to be NULL in job submission.

This allows the common driver to pass NULL signal_sync for cases
where there are multiple jobs (of the same type) to be processed.
In that case, it's useless to maintain the signal_syncs other than
the one returned by the last submission.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Add support for R32G32B32A32_UINT, R32_UINT and R8_UINT formats.
Rajnesh Kanwal [Mon, 16 May 2022 13:27:40 +0000 (14:27 +0100)]
pvr: Add support for R32G32B32A32_UINT, R32_UINT and R8_UINT formats.

These formats are required by vkCmdCopyBuffer implementation. The
formats in pvr_format_table are exposed to applications as well.
Given these formats are supported for rendering and sampling, there
shouldn't be a problem exposing these to applications.

Co-authored-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agopvr: Pass device info struct in pds generator.
Rajnesh Kanwal [Mon, 16 May 2022 13:26:43 +0000 (14:26 +0100)]
pvr: Pass device info struct in pds generator.

Fixes a potential NULL pointer dereference.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

2 years agoradv: Fix the accel struct size calculation
Konstantin Seurer [Sun, 5 Jun 2022 09:12:10 +0000 (11:12 +0200)]
radv: Fix the accel struct size calculation

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16874>

2 years agoac: use ResetAllOptionOccurrences instead of ResetCommandLineParser
Rhys Perry [Fri, 3 Jun 2022 11:15:56 +0000 (12:15 +0100)]
ac: use ResetAllOptionOccurrences instead of ResetCommandLineParser

Fixes -amdgpu-atomic-optimizations=true option.

From CommandLine.h:
/// Reset all command line options to a state that looks as if they have
/// never appeared on the command line.  This is useful for being able to parse
/// a command line multiple times (especially useful for writing tests).
void ResetAllOptionOccurrences();

/// Reset the command line parser back to its initial state.  This
/// removes
/// all options, categories, and subcommands and returns the parser to a state
/// where no options are supported.
void ResetCommandLineParser();

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fixes: 7e2874dc93a ("ac: reset LLVM command line parser")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16850>

2 years agov3d: release all color buffers on context destroy
Juan A. Suarez Romero [Tue, 7 Jun 2022 06:54:34 +0000 (08:54 +0200)]
v3d: release all color buffers on context destroy

All of them must be released on context destroy, and not only the first
one.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16903>

2 years agointel: Fix build of mi_builder_tests by including c99_compat.h
Jordan Justen [Mon, 6 Jun 2022 23:14:32 +0000 (16:14 -0700)]
intel: Fix build of mi_builder_tests by including c99_compat.h

We need this so C++ will understand "restrict" which is used in the
genxml output.

Fixes: 9f717b5f23c ("util: remove needless c99_compat.h includes")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16899>

2 years agodzn: Emit missing transition barriers for rendering attachments
Boris Brezillon [Mon, 30 May 2022 10:00:43 +0000 (03:00 -0700)]
dzn: Emit missing transition barriers for rendering attachments

VkRenderingAttachmentInitialLayoutInfoMESA provides information about
the initialLayout -> currentLayout that's expected when we begin a
render pass. Let's take it into account.

Fixes: 2d0798440b4 ("dzn: Add support for dynamic rendering")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16792>

2 years agoradv: report the marketing name as part of the device name
Samuel Pitoiset [Thu, 27 May 2021 07:03:24 +0000 (09:03 +0200)]
radv: report the marketing name as part of the device name

This now reports something like "AMD Radeon RX 5700 XT (RADV NAVI10)".

This introduces a new variable for storing the marketing name because
the existing device name is used by the shaders cache and must remain
the same to avoid any issues with precompilation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4802
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/11027>

2 years agoradv/winsys: add get_chip_name() to the null winsys
Samuel Pitoiset [Thu, 27 May 2021 09:51:25 +0000 (11:51 +0200)]
radv/winsys: add get_chip_name() to the null winsys

Make it return "Null hardware", this is just for RADV_FORCE_FAMILY.

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

2 years agogallium: rename PIPE_CAP_MAX_SHADER_BUFFER_SIZE -> *_UINT
Marek Olšák [Mon, 6 Jun 2022 00:55:50 +0000 (20:55 -0400)]
gallium: rename PIPE_CAP_MAX_SHADER_BUFFER_SIZE -> *_UINT

to imply the maximum of 4GB - 1.

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

2 years agogallium: rename PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE->MAX_TEXEL_BUFFER_ELEMENTS_UINT
Marek Olšák [Mon, 6 Jun 2022 00:15:44 +0000 (20:15 -0400)]
gallium: rename PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE->MAX_TEXEL_BUFFER_ELEMENTS_UINT

to allow exposing 4G - 1. The "SIZE" was also a misnomer because it meant
elements. This no longer clamps the size to INT_MAX in st/mesa.

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

2 years agogallium: add PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT for UBOs
Marek Olšák [Sun, 5 Jun 2022 22:56:07 +0000 (18:56 -0400)]
gallium: add PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT for UBOs

We plan to report UINT32_MAX for UBOs.

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

2 years agogallium: rename PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE to *_BUFFER0_*
Marek Olšák [Sun, 5 Jun 2022 22:47:09 +0000 (18:47 -0400)]
gallium: rename PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE to *_BUFFER0_*

UBOs will use a larger limit.

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

2 years agost/mesa: round down MaxUniformBlockSize to a multiple of 4 for piglit
Marek Olšák [Mon, 6 Jun 2022 04:26:35 +0000 (00:26 -0400)]
st/mesa: round down MaxUniformBlockSize to a multiple of 4 for piglit

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

2 years agost/mesa: limit MaxComputeWorkGroupCount to INT_MAX - 1 due to failing tests
Marek Olšák [Mon, 6 Jun 2022 03:16:29 +0000 (23:16 -0400)]
st/mesa: limit MaxComputeWorkGroupCount to INT_MAX - 1 due to failing tests

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

2 years agomesa: change GL_MAX_SHADER_STORAGE_BLOCK_SIZE to UINT
Marek Olšák [Sun, 5 Jun 2022 23:54:02 +0000 (19:54 -0400)]
mesa: change GL_MAX_SHADER_STORAGE_BLOCK_SIZE to UINT

so that we can report 4G - 1.

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

2 years agomesa: change GL_MAX_TEXTURE_BUFFER_SIZE to UINT
Marek Olšák [Sun, 5 Jun 2022 23:54:02 +0000 (19:54 -0400)]
mesa: change GL_MAX_TEXTURE_BUFFER_SIZE to UINT

so that we can report 4G - 1.

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

2 years agomesa: change GL_MAX_UNIFORM_BLOCK_SIZE to UINT
Marek Olšák [Mon, 6 Jun 2022 00:05:15 +0000 (20:05 -0400)]
mesa: change GL_MAX_UNIFORM_BLOCK_SIZE to UINT

to allow 4GB - 1.

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

2 years agomesa: change GL_MAX_COMPUTE_WORK_GROUP_COUNT to UINT
Marek Olšák [Sun, 5 Jun 2022 22:34:03 +0000 (18:34 -0400)]
mesa: change GL_MAX_COMPUTE_WORK_GROUP_COUNT to UINT

AMD wants to report UINT32_MAX here.

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

2 years agomesa: clamp UINT values greater than INT_MAX for glGetInteger
Marek Olšák [Sun, 5 Jun 2022 22:30:13 +0000 (18:30 -0400)]
mesa: clamp UINT values greater than INT_MAX for glGetInteger

so that values greater than INT_MAX report INT_MAX with glGetInteger and
the full value with glGetInteger64. This allows exposing compute grid sizes
and max buffer sizes greater than INT_MAX.

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

2 years agomesa/st: use util_streaming_load_memcpy for compute pbo copying
Mike Blumenkrantz [Tue, 17 May 2022 18:57:49 +0000 (14:57 -0400)]
mesa/st: use util_streaming_load_memcpy for compute pbo copying

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

2 years agostreaming-memcpy: move to src/util/ and compile unconditionally
Mike Blumenkrantz [Thu, 2 Jun 2022 14:02:57 +0000 (10:02 -0400)]
streaming-memcpy: move to src/util/ and compile unconditionally

this is useful, so make it available for general use

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

2 years agomesa/streaming-memcpy: add memcpy fallback
Mike Blumenkrantz [Thu, 2 Jun 2022 13:56:11 +0000 (09:56 -0400)]
mesa/streaming-memcpy: add memcpy fallback

this makes it more compatible and able to be used from the caller without ifdefs

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

2 years agoci/crocus: Drop g41's xfail for rgba_half_float_oes.
Emma Anholt [Mon, 6 Jun 2022 21:49:06 +0000 (14:49 -0700)]
ci/crocus: Drop g41's xfail for rgba_half_float_oes.

Something fixed it recently, noticed when I was testing this MR and ran
manual jobs.

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

2 years agoglsl: Drop INT_DIV_TO_MUL_RCP lowering.
Emma Anholt [Tue, 31 May 2022 20:52:57 +0000 (13:52 -0700)]
glsl: Drop INT_DIV_TO_MUL_RCP lowering.

nir_lower_int_to_float() does this at the end of compilation, no need to
do it up front.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agolima: Lower nir_op_idiv with other scalar math operations.
Vasily Khoruzhick [Mon, 6 Jun 2022 21:43:43 +0000 (14:43 -0700)]
lima: Lower nir_op_idiv with other scalar math operations.

This will end up appearing in the backend once we move GLSL's
idiv->fmul+frcp lowering to NIR.

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

2 years agonir: Fix idiv lowering on !NativeIntegers when lower_fdiv is also set.
Emma Anholt [Mon, 6 Jun 2022 18:30:51 +0000 (11:30 -0700)]
nir: Fix idiv lowering on !NativeIntegers when lower_fdiv is also set.

Avoids a regression when turning off GLSL's int div lowering.

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

2 years agoglsl: Drop the div-to-mul-rcp lowering for floats.
Emma Anholt [Tue, 31 May 2022 20:48:17 +0000 (13:48 -0700)]
glsl: Drop the div-to-mul-rcp lowering for floats.

NIR has fdiv, and all the NIR backends have to have lower_fdiv set
appropriately already since various passes (format conversions,
tgsi_to_nir, nir_fast_normalize(), etc.) might generate one.

This causes softpipe and llvmpipe to now do actual divides, since
lower_fdiv is not set there.  Note that llvmpipe's rcp implementation is a
divide of 1.0 by x, so now we're going to be just doing div(x, y) instead
of mul(x, div(1.0, y)).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agotgsi_exec: Fix inf/nan handling for divide by zero.
Emma Anholt [Wed, 1 Jun 2022 19:49:59 +0000 (12:49 -0700)]
tgsi_exec: Fix inf/nan handling for divide by zero.

For RCP and for DDIV, we do division without any src1 != 0 checks, and we
should do the same here so that we get infs or nans as appropriate instead
of undefined.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agoglsl: Move exp/log-to-exp2/log2 lowering to glsl-to-NIR.
Emma Anholt [Tue, 31 May 2022 20:36:15 +0000 (13:36 -0700)]
glsl: Move exp/log-to-exp2/log2 lowering to glsl-to-NIR.

It's way more concise to write as nir_builder calls.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agoglsl: Remove stale lower_instructions comments.
Emma Anholt [Tue, 31 May 2022 20:33:14 +0000 (13:33 -0700)]
glsl: Remove stale lower_instructions comments.

Should have been in 3a42e92a4f2f ("glsl: Drop the dead MOD_TO_FLOOR path.")

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agogallium+glsl: Remove EmitNoSat/PIPE_CAP_VERTEX_SHADER_SATURATE
Emma Anholt [Tue, 31 May 2022 20:21:44 +0000 (13:21 -0700)]
gallium+glsl: Remove EmitNoSat/PIPE_CAP_VERTEX_SHADER_SATURATE

The drivers not setting it were:

- nv30, which gets lowering using NIR's lower_fsat flag.
- r300, which gets lowering using NIR's lower_fsat flag.
- a2xx, which has was getting it optimized back to fsat anyway.

This drops the check for the cap from gallium nine.  While nine does have
a non-nir path, I think it's safe to assume that if you have SM3
texturing, you can do fsat.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agonouveau/nv30: Make sure fsat is lowered in the VS.
Emma Anholt [Tue, 31 May 2022 20:18:09 +0000 (13:18 -0700)]
nouveau/nv30: Make sure fsat is lowered in the VS.

GLSL lowers fsat to clamps based on PIPE_CAP_VERTEX_SHADER_SATURATE
(EmitNoSat), but nir is happy to optimize that back to fsat unless you
tell it not to.

Noticed by inspection while looking at deleting EmitNoSat.

Fixes: ca1ec7272685 ("nv30/40: Switch to using NIR-to-TGSI by default.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16823>

2 years agoradeonsi: replace llvm ls/hs interface lds ops with nir lowered ones
Qiang Yu [Mon, 9 May 2022 13:28:26 +0000 (21:28 +0800)]
radeonsi: replace llvm ls/hs interface lds ops with nir lowered ones

Use ac nir lower pass to generate these lds load/store ops explicitly.

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

2 years agoac/nir: Add remappability to tess and ESGS I/O lowering passes.
Timur Kristóf [Thu, 12 May 2022 13:48:24 +0000 (15:48 +0200)]
ac/nir: Add remappability to tess and ESGS I/O lowering passes.

This will be used for radeonsi to map common I/O location to fixed
slots agreed by different shader stages.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16418>

2 years agoac/nir: skip gl_Layer/gl_ViewportIndex write for LS
Qiang Yu [Mon, 9 May 2022 13:42:47 +0000 (21:42 +0800)]
ac/nir: skip gl_Layer/gl_ViewportIndex write for LS

This is from radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16418>

2 years agoradeonsi: add tcs_vgpr_only_inputs parameter to si_get_nir_shader
Qiang Yu [Sun, 8 May 2022 14:10:58 +0000 (22:10 +0800)]
radeonsi: add tcs_vgpr_only_inputs parameter to si_get_nir_shader

Will be used later.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
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/16418>

2 years agoradeonsi: implement load_lshs_vertex_stride abi
Qiang Yu [Sat, 7 May 2022 09:54:02 +0000 (17:54 +0800)]
radeonsi: implement load_lshs_vertex_stride abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16418>

2 years agoac/nir: use nir_intrinsic_load_lshs_vertex_stride_amd
Qiang Yu [Sat, 7 May 2022 09:38:04 +0000 (17:38 +0800)]
ac/nir: use nir_intrinsic_load_lshs_vertex_stride_amd

For radeonsi which pass this value by argument.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16418>

2 years agonir: add nir_intrinsic_load_lshs_vertex_stride_amd
Qiang Yu [Sat, 7 May 2022 09:34:54 +0000 (17:34 +0800)]
nir: add nir_intrinsic_load_lshs_vertex_stride_amd

For loading LS-HS vertex stride by shader argument in radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16418>

2 years agoac/llvm: get back nir_intrinsic_load_tess_rel_patch_id_amd
Qiang Yu [Wed, 11 May 2022 07:11:27 +0000 (15:11 +0800)]
ac/llvm: get back nir_intrinsic_load_tess_rel_patch_id_amd

radeonsi will use it. This can be removed again after radeonsi support
radv_nir_lower_abi like lower pass.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16418>

2 years agoglsl: tidy up link_varyings_and_uniforms()
Timothy Arceri [Mon, 6 Jun 2022 03:00:35 +0000 (13:00 +1000)]
glsl: tidy up link_varyings_and_uniforms()

All uniform linking is now done via nir based linker not via this
code so we drop that from its name. We also drop a bunch of unused
parameters.

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

2 years agoglsl: drop extra optimise swizzles call
Timothy Arceri [Mon, 6 Jun 2022 02:57:08 +0000 (12:57 +1000)]
glsl: drop extra optimise swizzles call

As per the comment this was meant to tidy things up after varying
linking but varying linking has been moved into a nir based linker
so this extra call is no longer needed.

This optimisation pass is still called in the regular glsl ir
optimisation loop.

No shader-db change on Iris (BDW).

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

2 years agoturnip: Move tile loads back into the draw CS.
Emma Anholt [Tue, 17 May 2022 19:07:06 +0000 (12:07 -0700)]
turnip: Move tile loads back into the draw CS.

Now that we don't need to know if HW binning actually will get used or
not, we can just emit the tile loads into the start of the draw CS.

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

2 years agoturnip: Allow nested CP_COND_REG_EXEC
Danylo Piliaiev [Wed, 13 Apr 2022 17:37:38 +0000 (20:37 +0300)]
turnip: Allow nested CP_COND_REG_EXEC

This ends up being needed for moving tile loads into the draw cs.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16826>

2 years agoturnip: Allow load/store skipping in vkCmdClearAttachments().
Emma Anholt [Wed, 1 Jun 2022 22:01:44 +0000 (15:01 -0700)]
turnip: Allow load/store skipping in vkCmdClearAttachments().

We have to use a 3D draw to make it possible (so it goes through the
binner's visibility calcs), but hopefully the increased overhead for apps
with non-skippable rendering balances against skipping in others.

The real motivation is to get draw-time state out of tile load setup.

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

2 years agoturnip: Refactor a bit of subpass attachment processing.
Emma Anholt [Fri, 20 May 2022 04:23:29 +0000 (21:23 -0700)]
turnip: Refactor a bit of subpass attachment processing.

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

2 years agoturnip: Include 3d-based CmdClearAttachments() in binning visibility.
Emma Anholt [Wed, 1 Jun 2022 21:11:47 +0000 (14:11 -0700)]
turnip: Include 3d-based CmdClearAttachments() in binning visibility.

It means the clear's draw can get skipped when it doesn't intersect with
the tile.

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

2 years agoturnip: Refactor a bit of repeated code for subpass setup.
Emma Anholt [Thu, 19 May 2022 23:40:14 +0000 (16:40 -0700)]
turnip: Refactor a bit of repeated code for subpass setup.

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

2 years agoci/turnip: Add a little forced touch-testing of XFB with no binning requested.
Emma Anholt [Tue, 17 May 2022 17:51:19 +0000 (10:51 -0700)]
ci/turnip: Add a little forced touch-testing of XFB with no binning requested.

This is just a couple of seconds of runtime.

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

2 years agoturnip: Use fb->binning_possible to decide on conditional tile load/stores.
Emma Anholt [Mon, 16 May 2022 20:39:04 +0000 (13:39 -0700)]
turnip: Use fb->binning_possible to decide on conditional tile load/stores.

When !fb->binning but fb->binning_possible, we can just set the VSC
per-tile visibility reg to all visible in the "whoops, we'd rather not bin
but we had to anyway for XFB" case.  This gets that EndRenderPass state out
of tile_load_cs/store_cs.

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

2 years agoturnip: Move binning decisions from FB usage time to FB creation time.
Emma Anholt [Mon, 16 May 2022 20:18:06 +0000 (13:18 -0700)]
turnip: Move binning decisions from FB usage time to FB creation time.

This is mostly about helping me understand which choices are constant for the object as opposed to runtime decisions.

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

2 years agoturnip: Refactor a bit of tu6_emit_tile_select().
Emma Anholt [Tue, 17 May 2022 21:28:47 +0000 (14:28 -0700)]
turnip: Refactor a bit of tu6_emit_tile_select().

Reduce redundant code, make the used SET_VISIBILITY_OVERRIDE value clearer.

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