platform/upstream/mesa.git
23 months agoasahi: Advertise ASTC formats
Alyssa Rosenzweig [Sat, 20 Aug 2022 16:35:53 +0000 (12:35 -0400)]
asahi: Advertise ASTC formats

Now that we have layout and tiling code that can handle block-compressed
formats, including the non-square blocks found with some ASTC formats,
we can advertise ASTC formats. Passes dEQP-GLES3.*astc* which
exercises everything here. (These tests passed before by decompressing
the textures to RGBA8 UNORM in the frontend, but it's much more
efficient to use real ASTC textures as done here.)

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

23 months agoasahi: Advertise ETC1
Alyssa Rosenzweig [Thu, 18 Aug 2022 23:06:18 +0000 (19:06 -0400)]
asahi: Advertise ETC1

ETC2 is backwards compatible with ETC1, we just need to declare the
format mapping.

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

23 months agoasahi: Fix is_format_supported returns
Alyssa Rosenzweig [Fri, 19 Aug 2022 02:35:58 +0000 (22:35 -0400)]
asahi: Fix is_format_supported returns

Gallium can test multiple binds at once, we need to return the logical
AND, not the OR.

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

23 months agoasahi: Handle 2-channel sRGB textures
Alyssa Rosenzweig [Fri, 19 Aug 2022 02:22:21 +0000 (22:22 -0400)]
asahi: Handle 2-channel sRGB textures

I'm not sure why we need to set this magic bit, but this fixes the
non-depth_component portion of
dEQP-GLES3.functional.texture.format.sized.*, e.g

dEQP-GLES3.functional.texture.format.sized.cube.srgb_rg8_pot

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

23 months agoail: Rewrite tiled memcpy for correctness
Alyssa Rosenzweig [Fri, 19 Aug 2022 00:13:50 +0000 (20:13 -0400)]
ail: Rewrite tiled memcpy for correctness

Move tiling.c into ail, using ail data structures and helpers to manage
the tiling. This fixes a staggering number of issues with the tiling
routines:

* NPOT block sizes defeatured. The hardware only supports POT block
  sizes. There's no need to handle anything else.

* Use ail to determine tile sizes, instead of the broken
  agx_select_tile_shift routine that didn't work for non-square tile
  sizes (for instance).

* Handle up to 128x128 tiles, as required by 8bpp textures.

* Handle non-square tiles. If the block size is not a multiple of 4, the
  tile size will be of the form 2n x n. This is easy with the ail_tile
  data structure, but not possible architecturally with
  agx_select_tile_shift. This is required for 16bpp and 64bpp textures.

* Express in terms of elements instead of pixels, using unit
  suffixes to make the dimensional analysis obvious. In particular this
  handles tiling of block-compressed textures by tiling the blocks
  themselves. This is required for block-compressed textures (internally handled
  like smaller 64bpp textures).

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

23 months agoail: Introduce image layout module
Alyssa Rosenzweig [Sun, 12 Jun 2022 18:14:58 +0000 (14:14 -0400)]
ail: Introduce image layout module

Introduce ail, a small library for working with the image (and buffer)
layouts encountered with AGX hardware. Its design is inspired by isl. In
particular, ail strives to use isl unit suffixes and to represent
quantities in a canonical, API-agnostic fashion [1].

ail replaces the old miptree code (based on some ad hoc heuristics that
passed a few dEQP tests). It is based on a thorough reverse-engineering
of AGX's twiddled format, courtesy of Asahi Lina, Dougall Johnson, and
me. This corrects our handling of many common cases that were totally
wrong in the old code, leading to GPU faults.

Unlike the code, ail differentiates between pixels and elements
consistently, allowing block-compressed formats like ETC2 to be
supported correctly. These formats will be enabled later in the series.

This commit fixes Inochi2D, glmark2 -brefract and -bterrain, and who
knows what else.

ail stands for { Asahi, AGX } Image { Layout, Library } at your
convenience. ail is best served warm.

Liberal use of ail is recommended. Yum!

[1] https://docs.mesa3d.org/isl/units.html

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

23 months agoasahi: Fix ASTC enums
Alyssa Rosenzweig [Sat, 20 Aug 2022 16:26:58 +0000 (12:26 -0400)]
asahi: Fix ASTC enums

The ASTC enum only encodes the block width/height. By contrast the
LDR/HDR/sRGB distinction is encoded as UNORM/Float and via the sRGB bit.

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

23 months agoasahi: Fix bind sizes
Alyssa Rosenzweig [Wed, 10 Aug 2022 00:44:17 +0000 (20:44 -0400)]
asahi: Fix bind sizes

Otherwise we get a nonsensical count of 129 in one Metal sample. Exact
size still not known but this bounds somewhat.

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

23 months agoasahi: Add XML for multisampled textures
Alyssa Rosenzweig [Sun, 21 Aug 2022 01:15:07 +0000 (21:15 -0400)]
asahi: Add XML for multisampled textures

Metal supports MSAA 2x and MSAA 4x, neither at the same time as
mipmapping. That matches the GL spec requirement.

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

23 months agoasahi: Rename 'tiled 64x64' to 'twiddled'
Alyssa Rosenzweig [Sat, 20 Aug 2022 17:10:49 +0000 (13:10 -0400)]
asahi: Rename 'tiled 64x64' to 'twiddled'

To account for non-64x64 tile sizes, as well as the other forms of
tiling that may come up with compression.

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

23 months agoasahi: Identify compressed render target fields
Alyssa Rosenzweig [Sun, 12 Jun 2022 15:08:07 +0000 (11:08 -0400)]
asahi: Identify compressed render target fields

We won't be implementing AGX compression for a while, but this gets some
unknowns out of the way when looking at dumps from Metal that use it.

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

23 months agodocs/asahi: Document image layouts
Alyssa Rosenzweig [Sun, 21 Aug 2022 17:09:09 +0000 (13:09 -0400)]
docs/asahi: Document image layouts

There are many subtleties to laying out twiddled images on AGX. Document
the known ones in a central place. Many of the hairy details of
twiddling were discovered by Asahi Lina and Dougall Johnson, many thanks
to them.

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

23 months agozink: check the variable mode before taking samplemask path in ntv
Mike Blumenkrantz [Thu, 1 Sep 2022 19:21:12 +0000 (15:21 -0400)]
zink: check the variable mode before taking samplemask path in ntv

this otherwise may break for function temps

cc: mesa-stable

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

23 months agozink: don't emit entrypoints for function temp variables
Mike Blumenkrantz [Thu, 1 Sep 2022 19:20:46 +0000 (15:20 -0400)]
zink: don't emit entrypoints for function temp variables

UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC): msgNum: 7060244 - Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x3c8a1d0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: OpEntryPoint interfaces should only list global variables

cc: mesa-stable

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

23 months agopan/bi: Assert that vectors are sufficiently small
Alyssa Rosenzweig [Thu, 1 Sep 2022 20:48:08 +0000 (16:48 -0400)]
pan/bi: Assert that vectors are sufficiently small

There is a limit to how vector widths (eg due to RA), larger vectors should be
broken up in NIR so we shouldn't ever see such vectors.

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

23 months agopan/bi: Implement nir_op_vec8 and nir_op_vec16
Alyssa Rosenzweig [Wed, 22 Jun 2022 19:42:43 +0000 (15:42 -0400)]
pan/bi: Implement nir_op_vec8 and nir_op_vec16

These are used with OpenCL, particularly with 8-bit types. Luckily, they are
pretty easy to implement with our existing infrastructure. We just need to hit
backspace enough times and we're good to go.

Fixes a subtest of test_basic hiloeo.

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

23 months agopan/va: Handle 8-bit lane when lowering constants
Alyssa Rosenzweig [Wed, 22 Jun 2022 19:15:00 +0000 (15:15 -0400)]
pan/va: Handle 8-bit lane when lowering constants

We need to be careful to ensure the output of constant lowering still selects a
single lane, otherwise we lower something like:

   44 = MKVEC.v2i8 43.b1, #0x0.b0, #0x0

to

   44 = MKVEC.v2i8 24.b1, u256, u256

which loses the .b0 swizzle, and thus renders the MKVEC.v2i8 unable to pack.
Similarly, we need to allow zero-extension with fields marked "lane". Currently
only MKVEC.v2i8 hits this path, as the other instructions using "lane"
modifiers are unary and therefore will have been constant folded.

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

23 months agopan/bi: Implement general 8-bit vector construction
Alyssa Rosenzweig [Wed, 22 Jun 2022 18:33:43 +0000 (14:33 -0400)]
pan/bi: Implement general 8-bit vector construction

Refactor the 16-bit vector construction code to separate the collect of separate
32-bit words from the construction of single 32-bit vectors from sub-32-bit
parts. Then add a path to combine (up to 4) bytes into a 32-bit word using
Valhall's MKVEC.v2i8 instruction.

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

23 months agovulkan,docs: Add documentation Vulkan command pools
Jason Ekstrand [Wed, 31 Aug 2022 18:41:27 +0000 (13:41 -0500)]
vulkan,docs: Add documentation Vulkan command pools

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

23 months agolvp: Move to the common command pool framework
Jason Ekstrand [Tue, 30 Aug 2022 19:46:12 +0000 (14:46 -0500)]
lvp: Move to the common command pool framework

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

23 months agotu: Move to the common command pool framework
Jason Ekstrand [Tue, 30 Aug 2022 19:38:56 +0000 (14:38 -0500)]
tu: Move to the common command pool framework

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

23 months agoradv: Move to the common command pool framework
Jason Ekstrand [Tue, 30 Aug 2022 19:26:03 +0000 (14:26 -0500)]
radv: Move to the common command pool framework

Now the common code support reuse, port radv over to using it.

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

23 months agovulkan: Recycle command buffers in vk_command_pool
Jason Ekstrand [Tue, 30 Aug 2022 16:13:03 +0000 (11:13 -0500)]
vulkan: Recycle command buffers in vk_command_pool

This is similar to what RADV and several other drivers have been doing
for quite some time.  It's good to have it common.

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

23 months agovulkan: Add a common vkAllocateCommandBuffers() implementation
Jason Ekstrand [Tue, 30 Aug 2022 18:08:40 +0000 (13:08 -0500)]
vulkan: Add a common vkAllocateCommandBuffers() implementation

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

23 months agovulkan: Add a common vkResetCommandBuffer() implementation
Jason Ekstrand [Tue, 30 Aug 2022 16:30:10 +0000 (11:30 -0500)]
vulkan: Add a common vkResetCommandBuffer() implementation

This is little more than a wrapper around a function pointer at present
so it doesn't really gain the driver much to use it.  The new callback
will, however, be put to good use in the next commit.

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

23 months agovulkan: Add a vk_command_buffer_ops struct
Jason Ekstrand [Tue, 30 Aug 2022 17:41:48 +0000 (12:41 -0500)]
vulkan: Add a vk_command_buffer_ops struct

This is the standard pattern in the kernel for providing vfunc tables
for C objects.  We're using it in the pipeline cache code but we're
about to start adding more stuff and so it really helps if we have it
for command buffers as well.

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

23 months agovulkan: Re-order arguments to vk_command_buffer_init
Jason Ekstrand [Tue, 30 Aug 2022 16:48:21 +0000 (11:48 -0500)]
vulkan: Re-order arguments to vk_command_buffer_init

Most other init functions follow the Vulkan API convention of putting
the parent object first.

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

23 months agovulkan: Re-order arguments to vk_command_pool_init
Jason Ekstrand [Wed, 31 Aug 2022 18:33:07 +0000 (13:33 -0500)]
vulkan: Re-order arguments to vk_command_pool_init

Most other init functions follow the Vulkan API convention of putting
the parent object first.

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

23 months agovulkan: Add a concept of recycling an object
Jason Ekstrand [Tue, 30 Aug 2022 16:06:39 +0000 (11:06 -0500)]
vulkan: Add a concept of recycling an object

This is not necessarily a full re-initialization of the object but is
whatever is necessary/expedient for the client to see it as a new object
and not the one it has seen before.  For vk_base_object, this removes
any private data and resets the object name to NULL.

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

23 months agoturnip: add some cpu tracepionts
Chia-I Wu [Fri, 26 Aug 2022 00:09:43 +0000 (17:09 -0700)]
turnip: add some cpu tracepionts

Add tracepoints for pipeline creations and queue submits.

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

23 months agovulkan/wsi: add cpu tracepoints for internal waits
Chia-I Wu [Fri, 26 Aug 2022 00:49:25 +0000 (17:49 -0700)]
vulkan/wsi: add cpu tracepoints for internal waits

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

23 months agovulkan/wsi: add cpu tracepoints to swapchain functions
Chia-I Wu [Fri, 26 Aug 2022 00:49:20 +0000 (17:49 -0700)]
vulkan/wsi: add cpu tracepoints to swapchain functions

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

23 months agotu/lrz: Fix multiple depth attachment case with secondaries
Connor Abbott [Thu, 1 Sep 2022 12:37:41 +0000 (14:37 +0200)]
tu/lrz: Fix multiple depth attachment case with secondaries

This is a counterpart to the previous commit. When we have multiple
depth attachments, in the secondary we currently don't disable LRZ and
so we may need a valid LRZ fast-clear base.

Fixes: 4b5f0d98 ("tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18369>

23 months agotu/lrz: Fix multiple subpass case with secondaries
Connor Abbott [Thu, 1 Sep 2022 12:30:20 +0000 (14:30 +0200)]
tu/lrz: Fix multiple subpass case with secondaries

In
dEQP-VK.renderpass.dedicated_allocation.attachment_allocation.input_output.94
we have the following:

- There is more than one subpass, but only one depth attachment.
- The first subpass doesn't use depth.
- The subpass that does use depth has a draw call in a secondary.

We wouldn't hit the case where there's more than one depth attachment,
but because tu_begin_resumed_renderpass() only looked at the first
subpass it wouldn't find the depth attachment and would leave LRZ
invalid and thus a NULL LRZ fast-clear base. Then
tu_begin_secondary_cmdbuf() would leave LRZ enabled and the draw would
have LRZ enabled, leading to a hang.

Fix this by making tu_begin_resumed_renderpass() match
tu_begin_renderpass() with how it finds the depth attachment.

Fixes: 4b5f0d98 ("tu: Overhaul LRZ, implement on-GPU dir tracking and LRZ fast-clear")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18369>

23 months agoradv: constify radv_shader_info where it's missing
Samuel Pitoiset [Fri, 26 Aug 2022 13:01:50 +0000 (15:01 +0200)]
radv: constify radv_shader_info where it's missing

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

23 months agoradv: determine as_ls/as_es in radv_link_shaders_info()
Samuel Pitoiset [Fri, 26 Aug 2022 12:42:05 +0000 (14:42 +0200)]
radv: determine as_ls/as_es in radv_link_shaders_info()

This is a link shader info step somehow.

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

23 months agoradv: remove unused parameters in radv_fill_shader_info()
Samuel Pitoiset [Fri, 26 Aug 2022 12:37:30 +0000 (14:37 +0200)]
radv: remove unused parameters in radv_fill_shader_info()

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

23 months agoradv: add and use a helper that merges shader info for merged stages on GFX9+
Samuel Pitoiset [Tue, 23 Aug 2022 14:28:05 +0000 (16:28 +0200)]
radv: add and use a helper that merges shader info for merged stages on GFX9+

It looks much cleaner and it's pretty small.

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

23 months agoradv: cleanup computing the workgroup size for all stages
Samuel Pitoiset [Fri, 26 Aug 2022 12:18:33 +0000 (14:18 +0200)]
radv: cleanup computing the workgroup size for all stages

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

23 months agoradv: simplify determining if NGG passthrough can be enabled
Samuel Pitoiset [Fri, 26 Aug 2022 11:36:34 +0000 (13:36 +0200)]
radv: simplify determining if NGG passthrough can be enabled

NGG can't be enabled with XFB, so this check is redundant now.

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

23 months agoradv: move determining other NGG settings in radv_link_shaders_info()
Samuel Pitoiset [Fri, 26 Aug 2022 11:05:23 +0000 (13:05 +0200)]
radv: move determining other NGG settings in radv_link_shaders_info()

At least, everything is at the same place now.

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

23 months agoradv: refactor radv_nir_shader_info_link()
Samuel Pitoiset [Fri, 26 Aug 2022 10:30:57 +0000 (12:30 +0200)]
radv: refactor radv_nir_shader_info_link()

To use the similar producer/consumer logic we do when linking shaders.

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

23 months agoradv: move computing NGG info and GS info to radv_nir_shader_info_link()
Samuel Pitoiset [Fri, 26 Aug 2022 10:03:11 +0000 (12:03 +0200)]
radv: move computing NGG info and GS info to radv_nir_shader_info_link()

It's a link step somehow, except for VS only on GFX10+ but keep it
there anyways.

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

23 months agoradv: move computing wave_size/ballot_bit_size to the shader info pass
Samuel Pitoiset [Fri, 26 Aug 2022 09:59:06 +0000 (11:59 +0200)]
radv: move computing wave_size/ballot_bit_size to the shader info pass

NGG helpers need to know this information.

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

23 months agoradv: cleanup helpers that compute NGG info and GS info on GFX9+
Samuel Pitoiset [Fri, 26 Aug 2022 09:30:57 +0000 (11:30 +0200)]
radv: cleanup helpers that compute NGG info and GS info on GFX9+

Before moving them to the shader info link step.

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

23 months agoradv: stop setting esgs_itemsize to the GS stage
Samuel Pitoiset [Fri, 26 Aug 2022 08:22:53 +0000 (10:22 +0200)]
radv: stop setting esgs_itemsize to the GS stage

It's never read.

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

23 months agoradv: stop setting num_tess_patches for the GS stage
Samuel Pitoiset [Fri, 26 Aug 2022 08:15:46 +0000 (10:15 +0200)]
radv: stop setting num_tess_patches for the GS stage

It's never read.

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

23 months agoradv: stop setting as_es for the GS stage
Samuel Pitoiset [Tue, 23 Aug 2022 13:54:15 +0000 (15:54 +0200)]
radv: stop setting as_es for the GS stage

This doesn't make sense and it was assigned because the shader info
stuff was a complete mess.

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

23 months agoradv: stop setting as_ls for the TCS stage
Samuel Pitoiset [Tue, 23 Aug 2022 13:28:26 +0000 (15:28 +0200)]
radv: stop setting as_ls for the TCS stage

This doesn't make sense and it was assigned because the shader info
stuff was a complete mess. LS is only a thing on GFX6-8, on GFX9+
it's a merged VS+TCS to HS.

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

23 months agoaco: remove unused isel_context::tcs_num_patches
Samuel Pitoiset [Fri, 26 Aug 2022 08:13:20 +0000 (10:13 +0200)]
aco: remove unused isel_context::tcs_num_patches

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

23 months agoradv: fix bogus assertion with RADV_FORCE_VRS
Samuel Pitoiset [Wed, 31 Aug 2022 14:41:21 +0000 (16:41 +0200)]
radv: fix bogus assertion with RADV_FORCE_VRS

It supports VS, TES and GS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18345>

23 months agoradv: Free geometry infos in radv_CmdBuildAccelerationStructuresKHR
Friedrich Vock [Thu, 1 Sep 2022 14:27:50 +0000 (16:27 +0200)]
radv: Free geometry infos in radv_CmdBuildAccelerationStructuresKHR

Fixes: 97ffaea5 ("radv: Add Radeon Raytracing Analyzer capturing layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18370>

23 months agoradv: Use radv_CmdUpdateBuffer instead of radv_update_buffer_cp for geometry info...
Friedrich Vock [Thu, 1 Sep 2022 14:25:58 +0000 (16:25 +0200)]
radv: Use radv_CmdUpdateBuffer instead of radv_update_buffer_cp for geometry info writes

This fixes some hangs and avoids an assert if geometry infos are bigger than 1KB.

Fixes: 97ffaea5 ("radv: Add Radeon Raytracing Analyzer capturing layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18370>

23 months agopanfrost: Route shader-db to debug, not stderr
Alyssa Rosenzweig [Wed, 31 Aug 2022 19:05:21 +0000 (15:05 -0400)]
panfrost: Route shader-db to debug, not stderr

This brings us in line with the rest of Mesa, fixing multithreaded shader-db
reports and the Total CPU Time report at the end.

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

23 months agor300: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 18:30:32 +0000 (14:30 -0400)]
r300: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agoetnaviv: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 18:29:19 +0000 (14:29 -0400)]
etnaviv: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agolima: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:53:40 +0000 (13:53 -0400)]
lima: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agosoftpipe: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:51:14 +0000 (13:51 -0400)]
softpipe: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agovc4: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:49:37 +0000 (13:49 -0400)]
vc4: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agov3d: Use u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 18:25:17 +0000 (14:25 -0400)]
v3d: Use u_default_set_debug_callback

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agogallium: Add u_default_set_debug_callback
Alyssa Rosenzweig [Wed, 31 Aug 2022 17:41:26 +0000 (13:41 -0400)]
gallium: Add u_default_set_debug_callback

Drivers that don't use compile queues can use a common implementation. Drivers
that do can tail call into the common implementation.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>

23 months agodozen: move to use common command buffer result code.
Dave Airlie [Wed, 8 Jun 2022 01:18:24 +0000 (11:18 +1000)]
dozen: move to use common command buffer result code.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

23 months agopanvk: use common command buffer record result.
Dave Airlie [Tue, 7 Jun 2022 20:26:28 +0000 (06:26 +1000)]
panvk: use common command buffer record result.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

23 months agoturnip: use common command record result.
Dave Airlie [Tue, 7 Jun 2022 20:25:18 +0000 (06:25 +1000)]
turnip: use common command record result.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

23 months agoradv: move to using common record_result.
Dave Airlie [Tue, 7 Jun 2022 20:11:19 +0000 (06:11 +1000)]
radv: move to using common record_result.

v2 (Jason Ekstrand):
 - Handle rename to vk_command_buffer_set_error
 - Add more instances, especially in device generated commands

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

23 months agovulkan/cmd_queue: Drop vk_cmd_queue::error
Jason Ekstrand [Wed, 31 Aug 2022 20:00:02 +0000 (15:00 -0500)]
vulkan/cmd_queue: Drop vk_cmd_queue::error

Instead, we return errors from each of the enqueue functions and record
those errors (if any) in vk_command_buffer::record_result.  This also
involves some awkward changes to each of the three drivers that uses
vk_cmd_queue but those are resolved in later commits as we convert those
drivers to the common error tracking.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

23 months agovulkan/cmd_buffer: add record_state to the common command buffer.
Jason Ekstrand [Wed, 31 Aug 2022 20:13:05 +0000 (15:13 -0500)]
vulkan/cmd_buffer: add record_state to the common command buffer.

This pulls the record state out of the cmd queue into the command
buffer. It can be used here by other drivers.

v2: add some get/set api: not set only sets the first error.

v3 (Jason Ekstrand):
 - Rename set_record_result to set_error
 - Automatically log the set error
 - Add a new vk_command_bufer_has_error() helper
 - Split out vk_cmd_queue changes into their own commit

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16918>

23 months agopanfrost/ci: Update G72 xflakes list
Alyssa Rosenzweig [Wed, 31 Aug 2022 15:33:51 +0000 (11:33 -0400)]
panfrost/ci: Update G72 xflakes list

I can't reproduce this locally on Mali-G52 and don't have Mali-G72 hardware.
Unless someone wants to investigate the flakes here in #7149, add a bigger
wildcard to the gathers xflakes list so we don't fail pipelines.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7149
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18348>

23 months agoradv: Proper handling for inactive instance nodes
Konstantin Seurer [Fri, 19 Aug 2022 13:28:04 +0000 (15:28 +0200)]
radv: Proper handling for inactive instance nodes

We only skipped the `accelerationStructureReference == 0` case
which could lead to reading uninitialized memory.
This patch introduces a NULL_NODE_ID constant and uses it
to handle inactive nodes properly.
I do not think, that this case is common in practice.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18141>

23 months agodocs: Add documentation about RADV RRA tracing
Friedrich Vock [Sun, 21 Aug 2022 00:16:49 +0000 (02:16 +0200)]
docs: Add documentation about RADV RRA tracing

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

23 months agoradv: Enable Radeon Raytracing Analyzer traces
Friedrich Vock [Sat, 20 Aug 2022 21:54:06 +0000 (23:54 +0200)]
radv: Enable Radeon Raytracing Analyzer traces

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

23 months agoradv: Add Radeon Raytracing Analyzer capturing layer
Friedrich Vock [Sat, 20 Aug 2022 21:53:50 +0000 (23:53 +0200)]
radv: Add Radeon Raytracing Analyzer capturing layer

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

23 months agoradv: Add Radeon Raytracing Analyzer trace dumping utilities
Friedrich Vock [Sat, 20 Aug 2022 21:50:38 +0000 (23:50 +0200)]
radv: Add Radeon Raytracing Analyzer trace dumping utilities

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

23 months agoradv: Add metadata to acceleration structures
Friedrich Vock [Mon, 29 Aug 2022 11:33:54 +0000 (13:33 +0200)]
radv: Add metadata to acceleration structures

This metadata is used for dumping RRA traces.

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

23 months agoradv: Generalize instance count in BVH states to leaf node count
Friedrich Vock [Sat, 27 Aug 2022 22:33:16 +0000 (00:33 +0200)]
radv: Generalize instance count in BVH states to leaf node count

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

23 months agoaco/ra: rework fixed operands
Rhys Perry [Fri, 24 Jun 2022 11:36:24 +0000 (12:36 +0100)]
aco/ra: rework fixed operands

This moves all fixed operands at once, so they don't interfere with one
another.

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

23 months agoaco/ra: remove bounds parameter from get_regs_for_copies()
Rhys Perry [Thu, 30 Jun 2022 12:44:28 +0000 (13:44 +0100)]
aco/ra: remove bounds parameter from get_regs_for_copies()

I don't think it makes sense for this to be anything but get_reg_bounds(),
and this change makes this function usuable with a mix of SGPRs and VGPRs.

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

23 months agoaco/ra: handle empty def_reg interval in get_regs_for_copies
Rhys Perry [Fri, 24 Jun 2022 10:53:18 +0000 (11:53 +0100)]
aco/ra: handle empty def_reg interval in get_regs_for_copies

If def_reg is empty, then def_reg.lo() may be lower than bounds.lo() if
we're moving VGPRs and info.bounds will be invalid.

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

23 months agoradv/ci: disable kabini's vkd3d job
Martin Roukala (né Peres) [Wed, 31 Aug 2022 15:02:15 +0000 (18:02 +0300)]
radv/ci: disable kabini's vkd3d job

The vkd3d update increased its RAM usage above the 4GB of RAM the
kabini has... which leads to amdgpu complaining about not having
enough RAM for command submission.

Let's disable the job until we find a way to lower concurrency or
increase the amount of carveout that could be used for command
submission.

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

23 months agoradv/ci: disable the POLARIS10 jobs
Martin Roukala (né Peres) [Wed, 31 Aug 2022 14:55:55 +0000 (17:55 +0300)]
radv/ci: disable the POLARIS10 jobs

A kernel bug makes the first-context's creation likely to hang the GPU,
which most times than not end up failing the job despite multiple
retries.

Disable the jobs until the bug gets bisected or worked around
effectively.

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

23 months agopvr: Update FWIF compute register structure
Sarah Walker [Tue, 19 Jul 2022 09:27:44 +0000 (10:27 +0100)]
pvr: Update FWIF compute register structure

This matches changes made in FW 1.17.OS@6280047.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17680>

23 months agopvr: remove redundant TODO
Frank Binns [Tue, 30 Aug 2022 18:13:02 +0000 (19:13 +0100)]
pvr: remove redundant TODO

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

23 months agoaco: Fix p_init_scratch for task shaders.
Timur Kristóf [Wed, 31 Aug 2022 13:04:58 +0000 (15:04 +0200)]
aco: Fix p_init_scratch for task shaders.

Fixes: d2d94b62f2a4f8686c17b7c33ae02aa2b2029a27
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18339>

23 months agoetnaviv: rewrite sampler TS check
Lucas Stach [Fri, 12 Aug 2022 16:35:08 +0000 (18:35 +0200)]
etnaviv: rewrite sampler TS check

The current way this check is written is getting hard to read. Make
things a bit more verbose by splitting the checks and putting the
comments directly in front of them.

No functional change, GCC11 generates exactly the same machine code
before and after the change.

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

23 months agoetnaviv: texture-desc: drop superfluous condition
Lucas Stach [Fri, 12 Aug 2022 22:39:32 +0000 (00:39 +0200)]
etnaviv: texture-desc: drop superfluous condition

After ad48411d721e ("etnaviv: fix linear_nearest / nearest_linear filters
on GC7000Lite") the code in both branches of the condition is exactly the
same, so there is no need for the condition at all.

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

23 months agoetnaviv: texture-desc: sample 1D textures using 2D mode
Lucas Stach [Fri, 12 Aug 2022 22:32:02 +0000 (00:32 +0200)]
etnaviv: texture-desc: sample 1D textures using 2D mode

Mipmapping is not working correctly when sampling a 1D texture, likely
due to a bad derivative being used by the hardware for the unused
dimension.
To work around this, do the same trick as already used in texture-state
by upgrading 1D textures to 2D samplers with VWARP mode set to repeat.

Fixes piglit spec@glsl-1.20@execution@tex-miplevel-selection 1d

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

23 months agoetnaviv: don't use TS with multi-layer resources
Lucas Stach [Fri, 12 Aug 2022 22:11:33 +0000 (00:11 +0200)]
etnaviv: don't use TS with multi-layer resources

Clear and render operations can target each layer of a multi-layer resource
separately, which means we would need to track TS valid and clear color
states for each layer separately to make TS work correctly. As multi-layer
resources are very likely not primarily used for rendering, they are unlikely
to profit much from TS, so instead of adding all this state, don't use TS for
such resources at all.

Fixes piglit spec@glsl-1.20@execution@tex-miplevel-selection 3d

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

23 months agoetnaviv: fill alpha channel for DXT1_RGB textures
Lucas Stach [Thu, 11 Aug 2022 13:22:35 +0000 (15:22 +0200)]
etnaviv: fill alpha channel for DXT1_RGB textures

As the HW uses the same decompression scheme for both RGBA and RGB
DXT1 textures, it needs to be told to properly fill the alpha channel
for the plain RGB format.

Fixes piglit spec@ext_texture_compression_s3tc@s3tc-targeted.

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

23 months agor600/sfn: Don't scalarize fdd instructions
Gert Wollny [Wed, 31 Aug 2022 11:38:21 +0000 (13:38 +0200)]
r600/sfn: Don't scalarize fdd instructions

These are handled by a vectorized texture op.

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

23 months agor600/sfn: Override VPM if access in helpers is requested
Gert Wollny [Wed, 31 Aug 2022 10:50:38 +0000 (12:50 +0200)]
r600/sfn: Override VPM if access in helpers is requested

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

23 months agor600/sfn: more peephole optimization with conditionals
Gert Wollny [Wed, 31 Aug 2022 09:24:17 +0000 (11:24 +0200)]
r600/sfn: more peephole optimization with conditionals

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

23 months agor600/sfn: ACK all image stores, also at end of loop
Gert Wollny [Wed, 31 Aug 2022 08:24:00 +0000 (10:24 +0200)]
r600/sfn: ACK all image stores, also at end of loop

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

23 months agor600/sfn: override register ID when it doesn't matter
Gert Wollny [Wed, 31 Aug 2022 06:13:18 +0000 (08:13 +0200)]
r600/sfn: override register ID when it doesn't matter

When a vec4 register only uses constant value of ignore
swizzles then emit zero as register ID.

Optimizing the register use in instructions that support this type
of swizzle may lead to the situation that the RA doesn't see the
register ID, because it is actually irreleant, in this case return
zero as register ID to avoid that the assembler uselessly reports
a high requirement for registers based on a stale register ID.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
   r600/sfn: rewrite NIR backend

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

23 months agoradeonsi: avoid a use-after-free
Thomas H.P. Andersen [Wed, 31 Aug 2022 21:06:05 +0000 (23:06 +0200)]
radeonsi: avoid a use-after-free

Use of 'shader' after free was added in ac6fb2467fefa78de12af53490b70ab04e73749a

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

23 months agov3dv: implement VK_KHR_workgroup_memory_explicit_layout
Iago Toral Quiroga [Wed, 31 Aug 2022 10:39:32 +0000 (12:39 +0200)]
v3dv: implement VK_KHR_workgroup_memory_explicit_layout

There is an issue with some Amber tests for this feature using
a larger number of workgroup invocations than supported without
checking the limit. I filed and issue [1] (and a CL with a fix), but
meanwhile we want to flag those as expected crashes for CI.

[1] https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3913

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18337>

23 months agost: Fixes warning [-Wimplicit-fallthrough] in st_texture.c
Yonggang Luo [Tue, 23 Aug 2022 04:56:26 +0000 (12:56 +0800)]
st: Fixes warning [-Wimplicit-fallthrough] in st_texture.c

Warning message:
../src/mesa/state_tracker/st_texture.c:190:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

23 months agov3dv: Remove redundant unreachable in v3dvx_pipeline.c
Yonggang Luo [Tue, 23 Aug 2022 05:18:31 +0000 (13:18 +0800)]
v3dv: Remove redundant unreachable in v3dvx_pipeline.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

23 months agov3dv: Fixes warning [-Wimplicit-fallthrough] in v3dvx_pipeline.c
Yonggang Luo [Tue, 23 Aug 2022 04:47:51 +0000 (12:47 +0800)]
v3dv: Fixes warning [-Wimplicit-fallthrough] in v3dvx_pipeline.c

Warning message:
../src/broadcom/vulkan/v3dvx_pipeline.c:60:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

23 months agovdpau: Fixes warning [-Wimplicit-fallthrough] in vdpau_private.h
Yonggang Luo [Tue, 23 Aug 2022 04:39:28 +0000 (12:39 +0800)]
vdpau: Fixes warning [-Wimplicit-fallthrough] in vdpau_private.h

Warning message:
../src/gallium/frontends/vdpau/vdpau_private.h:149:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-By: Sil Vilerino sivileri@microsoft.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>

23 months agofreedreno: Fixes warning [-Wimplicit-fallthrough] in fd6_emit.c
Yonggang Luo [Tue, 23 Aug 2022 05:24:31 +0000 (13:24 +0800)]
freedreno: Fixes warning [-Wimplicit-fallthrough] in fd6_emit.c

Warning message:
../src/gallium/drivers/freedreno/a6xx/fd6_emit.c:177:13: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18204>