platform/upstream/mesa.git
2 years agointel/dev: Add ATS-M pci-ids
Jordan Justen [Fri, 8 Apr 2022 06:35:06 +0000 (23:35 -0700)]
intel/dev: Add ATS-M pci-ids

Ref: Bspec 44477
Ref: https://patchwork.freedesktop.org/series/101907/
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15814>

2 years agonir_to_tgsi: Fix emitting the sample number for non-array MSAA image access.
Emma Anholt [Tue, 5 Apr 2022 17:05:37 +0000 (10:05 -0700)]
nir_to_tgsi: Fix emitting the sample number for non-array MSAA image access.

It's always in .w, rather than being the next component after the
x/y/array index.

Fixes: c6d3fd8c21e0 ("gallium/ntt: Emit sample index when necessary for image load/store.")
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15825>

2 years agovirgl: Disable nir_op_ffloor to avoid sending DFLR to virglrenderer.
Emma Anholt [Mon, 28 Mar 2022 23:48:31 +0000 (16:48 -0700)]
virgl: Disable nir_op_ffloor to avoid sending DFLR to virglrenderer.

This means that we send ffract+fsub in place of a normal FLR, but
hopefully virglrenderer can be fixed (or doubles support removed).

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

2 years agoradv: introduce new radv_pipeline_stage structure
Samuel Pitoiset [Tue, 5 Apr 2022 11:09:35 +0000 (13:09 +0200)]
radv: introduce new radv_pipeline_stage structure

This is used to store everything for a pipeline stage like the module,
the NIR, the shader arguments etc. This is inspired from ANV.

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

2 years agoradv: add missing multi inclusion define to radv_shader_args.h
Samuel Pitoiset [Tue, 5 Apr 2022 12:04:54 +0000 (14:04 +0200)]
radv: add missing multi inclusion define to radv_shader_args.h

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

2 years agoradv: rework pipeline and shaders creation feedback
Samuel Pitoiset [Fri, 8 Apr 2022 06:38:05 +0000 (08:38 +0200)]
radv: rework pipeline and shaders creation feedback

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

2 years agoradv: re-order shader stages directly in radv_create_shaders()
Samuel Pitoiset [Thu, 7 Apr 2022 14:01:10 +0000 (16:01 +0200)]
radv: re-order shader stages directly in radv_create_shaders()

We will have to access pStages::pNext for modules and this will also
allow to rework feedback creation.

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

2 years agopvr: Remove logic to set vk_device::alloc.
Rajnesh Kanwal [Mon, 4 Apr 2022 13:01:56 +0000 (14:01 +0100)]
pvr: Remove logic to set vk_device::alloc.

The field is being already set by vk_device_init().

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

2 years agov3dv: fix bogus VkDrmFormatModifierProperties2EXT usage
Iago Toral Quiroga [Fri, 8 Apr 2022 11:48:54 +0000 (13:48 +0200)]
v3dv: fix bogus VkDrmFormatModifierProperties2EXT usage

The array is allocated for VkDrmFormatModifierPropertiesEXT, so
writring entried with type VkDrmFormatModifierProperties2EXT is
bogus.

It seems this was a mistake added with a change intended to get
rid of VK_OUTARRAY_MAKE, that changed the type of the write by
mistake.

Fixes: 56a2ccf05864 ('v3dv: Stop using VK_OUTARRAY_MAKE()')
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15819>

2 years agoci: Disable Link Power Management with RTL8153
Tomeu Vizoso [Tue, 5 Apr 2022 10:20:11 +0000 (12:20 +0200)]
ci: Disable Link Power Management with RTL8153

There are reliability problems with the RTL8153 ethernet driver under
certain network loads, related to incompatibility of the device with
Link Power Management.

Add usbcore.quirks=0bda:8153:k to the kernel command line to enable the
USB_QUIRK_NO_LPM option.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15791>

2 years agoRevert "ci/freedreno: Disable a618 jobs"
Tomeu Vizoso [Tue, 5 Apr 2022 10:16:27 +0000 (12:16 +0200)]
Revert "ci/freedreno: Disable a618 jobs"

This reverts commit 96e17287b4abe6ac1e0245473ed9ccfe40d0d54a.

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

2 years agov3d: do not leak BO on query begin
Juan A. Suarez Romero [Thu, 7 Apr 2022 16:05:36 +0000 (18:05 +0200)]
v3d: do not leak BO on query begin

This happens when we have a sequence of multiple beginQuery / endQuery
with the same target and query identifier.

As a BO is created on beginQuery but not free on endQuery (we need to
wait until either explicitly deleting the query or querying the
results), in the above sequence we are basically leaking the BO.

This ensures that any BO created before is unreference before creating
the new one.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15796>

2 years agowgl: do not disable error-dialogs by default
Erik Faye-Lund [Mon, 21 Mar 2022 10:49:27 +0000 (11:49 +0100)]
wgl: do not disable error-dialogs by default

We don't know if an application developer wants error-dialog by default
or not, even when using a Mesa OpenGL driver.

So let's not assume this is a good thing, and instead make an option for
this behavior that we can enable for CI testing.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>

2 years agoutil: limit error-dialogs to win32
Erik Faye-Lund [Mon, 21 Mar 2022 10:43:54 +0000 (11:43 +0100)]
util: limit error-dialogs to win32

These dialogs only exist on Windows, so let's not even expose a util
function for this on other platforms.

The code is only ever called from Windows specific code anyway.

While we're at it, clean up the name a bit as well.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>

2 years agowgl: rename force-msaa env-var
Erik Faye-Lund [Mon, 21 Mar 2022 10:09:51 +0000 (11:09 +0100)]
wgl: rename force-msaa env-var

This env-var is not specific to the SVGA driver, so we should rename it
for consistency.

While we're at it, let's document the feature.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>

2 years agoradv: Disable NGG for GS with suboptimal output vertex count.
Timur Kristóf [Wed, 6 Apr 2022 12:15:50 +0000 (14:15 +0200)]
radv: Disable NGG for GS with suboptimal output vertex count.

When GS has a lot of output vertices: In this case,
the occupancy of NGG GS is very low because API GS invocations
can't even occupy a single Wave32 wave.
Therefore the legacy pipeline performs better here.

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

2 years agodzn: Support independent depth/stencil access
Boris Brezillon [Mon, 4 Apr 2022 11:55:00 +0000 (13:55 +0200)]
dzn: Support independent depth/stencil access

Needed for VK_KHR_maintenance2. While at it, fix various places where
we were only issuing resource state transition on the first sub-resource
instead of doing it per-layer/aspect.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Fix 2D <-> 3D blits
Boris Brezillon [Mon, 4 Apr 2022 11:50:02 +0000 (13:50 +0200)]
dzn: Fix 2D <-> 3D blits

layer_count == 1 doesn't imply image_is_3d. So let's add explicit
is_3d checks where appropriate.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Lower partial copy of multisample resources to blits
Boris Brezillon [Mon, 4 Apr 2022 11:45:06 +0000 (13:45 +0200)]
dzn: Lower partial copy of multisample resources to blits

Unfortunately that won't work on transfer queues, but we don't have a
better option right now.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agovulkan/util: Make STACK_ARRAY() C++-friendly
Boris Brezillon [Fri, 1 Apr 2022 14:16:56 +0000 (07:16 -0700)]
vulkan/util: Make STACK_ARRAY() C++-friendly

C++ doesn't like the {0} initializer pattern when the first
field is not an integer, let's use the {} when __cplusplus is
defined.

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

2 years agodzn: Drop extra blank line in dzn_CmdCopyImage2()
Boris Brezillon [Mon, 4 Apr 2022 11:41:30 +0000 (13:41 +0200)]
dzn: Drop extra blank line in dzn_CmdCopyImage2()

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Check image view usage instead of image usage when creating an image view
Boris Brezillon [Mon, 4 Apr 2022 11:21:46 +0000 (13:21 +0200)]
dzn: Check image view usage instead of image usage when creating an image view

So we take VkImageViewUsageCreateInfo extension instead of ignoring it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Force sampleCounts to 1 for bgra4 images
Boris Brezillon [Thu, 31 Mar 2022 16:04:24 +0000 (18:04 +0200)]
dzn: Force sampleCounts to 1 for bgra4 images

Those are not expected to be used as render-target, and Vulkan mandates
that such formats get their sampleCounts set to VK_SAMPLE_COUNT_1_BIT.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Get rid of dzn_GetPhysicalDeviceProperties()
Boris Brezillon [Mon, 4 Apr 2022 11:25:48 +0000 (13:25 +0200)]
dzn: Get rid of dzn_GetPhysicalDeviceProperties()

Rely on the vk_common_ wrapper.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Get rid of dzn_GetPhysicalDeviceFeatures()
Boris Brezillon [Thu, 31 Mar 2022 15:59:22 +0000 (17:59 +0200)]
dzn: Get rid of dzn_GetPhysicalDeviceFeatures()

And rely on the vk_common_ wrapper to get it implemented.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: 3D array images don't exist
Boris Brezillon [Thu, 31 Mar 2022 15:57:29 +0000 (17:57 +0200)]
dzn: 3D array images don't exist

Let's force maxArrayLayers to one in that case.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Set bufferFeatures to zero on depth/stencil formats
Boris Brezillon [Tue, 5 Apr 2022 10:01:05 +0000 (03:01 -0700)]
dzn: Set bufferFeatures to zero on depth/stencil formats

Those are not supposed to advertise buffer features.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Make sure the properties are all zero when the format is not supported
Boris Brezillon [Thu, 31 Mar 2022 15:56:37 +0000 (17:56 +0200)]
dzn: Make sure the properties are all zero when the format is not supported

Move one of the is_supported() check before we start filling the
structure so we don't end up with a partially filled object when
we return VK_ERROR_FORMAT_NOT_SUPPORTED (which deqp doesn't seem to like,
so it's probably coming from a spec requirement).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Return a valid imageFormatProperties.maxMipLevels
Boris Brezillon [Thu, 31 Mar 2022 15:52:45 +0000 (17:52 +0200)]
dzn: Return a valid imageFormatProperties.maxMipLevels

maxMipLevels is encoding the maximum number of MIP levels, but
dzn_physical_device_get_max_mip_levels() return the maximum MIP level.
Let's rename the function and add one to the returned value to fix
the problem.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Fix 3D <-> 2D image copies
Boris Brezillon [Thu, 31 Mar 2022 15:49:49 +0000 (17:49 +0200)]
dzn: Fix 3D <-> 2D image copies

We just need to treat layers as slices when manipulating 3D resources
whose slices are coming from/going to 2D array layers.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Support 2Darray views on 3D images for color attachments
Boris Brezillon [Thu, 31 Mar 2022 15:47:21 +0000 (17:47 +0200)]
dzn: Support 2Darray views on 3D images for color attachments

Those are declared as 3D RTVs in D3D12, and layers are treated as
slices.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Fix dzn_image_get_rtv_desc() for 3D views
Boris Brezillon [Thu, 31 Mar 2022 15:44:19 +0000 (17:44 +0200)]
dzn: Fix dzn_image_get_rtv_desc() for 3D views

VK_REMAINING_ARRAY_LAYERS maps to -1 in the D3D12 world. Let's make sure
we set WSize to -1 in that case, because the layer_count calculated by
dzn_get_layer_count() won't work for 3D images which never have more
than one layer (in case of 3D images, we treat slices as layers).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Replace C++ references by pointers
Boris Brezillon [Thu, 31 Mar 2022 15:40:55 +0000 (17:40 +0200)]
dzn: Replace C++ references by pointers

Let's keep as much as we can in plain C.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Align the default case in dzn_image_view_prepare_dsv_desc()
Boris Brezillon [Thu, 31 Mar 2022 15:39:14 +0000 (17:39 +0200)]
dzn: Align the default case in dzn_image_view_prepare_dsv_desc()

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Don't crash when EndCommandBuffer() returns an error
Boris Brezillon [Thu, 31 Mar 2022 15:36:52 +0000 (17:36 +0200)]
dzn: Don't crash when EndCommandBuffer() returns an error

Leftover from a debug session.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Fix dzn_translate_viewport() when height < 0
Boris Brezillon [Thu, 31 Mar 2022 14:19:56 +0000 (07:19 -0700)]
dzn: Fix dzn_translate_viewport() when height < 0

Since negative height is not a thing in D3D12, we need to adjust the
TopLeftY accordingly.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agodzn: Fix pipeline creation when rasterization is disabled
Boris Brezillon [Fri, 1 Apr 2022 08:04:12 +0000 (01:04 -0700)]
dzn: Fix pipeline creation when rasterization is disabled

We use some of the VkGraphicsPipelineCreateInfo fields that should
be ignored when rasterization in disabled, assuming those who be set
to NULL by the caller in that case, which is not mandated by the
Vulkan specification.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>

2 years agovirgl/ci: Uprev virglrenderer and crosvm
Corentin Noël [Wed, 6 Apr 2022 13:58:46 +0000 (15:58 +0200)]
virgl/ci: Uprev virglrenderer and crosvm

Use a patch file for crosvm instead of relying on private repositories for faster
uprevs.
Use latest virglrenderer to keep the tests in-sync.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15772>

2 years agoci: Only apply patches with the build-skqp prefix
Corentin Noël [Wed, 6 Apr 2022 13:57:40 +0000 (15:57 +0200)]
ci: Only apply patches with the build-skqp prefix

Allows to ship patches for other components too.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15772>

2 years agoradv: stop relying on shader modules after SPIRV->NIR
Samuel Pitoiset [Wed, 6 Apr 2022 10:43:12 +0000 (12:43 +0200)]
radv: stop relying on shader modules after SPIRV->NIR

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

2 years agoradv: stop passing the module to the compiler debug callback
Samuel Pitoiset [Wed, 6 Apr 2022 10:37:47 +0000 (12:37 +0200)]
radv: stop passing the module to the compiler debug callback

After SPIRV->NIR, the driver shouldn't rely on the module. This will
still report messages via VK_EXT_debug_report but the object will be
NULL.

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

2 years agoradv: drop the module reference for enable_mrt_output_nan_fixup
Samuel Pitoiset [Wed, 6 Apr 2022 10:25:33 +0000 (12:25 +0200)]
radv: drop the module reference for enable_mrt_output_nan_fixup

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

2 years agoradv: drop the module reference in radv_can_dump_shader_stats()
Samuel Pitoiset [Wed, 6 Apr 2022 10:54:37 +0000 (12:54 +0200)]
radv: drop the module reference in radv_can_dump_shader_stats()

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

2 years agoradv: drop the module reference in radv_can_dump_shader()
Samuel Pitoiset [Wed, 6 Apr 2022 10:23:40 +0000 (12:23 +0200)]
radv: drop the module reference in radv_can_dump_shader()

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

2 years agoradv: copy the spirv module for debugging after compilation
Samuel Pitoiset [Wed, 6 Apr 2022 10:34:46 +0000 (12:34 +0200)]
radv: copy the spirv module for debugging after compilation

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

2 years agoradv: remove more references to the pipeline layout during compilation
Samuel Pitoiset [Tue, 5 Apr 2022 08:27:28 +0000 (10:27 +0200)]
radv: remove more references to the pipeline layout during compilation

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

2 years agoradv: lower ycbcr textures just before applying the pipeline layout
Samuel Pitoiset [Tue, 5 Apr 2022 08:33:46 +0000 (10:33 +0200)]
radv: lower ycbcr textures just before applying the pipeline layout

This shouldn't change anything.

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

2 years agoradv: assert that the arg is declared when used in get_scalar_arg()
Samuel Pitoiset [Thu, 7 Apr 2022 09:47:45 +0000 (11:47 +0200)]
radv: assert that the arg is declared when used in get_scalar_arg()

Help debugging.

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

2 years agoradv: add radv_is_vrs_enabled()
Samuel Pitoiset [Thu, 7 Apr 2022 12:21:31 +0000 (14:21 +0200)]
radv: add radv_is_vrs_enabled()

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

2 years agoradv: add a new helper to initialize various type of pipelines
Samuel Pitoiset [Mon, 4 Apr 2022 10:28:49 +0000 (12:28 +0200)]
radv: add a new helper to initialize various type of pipelines

This is common to graphics, compute and library pipelines.

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

2 years agoradv: add radv_generate_pipeline_key() for common graphics/compute keys
Samuel Pitoiset [Thu, 7 Apr 2022 11:54:12 +0000 (13:54 +0200)]
radv: add radv_generate_pipeline_key() for common graphics/compute keys

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

2 years agoradv: remove unused parameters in radv_get_{wave,ballot_bit}_size()
Samuel Pitoiset [Thu, 7 Apr 2022 08:38:43 +0000 (10:38 +0200)]
radv: remove unused parameters in radv_get_{wave,ballot_bit}_size()

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

2 years agoradv: use radv_pipeline_has_ds_attachments() more
Samuel Pitoiset [Wed, 6 Apr 2022 12:32:30 +0000 (14:32 +0200)]
radv: use radv_pipeline_has_ds_attachments() more

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

2 years agoradv: do not check if VkPipelineRenderingCreateInfo is NULL
Samuel Pitoiset [Wed, 6 Apr 2022 12:29:12 +0000 (14:29 +0200)]
radv: do not check if VkPipelineRenderingCreateInfo is NULL

The driver converts legacy render pass to dynamic rendering, so this
structure should always be in pNext.

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

2 years agobroadcom/compiler: prefer reconstruction over TMU spills when possible
Iago Toral Quiroga [Fri, 1 Apr 2022 08:51:50 +0000 (10:51 +0200)]
broadcom/compiler: prefer reconstruction over TMU spills when possible

We have been reconstructing/rematerializing uniforms for a while, but we
can do this in more scenarios, namely instructions which result is
immutable along the execution of a shader across all channels.

By doing this we gain the capacity to eliminate TMU spills which not
only are slower, but can also make us drop to a fallback compilation
strategy.

Shader-db results show a small increase in instruction counts caused
by us now being able to choose preferential compiler strategies that
are intended to reduce TMU latency. In some cases, we are now also
able to avoid dropping thread counts:

total instructions in shared programs: 12658092 -> 12659245 (<.01%)
instructions in affected programs: 75812 -> 76965 (1.52%)
helped: 55
HURT: 107

total threads in shared programs: 416286 -> 416412 (0.03%)
threads in affected programs: 126 -> 252 (100.00%)
helped: 63
HURT: 0

total uniforms in shared programs: 3716916 -> 3716396 (-0.01%)
uniforms in affected programs: 19327 -> 18807 (-2.69%)
helped: 94
HURT: 50

total max-temps in shared programs: 2161796 -> 2161578 (-0.01%)
max-temps in affected programs: 3961 -> 3743 (-5.50%)
helped: 80
HURT: 24

total spills in shared programs: 3274 -> 3266 (-0.24%)
spills in affected programs: 98 -> 90 (-8.16%)
helped: 6
HURT: 0

total fills in shared programs: 4657 -> 4642 (-0.32%)
fills in affected programs: 130 -> 115 (-11.54%)
helped: 6
HURT: 0

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

2 years agofreedreno/a6xx: Fix SP_DS_CTRL_REG0 definition
Connor Abbott [Thu, 7 Apr 2022 17:10:40 +0000 (19:10 +0200)]
freedreno/a6xx: Fix SP_DS_CTRL_REG0 definition

Bit 20 isn't actually MERGEDREGS, the mode for the entire geometry
pipeline is controlled by SP_VS_CTRL_REG0::MERGEDREGS and it appears to
be something preamble-related instead since writing any register in the
preamble hangs if it's set. This fixes those hangs on freedreno and
turnip since we no longer set it.

Fixes: fccc35c2def ("ir3: Add preamble optimization pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15801>

2 years agomesa/st: simplify st_can_add_pointsize_to_program iterator
Mike Blumenkrantz [Mon, 4 Apr 2022 23:08:13 +0000 (19:08 -0400)]
mesa/st: simplify st_can_add_pointsize_to_program iterator

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

2 years agomesa/st: don't precompile the pointsize upload variant anymore
Mike Blumenkrantz [Thu, 31 Mar 2022 16:36:47 +0000 (12:36 -0400)]
mesa/st: don't precompile the pointsize upload variant anymore

this is no longer likely to be used, so precompile the base variant now

also delete some now-unused code

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

2 years agomesa/st: only flag pointsize constant uploads if they're needed
Mike Blumenkrantz [Thu, 31 Mar 2022 16:31:29 +0000 (12:31 -0400)]
mesa/st: only flag pointsize constant uploads if they're needed

now that shaders are guaranteed to have a pointsize export, the only time
the variant using the uploaded constant is needed is when pointsize != 1.0

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

2 years agomesa/st: only use constant upload pointsize variants if pointsize != 1.0
Mike Blumenkrantz [Thu, 31 Mar 2022 16:40:28 +0000 (12:40 -0400)]
mesa/st: only use constant upload pointsize variants if pointsize != 1.0

it's not that common for apps to need varying pointsize, so now that shaders
are guaranteed to have the export in the shader, the constant version is almost
never used

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

2 years agomesa/st: also add pointsize to fixedfunction vertex shaders as needed
Mike Blumenkrantz [Mon, 4 Apr 2022 15:35:21 +0000 (11:35 -0400)]
mesa/st: also add pointsize to fixedfunction vertex shaders as needed

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

2 years agomesa/st: always inject a 1.0 pointsize for vertex stages
Mike Blumenkrantz [Wed, 30 Mar 2022 13:24:03 +0000 (09:24 -0400)]
mesa/st: always inject a 1.0 pointsize for vertex stages

since 1.0 is used in nearly every case, drivers requiring this exporting
can avoid potential shader variants by adding a 1.0 export to the base
shader variant and the only using the ubo upload when pointsize is explicitly
set for wide point functionality

drivers can then be responsible for removing unused pointsize exports
as needed (or desired)

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

2 years agomesa/st: declare added pointsize var as hidden
Mike Blumenkrantz [Wed, 30 Mar 2022 16:46:21 +0000 (12:46 -0400)]
mesa/st: declare added pointsize var as hidden

ensure this isn't counted as part of the shader and ignored for e.g.,
glGetProgramInterfaceiv

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

2 years agonir/lower_point_size_mov: fix check for overwriting existing pointsize
Mike Blumenkrantz [Wed, 30 Mar 2022 13:23:03 +0000 (09:23 -0400)]
nir/lower_point_size_mov: fix check for overwriting existing pointsize

this should match the comment and allow overwriting injected pointsize
variables regardless of whether xfb is flagged

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

2 years agomesa: add a bool indicating when pointsize == 1.0
Mike Blumenkrantz [Wed, 30 Mar 2022 13:19:50 +0000 (09:19 -0400)]
mesa: add a bool indicating when pointsize == 1.0

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

2 years agoRevert "ci/freedreno: Reduce concurrency when replaying traces on a630"
Emma Anholt [Thu, 7 Apr 2022 20:03:21 +0000 (13:03 -0700)]
Revert "ci/freedreno: Reduce concurrency when replaying traces on a630"

This reverts commit d948f32365f53aa0677fef833ebaa2cc09d9ab67.

I think that fixing the timeout will have resolved this problem.

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

2 years agofreedreno: Fix the cpu-prep wait to be "infinite".
Emma Anholt [Thu, 7 Apr 2022 19:55:37 +0000 (12:55 -0700)]
freedreno: Fix the cpu-prep wait to be "infinite".

We don't need to restrict our timeout to 5 seconds, because the kernel's
hangcheck will ensure that the wait completes in finite time if the GPU
gets wedged.  If the GPU is making progress, we don't want to time out
early and have pipe_transfer_map() return an error, causing glReadPixels()
to throw a confusing GL_OOM even though we're not out memory.

The INFINITE arg to this function isn't actually infinite, it's limited to
an hour.  But an hour of GPU processing to wait on is probably plenty.

This 5s timeout has caused problems with the CTS on freedreno at high
parallelism, and I suspect is the cause of recent issues in the closed
traces replay jobs.

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

2 years agoglsl: fix needs_lowering() call in varying packing pass
Timothy Arceri [Wed, 6 Apr 2022 02:47:52 +0000 (12:47 +1000)]
glsl: fix needs_lowering() call in varying packing pass

Here we remove the outer arrays on geom and tess shaders where
needed. Without this the pass can sometimes attempt to pack a
varying on only one side of the shader interface where it is not
actually needed. The result can be mismatching varying types.

Fixes: d6b9202873f0 ("glsl: disable varying packing when its not safe")
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15761>

2 years agodocs: update features for lavapipe
Mike Blumenkrantz [Thu, 7 Apr 2022 21:57:15 +0000 (17:57 -0400)]
docs: update features for lavapipe

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

2 years agozink: ci updates
Mike Blumenkrantz [Thu, 7 Apr 2022 21:56:13 +0000 (17:56 -0400)]
zink: ci updates

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

2 years agozink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format
Mike Blumenkrantz [Thu, 7 Apr 2022 21:55:09 +0000 (17:55 -0400)]
zink: add error logging for SRGB framebuffer without KHR_swapchain_mutable_format

this is going to explode, so at least print an error explaining why

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

2 years agolavapipe: KHR_swapchain_mutable_format
Mike Blumenkrantz [Thu, 7 Apr 2022 21:19:52 +0000 (17:19 -0400)]
lavapipe: KHR_swapchain_mutable_format

it Just Works(tm)

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

2 years agozink: adds refs to user index buffers when tc is not active
Mike Blumenkrantz [Thu, 7 Apr 2022 21:01:00 +0000 (17:01 -0400)]
zink: adds refs to user index buffers when tc is not active

there are no ref tricks to abuse in this case, so add our own ref

fixes #6273

cc: mesa-stable

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

2 years agozink: allow lod for RECT sampler types
Mike Blumenkrantz [Thu, 7 Apr 2022 18:49:59 +0000 (14:49 -0400)]
zink: allow lod for RECT sampler types

the RECT is a lie, so this is fine

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

2 years agonir/lower_tex: avoid adding invalid LOD to RECT textures
Mike Blumenkrantz [Thu, 7 Apr 2022 18:49:07 +0000 (14:49 -0400)]
nir/lower_tex: avoid adding invalid LOD to RECT textures

this is illegal

Fixes: 74ec2b12be1 ("nir/lower_tex: Rework invalid implicit LOD lowering")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15804>

2 years agozink: set nir_shader_compiler_options::has_txs
Mike Blumenkrantz [Thu, 7 Apr 2022 16:04:57 +0000 (12:04 -0400)]
zink: set nir_shader_compiler_options::has_txs

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

2 years agonir: Dont set coord_components on txs
Jason Ekstrand [Tue, 5 Apr 2022 20:59:38 +0000 (15:59 -0500)]
nir: Dont set coord_components on txs

Fixes: e1fc23265f9f ("nir: Add a pass for lowering CL-style image ops to texture ops")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15758>

2 years agokopper: add a dmabuf-free image interface for use with sw drivers
Mike Blumenkrantz [Thu, 7 Apr 2022 18:28:55 +0000 (14:28 -0400)]
kopper: add a dmabuf-free image interface for use with sw drivers

sw drivers don't support modifiers or dmabufs or any of that, so separate
interfaces are needed to avoid advertising extensions that will only lead
to crashes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15802>

2 years agodzn: add missing space
Erik Faye-Lund [Wed, 6 Apr 2022 12:35:00 +0000 (14:35 +0200)]
dzn: add missing space

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: drop unused include
Erik Faye-Lund [Thu, 7 Apr 2022 11:43:27 +0000 (13:43 +0200)]
dzn: drop unused include

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: drop incorrect return statement
Erik Faye-Lund [Thu, 7 Apr 2022 12:02:57 +0000 (14:02 +0200)]
dzn: drop incorrect return statement

We're returning nothing here. Let's not do that.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: drop unused header
Erik Faye-Lund [Fri, 25 Mar 2022 15:52:42 +0000 (16:52 +0100)]
dzn: drop unused header

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: remove unused variable
Erik Faye-Lund [Fri, 25 Mar 2022 14:43:06 +0000 (15:43 +0100)]
dzn: remove unused variable

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: fixup indent
Erik Faye-Lund [Fri, 25 Mar 2022 14:09:00 +0000 (15:09 +0100)]
dzn: fixup indent

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: add D3D12_IGNORE_SDK_LAYERS define
Erik Faye-Lund [Fri, 25 Mar 2022 13:11:44 +0000 (14:11 +0100)]
dzn: add D3D12_IGNORE_SDK_LAYERS define

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: drop needless includes
Erik Faye-Lund [Fri, 25 Mar 2022 13:07:12 +0000 (14:07 +0100)]
dzn: drop needless includes

These include either dzn_nir.h or dzn_internal.h which already includes
this header.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: remove unused struct
Erik Faye-Lund [Tue, 5 Apr 2022 15:31:45 +0000 (17:31 +0200)]
dzn: remove unused struct

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agodzn: remove needless using
Erik Faye-Lund [Fri, 25 Mar 2022 12:16:26 +0000 (13:16 +0100)]
dzn: remove needless using

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15790>

2 years agozink: handle swapchain readbacks when a present is pending
Mike Blumenkrantz [Thu, 7 Apr 2022 13:16:55 +0000 (09:16 -0400)]
zink: handle swapchain readbacks when a present is pending

if a present semaphore is pending, don't try to create another one

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>

2 years agozink: only apply swapchain behavior in flush_resource for swapchain images
Mike Blumenkrantz [Wed, 6 Apr 2022 20:50:37 +0000 (16:50 -0400)]
zink: only apply swapchain behavior in flush_resource for swapchain images

these could otherwise be pixmaps or dmabufs

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>

2 years agozink: handle deferred swapchain resource flushing
Mike Blumenkrantz [Wed, 6 Apr 2022 20:49:03 +0000 (16:49 -0400)]
zink: handle deferred swapchain resource flushing

if the swapchain image hasn't been acquired yet, flag it as a deferred
present so it can be picked up on flush

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>

2 years agoegl: implement more hooks for swrast
Mike Blumenkrantz [Wed, 6 Apr 2022 20:47:52 +0000 (16:47 -0400)]
egl: implement more hooks for swrast

these just need to use swapbuffers instead of flush

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15784>

2 years agoanv: drop from_wsi bit from anv_image
Benjamin Cheng [Thu, 7 Apr 2022 16:56:49 +0000 (12:56 -0400)]
anv: drop from_wsi bit from anv_image

It was originally introduced in ca791f5c but it was never actually set
anywhere. It doesn't serve any purpose other than some sanity checking
so let's clean it up for now.

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

2 years agointel/fs: Better handle constant sources of FS_OPCODE_PACK_HALF_2x16_SPLIT
Ian Romanick [Mon, 14 Feb 2022 22:07:18 +0000 (14:07 -0800)]
intel/fs: Better handle constant sources of FS_OPCODE_PACK_HALF_2x16_SPLIT

I noticed that a *LOT* of fragment shaders in Shadow of the Tomb Raider,
for instance, end up with a sequence of NIR like:

    vec1 32 ssa_2 = load_const (0x00000000 = 0.000000)
    ...
    vec1 32 ssa_191 = pack_half_2x16_split ssa_188, ssa_2
    vec1 32 ssa_192 = pack_half_2x16_split ssa_189, ssa_2
    vec1 32 ssa_193 = pack_half_2x16_split ssa_190, ssa_2

This results in an assembly sequence like:

    mov(8)          g28<1>UD        0x00000000UD
    mov(8)          g21<2>HF        g28<8,8,1>F
    shl(8)          g21<1>UD        g21<8,8,1>UD    0x00000010UD
    mov(8)          g21<2>HF        g25<8,8,1>F
    mov(8)          g19<2>HF        g28<8,8,1>F
    shl(8)          g19<1>UD        g19<8,8,1>UD    0x00000010UD
    mov(8)          g19<2>HF        g23<8,8,1>F
    mov(8)          g20<2>HF        g28<8,8,1>F
    shl(8)          g20<1>UD        g20<8,8,1>UD    0x00000010UD
    mov(8)          g20<2>HF        g24<8,8,1>F

After this commit, the generated assembly is:

    mov(8)          g21<1>UD        0x00000000UD
    mov(8)          g21<2>HF        g23<8,8,1>F
    mov(8)          g19<1>UD        0x00000000UD
    mov(8)          g19<2>HF        g17<8,8,1>F
    mov(8)          g20<1>UD        0x00000000UD
    mov(8)          g20<2>HF        g18<8,8,1>F

Tiger Lake, Ice Lake, Skylake, and Haswell had similar results. (Ice Lake shown)
total instructions in shared programs: 20119086 -> 20119034 (<.01%)
instructions in affected programs: 9056 -> 9004 (-0.57%)
helped: 8
HURT: 0
helped stats (abs) min: 2 max: 16 x̄: 6.50 x̃: 4
helped stats (rel) min: 0.29% max: 1.75% x̄: 1.00% x̃: 0.98%
95% mean confidence interval for instructions value: -11.01 -1.99
95% mean confidence interval for instructions %-change: -1.56% -0.44%
Instructions are helped.

total cycles in shared programs: 861019414 -> 861021044 (<.01%)
cycles in affected programs: 279862 -> 281492 (0.58%)
helped: 4
HURT: 2
helped stats (abs) min: 6 max: 936 x̄: 239.00 x̃: 7
helped stats (rel) min: 0.03% max: 8.13% x̄: 2.09% x̃: 0.09%
HURT stats (abs)   min: 18 max: 2568 x̄: 1293.00 x̃: 1293
HURT stats (rel)   min: 0.36% max: 1.14% x̄: 0.75% x̃: 0.75%
95% mean confidence interval for cycles value: -972.56 1515.89
95% mean confidence interval for cycles %-change: -4.77% 2.49%
Inconclusive result (value mean confidence interval includes 0).

Broadwell
total instructions in shared programs: 17812327 -> 17812263 (<.01%)
instructions in affected programs: 9867 -> 9803 (-0.65%)
helped: 8
HURT: 0
helped stats (abs) min: 2 max: 28 x̄: 8.00 x̃: 4
helped stats (rel) min: 0.32% max: 1.80% x̄: 1.00% x̃: 0.95%
95% mean confidence interval for instructions value: -15.46 -0.54
95% mean confidence interval for instructions %-change: -1.54% -0.47%
Instructions are helped.

total cycles in shared programs: 904768620 -> 904773291 (<.01%)
cycles in affected programs: 454799 -> 459470 (1.03%)
helped: 4
HURT: 4
helped stats (abs) min: 36 max: 586 x̄: 344.50 x̃: 378
helped stats (rel) min: 0.47% max: 4.04% x̄: 2.01% x̃: 1.77%
HURT stats (abs)   min: 1 max: 5572 x̄: 1512.25 x̃: 238
HURT stats (rel)   min: <.01% max: 2.77% x̄: 1.46% x̃: 1.53%
95% mean confidence interval for cycles value: -1122.40 2290.15
95% mean confidence interval for cycles %-change: -2.26% 1.71%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 18581 -> 18579 (-0.01%)
spills in affected programs: 323 -> 321 (-0.62%)
helped: 1
HURT: 0

total fills in shared programs: 24985 -> 24981 (-0.02%)
fills in affected programs: 1348 -> 1344 (-0.30%)
helped: 1
HURT: 0

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
Instructions in all programs: 143585431 -> 143513657 (-0.0%)
Instructions helped: 14403

Cycles in all programs: 8439312778 -> 8439371578 (+0.0%)
Cycles helped: 10570
Cycles hurt: 3290

Gained: 146
Lost: 74

All of the lost and gained fossil-db shaders are SIMD32 fragment
shaders.  14,247 of the affected shaders are from Shadow of the Tomb
Raider.  154 are from Batman Arkham Origins, and the remaining two are
from Octopath Traveler.

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

2 years agopan/bi: Imply round mode most of the time
Alyssa Rosenzweig [Sun, 27 Feb 2022 20:46:17 +0000 (15:46 -0500)]
pan/bi: Imply round mode most of the time

Much less noisy, and provides a path to further improvements. There is a slight
behaviour change: int-to-float conversions now use RTE instead of RTZ. For
32-bit opcodes, this affects conversions of integers with magnitude greater than
2^23 by at most 1 ulp. As this behaviour is unspecified in GLSL, this change is
believed to be acceptable.

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

2 years agopan/bi: Use should_skip in bi_builder generation
Alyssa Rosenzweig [Sun, 27 Feb 2022 20:22:03 +0000 (15:22 -0500)]
pan/bi: Use should_skip in bi_builder generation

To avoid further code duplication.

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

2 years agopan/bi: Mark some opcodes as default round-to-zero
Alyssa Rosenzweig [Sun, 27 Feb 2022 20:46:03 +0000 (15:46 -0500)]
pan/bi: Mark some opcodes as default round-to-zero

Conversions to integer have different rounding rules.

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

2 years agopan/bi: Don't use funny round modes in tests
Alyssa Rosenzweig [Sun, 27 Feb 2022 19:46:15 +0000 (14:46 -0500)]
pan/bi: Don't use funny round modes in tests

To prepare for defeaturing round modes, replace uses of round-to-positive with
round-to-even in our unit tests. This doesn't meaningfully impact test coverage;
there is no way to generate that round mode.

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

2 years agopanfrost: Use track_image_access on Bifrost
Alyssa Rosenzweig [Thu, 7 Apr 2022 15:28:27 +0000 (11:28 -0400)]
panfrost: Use track_image_access on Bifrost

Equivalent logic, as previously extracted.

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

2 years agopanfrost: Add helpers to emit Valhall data structures
Alyssa Rosenzweig [Thu, 7 Apr 2022 15:26:10 +0000 (11:26 -0400)]
panfrost: Add helpers to emit Valhall data structures

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