platform/upstream/mesa.git
14 months agodevice_select_layer: fix inverted strcmp in device_select_find_dri_prime_tag_default...
Luna Nova [Sun, 16 Oct 2022 23:10:47 +0000 (16:10 -0700)]
device_select_layer: fix inverted strcmp in device_select_find_dri_prime_tag_default (v1)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7498
Fixes: 9bc5b2d169d ("vulkan: add initial device selection layer. (v6.1)")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19101>

14 months agosvga: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
svga: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

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

14 months agollvmpipe: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
llvmpipe: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

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

14 months agovc4: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
vc4: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>

14 months agov3d: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
v3d: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>

14 months agosoftpipe: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
softpipe: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

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

14 months agoiris: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
iris: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>

14 months agoi915: use util_unreference_framebuffer_state to unref fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:24:56 +0000 (16:24 -0400)]
i915: use util_unreference_framebuffer_state to unref fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>

14 months agoi915: use util_copy_framebuffer_state to set fb state
Mike Blumenkrantz [Mon, 24 Apr 2023 20:27:11 +0000 (16:27 -0400)]
i915: use util_copy_framebuffer_state to set fb state

Fixes: f5bde99cbdd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>

14 months agocso: unbind fb state when unbinding the context
Mike Blumenkrantz [Mon, 24 Apr 2023 20:23:52 +0000 (16:23 -0400)]
cso: unbind fb state when unbinding the context

this avoids leaking/ballooning references

cc: mesa-stable

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

14 months agoci: carry venus-protocol 1.0 release patches in virglrenderer
Yiwei Zhang [Tue, 2 May 2023 23:43:12 +0000 (16:43 -0700)]
ci: carry venus-protocol 1.0 release patches in virglrenderer

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22547>

14 months agodocs: update Virtio-GPU Venus driver page
Yiwei Zhang [Mon, 17 Apr 2023 22:40:49 +0000 (15:40 -0700)]
docs: update Virtio-GPU Venus driver page

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22547>

14 months agomeson/ci: promote virtio-experimental to virtio
Yiwei Zhang [Wed, 12 Apr 2023 18:15:33 +0000 (11:15 -0700)]
meson/ci: promote virtio-experimental to virtio

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22547>

14 months agovenus: adopt venus protocol release
Yiwei Zhang [Sat, 8 Apr 2023 06:53:09 +0000 (23:53 -0700)]
venus: adopt venus protocol release

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22547>

14 months agovenus: stop query experimental features
Yiwei Zhang [Sat, 8 Apr 2023 06:55:26 +0000 (23:55 -0700)]
venus: stop query experimental features

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22547>

14 months agoci/zink+anv: Test piglit quick_gl pre-merge, dropping a few KHR-GL46 tests.
Emma Anholt [Tue, 2 May 2023 17:53:18 +0000 (10:53 -0700)]
ci/zink+anv: Test piglit quick_gl pre-merge, dropping a few KHR-GL46 tests.

piglit provides way more important coverage than these bits of GL46, and
has been regressing regularly.  Thanks to dropping the long KHR-GL46
tests, this is now completing faster than it was before, and things will
get even better with
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/804.

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

14 months agoci/zink: Update more xfails for tgl piglit.
Emma Anholt [Tue, 2 May 2023 21:58:48 +0000 (14:58 -0700)]
ci/zink: Update more xfails for tgl piglit.

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

14 months agoRevert "ci/zink: Try to update TGL results for new MSAA behavior."
Emma Anholt [Tue, 2 May 2023 21:15:53 +0000 (14:15 -0700)]
Revert "ci/zink: Try to update TGL results for new MSAA behavior."

This reverts commit 74a8f118a2595479a94a8b7097680c5111d7273c.

This should have been in !22753.

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

14 months agovenus: use pipelineCacheUUID for shader cache id
Juston Li [Fri, 21 Apr 2023 16:55:51 +0000 (09:55 -0700)]
venus: use pipelineCacheUUID for shader cache id

Use the host driver pipelineCacheUUID as the shader cache id. This is
just used as an identifier for fossilize replay since venus utilizes
the host side shader cache anyways.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22634>

14 months agozink: sync queries at the end of cmdbufs
Mike Blumenkrantz [Wed, 3 May 2023 14:39:55 +0000 (10:39 -0400)]
zink: sync queries at the end of cmdbufs

with tc, query results can be fetched async, and it's impossible to
sync tc in this scenario. to avoid needing to sync when a sync is not
possible, sync ahead of time in all cases

Fixes: 7c96e989755 ("zink: always start/stop/resume queries inside renderpasses")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22827>

14 months agozink: null some descriptor buffer pointers during destruction
Mike Blumenkrantz [Wed, 3 May 2023 15:43:53 +0000 (11:43 -0400)]
zink: null some descriptor buffer pointers during destruction

this shouldn't actually be needed? and yet...

Fixes: 13c6ad0038a ("zink: use a single descriptor buffer for all non-bindless types")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22827>

14 months agozink: set depth dynamic state values unconditionally
Mike Blumenkrantz [Wed, 3 May 2023 14:39:10 +0000 (10:39 -0400)]
zink: set depth dynamic state values unconditionally

spec requires the state values to be set if the dynamic state is
enabled regardless of whether they will take effect

cc: mesa-stable

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

14 months agonouveau/nir: image_samples/size don't have coordinates
Faith Ekstrand [Wed, 3 May 2023 14:46:55 +0000 (09:46 -0500)]
nouveau/nir: image_samples/size don't have coordinates

Without this, it treats the src[1] as a coordinate (it's actually LOD)
and may try to read more than one component.  I don't think this usually
hurts anything as the coordinate should get ignored later but it can
result in OOB memory reads while translating NIR.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22834>

14 months agozink: disable a630 traces
Mike Blumenkrantz [Wed, 3 May 2023 15:53:10 +0000 (11:53 -0400)]
zink: disable a630 traces

I can't even run a fair number of these locally without a gpu hang,
and there are no validation errors, so just disable the whole thing
until at least #8874 can be resolved

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

14 months agonv50/codegen: Set lower_uniforms_to_ubo
M Henning [Fri, 17 Feb 2023 22:32:12 +0000 (17:32 -0500)]
nv50/codegen: Set lower_uniforms_to_ubo

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22815>

14 months agopanfrost: Check blend enabled state in pan_allow_forward_pixel_to_kill()
Boris Brezillon [Fri, 7 Apr 2023 13:16:17 +0000 (15:16 +0200)]
panfrost: Check blend enabled state in pan_allow_forward_pixel_to_kill()

The shader can write to a specific RT, but the blend descriptor gets
to decide if the RT is really updated. We need to take that into
account when initializing the rt_written local variable in
pan_allow_forward_pixel_to_kill() otherwise we might get inconsistent
results.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22465>

14 months agoci/zink: Disable Freedoom trace on ANV
Daniel Stone [Wed, 3 May 2023 09:40:51 +0000 (10:40 +0100)]
ci/zink: Disable Freedoom trace on ANV

Apparently it's flaky.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22819>

14 months agoradv/ci: document a series of recent regressions
Martin Roukala (né Peres) [Wed, 3 May 2023 10:13:05 +0000 (13:13 +0300)]
radv/ci: document a series of recent regressions

No time to bisect all the regressions, so I am just including the
GOOD/BAD commits if anyone is interested to bisect.

One thing is for sure, !22753 is responsible for at least tens of
these issues.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22820>

14 months agowsi/wayland: Do not assert that all present IDs have been waited on.
Hans-Kristian Arntzen [Tue, 2 May 2023 11:31:37 +0000 (13:31 +0200)]
wsi/wayland: Do not assert that all present IDs have been waited on.

EXT_swapchain_maintenance1 allows destruction when the swapchain fence
is complete. That may signal before we have dispatched all present
waits. Just discard those presentation feedbacks.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22682>

14 months agowsi/wayland: Simplify wait logic for present wait.
Hans-Kristian Arntzen [Tue, 2 May 2023 11:15:25 +0000 (13:15 +0200)]
wsi/wayland: Simplify wait logic for present wait.

CLOCK_REALTIME is generally problematic due to NTP.
Use normal MONOTONIC waits for condition variable,
and remove the timedlock. The lock is never held in a blocking fashion,
so there is little need for a timed lock here.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22682>

14 months agowsi/wayland: Support VK_KHR_present_wait
Daniel Stone [Wed, 11 May 2022 18:47:52 +0000 (19:47 +0100)]
wsi/wayland: Support VK_KHR_present_wait

Use the wp_presentation extension to detect when a given presentation
has taken effect.

Since this protocol is not guaranteed to be supported,
it must be enabled through driconf (vk_khr_present_wait=true) for the time being.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Co-authored-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22682>

14 months agowayland: generalize wayland-protocols code generation
Simon Ser [Fri, 26 Aug 2022 09:01:29 +0000 (11:01 +0200)]
wayland: generalize wayland-protocols code generation

Make it easy to add a new protocol to the list without duplicating
logic.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22682>

14 months agoradv: Add driconf to always drain waves before writing timestamps
Friedrich Vock [Wed, 3 May 2023 10:20:39 +0000 (12:20 +0200)]
radv: Add driconf to always drain waves before writing timestamps

UE4's Vulkan backend uses vkCmdWriteTimestamp with TOP_OF_PIPE
to measure how long a workload took in the GPU Benchmark. This is wrong
and writes the timestamp before the workload is actually finished,
making it seem like the GPU is much faster than it actually is.
This caused subsequent benchmark passes to contain way too big workloads,
which caused soft hangs on slower GPUs.

Fixes GPU hangs with Splitgate during automatic settings configuration.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22823>

14 months agoradv: Always call si_emit_cache_flush before writing timestamps
Friedrich Vock [Wed, 3 May 2023 11:52:44 +0000 (13:52 +0200)]
radv: Always call si_emit_cache_flush before writing timestamps

In case of barriers with TOP_OF_PIPE as dst stage, writing timestamps
immediately would be invalid.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22823>

14 months agoradv/meta: rename dest to dst
Samuel Pitoiset [Tue, 2 May 2023 10:17:26 +0000 (12:17 +0200)]
radv/meta: rename dest to dst

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

14 months agoradv: replace radv_get_levelCount() by vk_image_subresource_level_count()
Samuel Pitoiset [Tue, 2 May 2023 09:21:08 +0000 (11:21 +0200)]
radv: replace radv_get_levelCount() by vk_image_subresource_level_count()

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

14 months agoradv: replace radv_get_layerCount by vk_image_subresource_layer_count()
Samuel Pitoiset [Tue, 2 May 2023 09:17:50 +0000 (11:17 +0200)]
radv: replace radv_get_layerCount by vk_image_subresource_layer_count()

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

14 months agoradv: fix fast-clearing images with VK_REMAINING_{ARRAY_LAYERS,MIP_LEVELS}
Samuel Pitoiset [Tue, 2 May 2023 09:26:29 +0000 (11:26 +0200)]
radv: fix fast-clearing images with VK_REMAINING_{ARRAY_LAYERS,MIP_LEVELS}

Found by inspection.

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

14 months agoradv: fix invalid type for usage in radv_get_buffer_memory_requirements()
Samuel Pitoiset [Tue, 2 May 2023 08:41:46 +0000 (10:41 +0200)]
radv: fix invalid type for usage in radv_get_buffer_memory_requirements()

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

14 months agobroadcom/compiler: move buffer loads to lower register pressure
Iago Toral Quiroga [Wed, 3 May 2023 09:52:37 +0000 (11:52 +0200)]
broadcom/compiler: move buffer loads to lower register pressure

If we are trying to lower register pressure this can make a big
difference in some cases. To avoid adding even more strategies,
merge this with disabling ubo load sorting, since they are basically
trying to do the same.

total instructions in shared programs: 12848024 -> 12844510 (-0.03%)
instructions in affected programs: 236537 -> 233023 (-1.49%)
helped: 195
HURT: 87
Instructions are helped.

total uniforms in shared programs: 3815601 -> 3814932 (-0.02%)
uniforms in affected programs: 31773 -> 31104 (-2.11%)
helped: 67
HURT: 115
Inconclusive result (value mean confidence interval includes 0).

total max-temps in shared programs: 2210803 -> 2210622 (<.01%)
max-temps in affected programs: 9362 -> 9181 (-1.93%)
helped: 114
HURT: 34
Max-temps are helped.

total spills in shared programs: 2556 -> 2330 (-8.84%)
spills in affected programs: 1391 -> 1165 (-16.25%)
helped: 39
HURT: 9

total fills in shared programs: 3840 -> 3317 (-13.62%)
fills in affected programs: 2379 -> 1856 (-21.98%)
helped: 39
HURT: 23

total sfu-stalls in shared programs: 21965 -> 21978 (0.06%)
sfu-stalls in affected programs: 2618 -> 2631 (0.50%)
helped: 45
HURT: 81
Inconclusive result (value mean confidence interval includes 0).

total inst-and-stalls in shared programs: 12869989 -> 12866488 (-0.03%)
inst-and-stalls in affected programs: 238771 -> 235270 (-1.47%)
helped: 193
HURT: 87
Inst-and-stalls are helped.

total nops in shared programs: 303501 -> 303274 (-0.07%)
nops in affected programs: 4159 -> 3932 (-5.46%)
helped: 87
HURT: 105
Inconclusive result (value mean confidence interval includes 0).

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

14 months agodocs: fix edit-links
Erik Faye-Lund [Tue, 2 May 2023 08:07:45 +0000 (10:07 +0200)]
docs: fix edit-links

When making a custom-theme, I accidentally hard-coded the edit-URL to
point to the index-file in the mesa3d.org repo instead of pointing to
the correct file in our docs. This fixes that, so the "Edit this
page"-links in the footer works the same way as the old "Edit on
GitLab"-links did.

Fixes: 7da0482636a ("docs: add custom html theme")
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22791>

14 months agoturnip: fix buffer markers using wrong addresses
Amber [Tue, 2 May 2023 08:08:57 +0000 (10:08 +0200)]
turnip: fix buffer markers using wrong addresses

Fixes failures in dEQP-VK.api.buffer_marker.*

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22792>

14 months agoradv: Move all the dirty flags from TES binding to TCS binding.
Bas Nieuwenhuizen [Mon, 1 May 2023 17:51:42 +0000 (19:51 +0200)]
radv: Move all the dirty flags from TES binding to TCS binding.

With merged shaders we might not have an explicit TES.

Fixes: 879ddf97202 ("radv: rework binding shaders to cmdbuf by introducing new helpers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8939
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22784>

14 months agoradv: use lower_ballot_bit_count_to_mbcnt_amd
Georg Lehmann [Mon, 1 May 2023 17:04:54 +0000 (19:04 +0200)]
radv: use lower_ballot_bit_count_to_mbcnt_amd

Foz-DB Navi21:
Totals from 62 (0.05% of 134864) affected shaders:
VGPRs: 2464 -> 2440 (-0.97%)
CodeSize: 332408 -> 324276 (-2.45%)
MaxWaves: 1690 -> 1692 (+0.12%)
Instrs: 62356 -> 60828 (-2.45%)
Latency: 595723 -> 592554 (-0.53%)
InvThroughput: 126106 -> 124241 (-1.48%)
SClause: 2163 -> 2162 (-0.05%)
Copies: 6392 -> 6226 (-2.60%); split: -2.94%, +0.34%
Branches: 2295 -> 2298 (+0.13%)
PreSGPRs: 2390 -> 2389 (-0.04%)
PreVGPRs: 2139 -> 2117 (-1.03%); split: -1.08%, +0.05%

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

14 months agonir: lower ballot_bit_count_exclusive/inclusive to mbcnt_amd
Georg Lehmann [Mon, 1 May 2023 17:04:03 +0000 (19:04 +0200)]
nir: lower ballot_bit_count_exclusive/inclusive to mbcnt_amd

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

14 months agointel/compiler: make uses_pos_offset a tri-state
Lionel Landwerlin [Wed, 26 Apr 2023 13:44:51 +0000 (16:44 +0300)]
intel/compiler: make uses_pos_offset a tri-state

This value depends on the per-sample value which can be unknown at
compile time with graphics pipeline libraries. So we need to have this
dynamic has well and pick the right value when generating the
3DSTATE_PS/3DSTATE_WM packet.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: d8dfd153c5 ("intel/fs: Make per-sample and coarse dispatch tri-state")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22728>

14 months agomesa/main: drop unused variable
David Heidelberg [Tue, 2 May 2023 23:57:28 +0000 (01:57 +0200)]
mesa/main: drop unused variable

Fixes: c5b3d488f9be ("mesa/main: make ffvertex output nir")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22812>

14 months agobroadcom/compiler: don't allocate undef to rf0
Iago Toral Quiroga [Wed, 26 Apr 2023 10:57:33 +0000 (12:57 +0200)]
broadcom/compiler: don't allocate undef to rf0

rf0 is affected by restrictions in some scenarios so we rather use
a register that does not cause conflicts for scheduling.

total instructions in shared programs: 12850958 -> 12848024 (-0.02%)
instructions in affected programs: 331974 -> 329040 (-0.88%)
helped: 2559
HURT: 201
Instructions are helped.

total max-temps in shared programs: 2210893 -> 2210803 (<.01%)
max-temps in affected programs: 1486 -> 1396 (-6.06%)
helped: 96
HURT: 7
Max-temps are helped.

total sfu-stalls in shared programs: 21975 -> 21965 (-0.05%)
sfu-stalls in affected programs: 32 -> 22 (-31.25%)
helped: 16
HURT: 6
Sfu-stalls are helped.

total inst-and-stalls in shared programs: 12872933 -> 12869989 (-0.02%)
inst-and-stalls in affected programs: 332036 -> 329092 (-0.89%)
helped: 2560
HURT: 189
Inst-and-stalls are helped.

total nops in shared programs: 305911 -> 303501 (-0.79%)
nops in affected programs: 11215 -> 8805 (-21.49%)
helped: 2131
HURT: 3
Nops are helped.

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

14 months agor600: fix refcnt imbalance related to atomic_buffer_state
Patrick Lerda [Sat, 22 Apr 2023 11:18:58 +0000 (13:18 +0200)]
r600: fix refcnt imbalance related to atomic_buffer_state

Indeed, these references are not freed.

For instance, this issue is triggered on an evergreen card with
"piglit/bin/shader_runner tests/spec/arb_shader_atomic_counter_ops/execution/all_touch_test.shader_test -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 06993e4ee350 ("r600: add support for hw atomic counters. (v3)")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22798>

14 months agovulkan: rename vk_physical_device_features.py to vk_physical_device_features_gen.py
Constantine Shablya [Fri, 7 Apr 2023 03:05:33 +0000 (06:05 +0300)]
vulkan: rename vk_physical_device_features.py to vk_physical_device_features_gen.py

In-line with other files that generate source code

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agovulkan: put TEMPLATE_H before TEMPLATE_C
Constantine Shablya [Fri, 7 Apr 2023 01:02:06 +0000 (04:02 +0300)]
vulkan: put TEMPLATE_H before TEMPLATE_C

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agovulkan: put interesting code before boring code
Constantine Shablya [Fri, 7 Apr 2023 01:00:52 +0000 (04:00 +0300)]
vulkan: put interesting code before boring code

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agovulkan: inline vk_get_physical_device_features into vk_common_GetPhysicalDeviceFeatures2
Constantine Shablya [Fri, 7 Apr 2023 01:00:13 +0000 (04:00 +0300)]
vulkan: inline vk_get_physical_device_features into vk_common_GetPhysicalDeviceFeatures2

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

14 months agov3dv: use common vkGetPhysicalDeviceFeatures2
Constantine Shablia [Fri, 28 Apr 2023 23:11:06 +0000 (02:11 +0300)]
v3dv: use common vkGetPhysicalDeviceFeatures2

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agopanvk: use common vkGetPhysicalDeviceFeatures2
Constantine Shablia [Sat, 29 Apr 2023 00:07:23 +0000 (03:07 +0300)]
panvk: use common vkGetPhysicalDeviceFeatures2

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agoanv: move get_features after get_device_extensions (ugly diff)
Constantine Shablia [Fri, 28 Apr 2023 23:09:16 +0000 (02:09 +0300)]
anv: move get_features after get_device_extensions (ugly diff)

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agoanv: switch to using the common vkGetPhysicalDeviceFeatures2
Constantine Shablya [Thu, 6 Apr 2023 13:39:41 +0000 (16:39 +0300)]
anv: switch to using the common vkGetPhysicalDeviceFeatures2

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22333>

14 months agovulkan: introduce supported_features parameter to vk_physical_device_init
Constantine Shablya [Fri, 7 Apr 2023 02:51:02 +0000 (05:51 +0300)]
vulkan: introduce supported_features parameter to vk_physical_device_init

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

14 months agovulkan: add common implementation of vkGetPhysicalDeviceFeatures2
Constantine Shablya [Thu, 6 Apr 2023 13:39:23 +0000 (16:39 +0300)]
vulkan: add common implementation of vkGetPhysicalDeviceFeatures2

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

14 months agovulkan: Actually increment the count of objects in GetPipelineCacheData.
Emma Anholt [Tue, 25 Apr 2023 20:20:53 +0000 (13:20 -0700)]
vulkan: Actually increment the count of objects in GetPipelineCacheData.

Otherwise a load of the cache won't load any of the objects in it!

Fixes: 591da9877900 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22700>

14 months agovulkan: Handle alignment failure in the pipeline cache.
Emma Anholt [Tue, 25 Apr 2023 20:17:26 +0000 (13:17 -0700)]
vulkan: Handle alignment failure in the pipeline cache.

On malloc failure, or more likely a passed in pDataSize < pipeline cache
data size, we should return incomplete.  Otherwise,
vk_pipeline_cache_object_serialize will assertion fail about the start not
being aligned.

Closes: #8868
Fixes: 591da9877900 ("vulkan: Add a common VkPipelineCache implementation")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22700>

14 months agodzn: Ensure bindless is factored into pipeline/nir hash
Jesse Natalie [Tue, 2 May 2023 23:27:57 +0000 (16:27 -0700)]
dzn: Ensure bindless is factored into pipeline/nir hash

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

14 months agodzn: Ensure subgroup size control is factored into pipeline hash
Jesse Natalie [Tue, 2 May 2023 23:27:30 +0000 (16:27 -0700)]
dzn: Ensure subgroup size control is factored into pipeline hash

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

14 months agodzn: Use the nir hash as an input to the dxil hash
Jesse Natalie [Tue, 2 May 2023 23:20:28 +0000 (16:20 -0700)]
dzn: Use the nir hash as an input to the dxil hash

Instead of re-computing all the same bits we already computed,
just use the nir hash. Helps prevent missing a bit between the two.

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

14 months agodzn: Ensure sample-rate shading is factored into nir hash
Jesse Natalie [Tue, 2 May 2023 23:38:50 +0000 (16:38 -0700)]
dzn: Ensure sample-rate shading is factored into nir hash

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

14 months agodzn: Hook up subgroup size to compute shader compilation
Jesse Natalie [Tue, 2 May 2023 23:18:14 +0000 (16:18 -0700)]
dzn: Hook up subgroup size to compute shader compilation

Previously this was only in the graphics path... where it does nothing,
since D3D only supports wave size control for compute. Whoops.

Fixes: db083070 ("dzn: Implement subgroup size control extension")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22810>

14 months agocrocus: fix refcnt imbalance related to crocus_create_surface()
Patrick Lerda [Tue, 25 Apr 2023 23:47:43 +0000 (01:47 +0200)]
crocus: fix refcnt imbalance related to crocus_create_surface()

Indeed, the objects are not freed when the function returns NULL.

"psurf->texture = tex;" is redundant with
"pipe_resource_reference(&psurf->texture, tex);".

For instance, this issue is triggered with
"piglit/bin/ext_texture_array-compressed teximage pbo -fbo -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22799>

14 months agovirgl: check a debug option again at context creation
Ryan Neph [Thu, 27 Apr 2023 19:02:19 +0000 (12:02 -0700)]
virgl: check a debug option again at context creation

Android apps commonly use HWUI (a GLES-based UI framework provided by
the system), that generally performs eglInitialize() before the app can
do the same for its custom rendering needs.

If an app is going to set VIRGL_DEBUG to enable case-by-case driver
behaviors (e.g. experimental shader_sync option), it should be checked
again during context creation.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22744>

14 months agodzn: Fix UBO descriptors pointing to the end of the buffer
Jesse Natalie [Tue, 2 May 2023 18:21:00 +0000 (11:21 -0700)]
dzn: Fix UBO descriptors pointing to the end of the buffer

UBO descriptors can re-use the default descriptor when their upper
bound is 64KiB, not the end of the buffer.

Fixes dEQP-VK.memory.pipeline_barrier.host_write_uniform_buffer.1048576

Fixes: d34ac0a70b7 ("dzn: Re-design custom buffer descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22805>

14 months agoRevert "zink: don't create separate shader dsls if there are no bindings"
Mike Blumenkrantz [Tue, 2 May 2023 16:54:17 +0000 (12:54 -0400)]
Revert "zink: don't create separate shader dsls if there are no bindings"

This reverts commit 83a1b74240df3afcdb0e723c5bf6514b3321b411.

this is creating the pipeline layout, which is always required, not the dsl

Fixes: 83a1b74240d ("zink: don't create separate shader dsls if there are no bindings")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22801>

14 months agozink: only unset a generated tcs if the bound tcs is the generated one
Mike Blumenkrantz [Tue, 2 May 2023 16:10:27 +0000 (12:10 -0400)]
zink: only unset a generated tcs if the bound tcs is the generated one

this could otherwise unbind a non-generated tcs if the tes had at some
point generated a tcs

cc: mesa-stable

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

14 months agoradv/rt: Fix and improve VkPipelineCreationFeedback
Daniel Schürmann [Thu, 13 Apr 2023 22:44:36 +0000 (00:44 +0200)]
radv/rt: Fix and improve VkPipelineCreationFeedback

Due to a copy-paste error, we asserted pipelineStageCreationFeedbackCount == 1
and wrote the stage feedback of the combined shader into the feedback of the first
stage. This is fixed.
Instead, we now write the precompilation feedback for each stage. This not ideal,
but definitely an improvement.

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

14 months agoradv/rt: remove merged VkPipelineShaderStageCreateInfo
Daniel Schürmann [Tue, 25 Apr 2023 14:07:52 +0000 (16:07 +0200)]
radv/rt: remove merged VkPipelineShaderStageCreateInfo

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

14 months agoradv/rt: refactor compute_rt_stack_size() to use radv_ray_tracing_stage information
Daniel Schürmann [Tue, 25 Apr 2023 13:56:57 +0000 (15:56 +0200)]
radv/rt: refactor compute_rt_stack_size() to use radv_ray_tracing_stage information

instead of pStages.

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

14 months agoradv/rt: use precompiled stages to create RT shader
Daniel Schürmann [Thu, 23 Mar 2023 14:18:29 +0000 (15:18 +0100)]
radv/rt: use precompiled stages to create RT shader

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

14 months agoradv/rt: retain parsed NIR shaders in radv_ray_tracing_lib_pipeline
Daniel Schürmann [Thu, 23 Mar 2023 01:23:55 +0000 (02:23 +0100)]
radv/rt: retain parsed NIR shaders in radv_ray_tracing_lib_pipeline

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

14 months agoradv/rt: introduce struct radv_ray_tracing_stage
Daniel Schürmann [Tue, 25 Apr 2023 12:38:15 +0000 (14:38 +0200)]
radv/rt: introduce struct radv_ray_tracing_stage

The purpose of this struct is to bundle per-stage information
for ray-tracing pipelines.

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

14 months agoradv/rt: expose radv_parse_rt_stage()
Daniel Schürmann [Wed, 8 Mar 2023 03:25:05 +0000 (04:25 +0100)]
radv/rt: expose radv_parse_rt_stage()

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

14 months agoradv/pipeline_cache: add NIR caching capabilities
Daniel Schürmann [Fri, 31 Mar 2023 14:05:22 +0000 (16:05 +0200)]
radv/pipeline_cache: add NIR caching capabilities

This patch adds functions to radv_pipeline_cache in order to cache
serialized NIR shaders as opaque cache objects.

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

14 months agovulkan/pipeline_cache: expose vk_raw_data_cache_object
Daniel Schürmann [Wed, 26 Apr 2023 13:51:20 +0000 (15:51 +0200)]
vulkan/pipeline_cache: expose vk_raw_data_cache_object

together with vk_raw_data_cache_object_ops and vk_raw_data_cache_object_create().

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

14 months agonvc0: do not randomly emit fences.
Karol Herbst [Wed, 26 Apr 2023 20:06:44 +0000 (22:06 +0200)]
nvc0: do not randomly emit fences.

We track fences in a global list and have a per context "current" fence
which we randomly attach things to. If we take such a fence and emit it
without also creating a new fence for future tasks we can get out of sync
leading to random failures.

Some of our queries could trigger such cases and even though this issues
appears to be triggered by the MT rework, I'm convinced that this was only
made more visible by those fixes and we had this bug lurking for quite a
while.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7429
Fixes: df0a4d02f26 ("nvc0: make state handling race free")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Acked-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22722>

14 months agoci: Uprev crosvm and virglrenderer
Corentin Noël [Wed, 26 Apr 2023 13:51:15 +0000 (15:51 +0200)]
ci: Uprev crosvm and virglrenderer

Update crosvm, virglrenderer and bindgen-cli to their latest version on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22712>

14 months agonir/lower_non_uniform_access: add get_ssbo_size handling
Lionel Landwerlin [Tue, 2 May 2023 09:06:59 +0000 (12:06 +0300)]
nir/lower_non_uniform_access: add get_ssbo_size handling

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22793>

14 months agorusticl/nir: finish blob after serializing
Karol Herbst [Sun, 30 Apr 2023 23:22:56 +0000 (01:22 +0200)]
rusticl/nir: finish blob after serializing

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22776>

14 months agoclc: free kernel args in clc_free_kernels_info
Karol Herbst [Sun, 30 Apr 2023 23:22:14 +0000 (01:22 +0200)]
clc: free kernel args in clc_free_kernels_info

Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22776>

14 months agoradv: add padding to radv_shader_binary_legacy
Daniel Schürmann [Thu, 27 Apr 2023 13:24:55 +0000 (15:24 +0200)]
radv: add padding to radv_shader_binary_legacy

This fixes an alignment mismatch in radv_shader_serialize()

Fixes: 577d76f60f788c3a8d43b4b388bb5a04e4e64994 ('radv: add radv_shader_serialize() and radv_shader_deserialize() functions')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22735>

14 months agovulkan/pipeline_cache: use vk_pipeline_cache_insert_object() to replace raw data...
Daniel Schürmann [Thu, 27 Apr 2023 13:20:06 +0000 (15:20 +0200)]
vulkan/pipeline_cache: use vk_pipeline_cache_insert_object() to replace raw data objects

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

14 months agovulkan/pipeline_cache: replace raw data objects on cache insertion of real objects
Daniel Schürmann [Thu, 27 Apr 2023 13:13:51 +0000 (15:13 +0200)]
vulkan/pipeline_cache: replace raw data objects on cache insertion of real objects

It might happen that a raw data object (from pipeline cache creation)
was never looked up, and thus never deserialized, before it gets
inserted again into the cache. In this case, the deserialized object
got replaced by the raw data object.
Instead, replace the raw data object with the real object in the cache.

Fixes: 8b13ee75ba9f27ceac6b6180ca05d321caa13612 ('vulkan: Fall back to raw data objects when deserializing if ops == NULL')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22735>

14 months agoetnaviv: Add util_blitter_save_so_targets(..) call
Christian Gmeiner [Tue, 25 Apr 2023 18:36:14 +0000 (20:36 +0200)]
etnaviv: Add util_blitter_save_so_targets(..) call

We do not support stream outputs yet so be better at faking it.
Fixes the following assertion when running deqp-gles3:
 u_blitter.c:635: blitter_check_saved_vertex_states: Assertion `!ctx->has_stream_out || ctx->base.saved_num_so_targets != ~0u' failed

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

14 months agopvr: Correctly validate PBE accum format
Matt Coster [Tue, 2 May 2023 10:37:59 +0000 (11:37 +0100)]
pvr: Correctly validate PBE accum format

Fixes: dEQP-VK.pipeline.monolithic.blend.format.e5b9g9r9_ufloat_pack32
  .states
  .color_sas_1mda_add_alpha_1msa_sas_rsub
    -color_1mda_cc_min_alpha_cc_cc_min
    -color_1mcc_1mca_rsub_alpha_1mca_1mda_min
    -color_sc_1mda_sub_alpha_sa_cc_min

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

14 months agoradv: fix bc optimization with POS_W_FLOAT_ENA(1)
Rhys Perry [Mon, 1 May 2023 16:38:11 +0000 (17:38 +0100)]
radv: fix bc optimization with POS_W_FLOAT_ENA(1)

0286CC_PERSP_CENTER_ENA is also set if:
- No barycentrics are used
- POS_W_FLOAT is enabled

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: a4b60295a79 ("aco,ac/llvm,radv,radeonsi: handle ps bc optimization in nir for radv")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8928
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22782>

14 months agopvr: Unmap mapped memory on free
Matt Coster [Fri, 28 Apr 2023 14:00:21 +0000 (15:00 +0100)]
pvr: Unmap mapped memory on free

From the Vulkan spec (§11.2.13. Freeing Device Memory):
  If a memory object is mapped at the time it is freed, it is implicitly
  unmapped.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22762>

14 months agopvr: Fix unaligned VDMCTRL_PDS_STATE1 data address
Karmjit Mahil [Fri, 21 Apr 2023 15:13:24 +0000 (16:13 +0100)]
pvr: Fix unaligned VDMCTRL_PDS_STATE1 data address

For indirect draw commands the data segment's address was being
calculated with an unaligned code size which could potentially
send an unaligned address to the hw causing problems.

Reported-by: James Glanville <james.glanville@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22746>

14 months agopvr: Fix image to buffer copies
James Glanville [Tue, 25 Apr 2023 20:20:02 +0000 (21:20 +0100)]
pvr: Fix image to buffer copies

The code to increment the destination buffer address was wrong. Instead of
incrementing an address on every iteration, the buffer slice size was added
as a static offset to all blits.

Seen in dEQP-VK.draw.renderpass.depth_clamp.d16_unorm, though issues remain.

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

14 months agopvr: Fix vtxin special var allocation count
James Glanville [Fri, 28 Apr 2023 08:21:50 +0000 (09:21 +0100)]
pvr: Fix vtxin special var allocation count

When pvr_graphics_pipeline_alloc_vertex_special_vars() was
allocating vtxin regs for special vars, it wasn't returning back
the updated amount of allocated regs so when the PDS was filling
them in, it would try to write out of bounds.

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

14 months agopvr: Improve support for image clears
James Glanville [Tue, 25 Apr 2023 21:41:51 +0000 (22:41 +0100)]
pvr: Improve support for image clears

Depth/stencil surfaces are not PBE renderable, so a compatible format must
be used instead. The code to calculate this compatible format was not called
when configuring the PBE, and it was missing formats.

Also the code to calculate PBE swizzles was throwing an error in unhandled
cases, rather than using the pre-calculated defaults which was the correct
behaviour.

Fixes blits in dEQP-VK.draw.renderpass.depth_clamp.d32_sfloat

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

14 months agonir: fix constant-folding of 64-bit fpow
Erik Faye-Lund [Sun, 30 Apr 2023 10:15:31 +0000 (12:15 +0200)]
nir: fix constant-folding of 64-bit fpow

We need to do full pow if 64-bit, and we can do fpow() otherwise. Not
the other way around.

Fixes: 9076c4e289d ("nir: update opcode definitions for different bit sizes")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22774>

14 months agoradv: fix dynamic depth clamp enable support
Samuel Pitoiset [Fri, 28 Apr 2023 16:13:19 +0000 (18:13 +0200)]
radv: fix dynamic depth clamp enable support

The Vulkan spec says:

"If the depth clamping state is changed dynamically, and the pipeline
was not created with VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT enabled,
then depth clipping is enabled when depth clamping is disabled and
vice versa"

Fixes: e48c0fbd8f7 ("radv: add support for dynamic depth clamp enable")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22777>

14 months agomicrosoft/compiler: Unroll loops in opt passes
Jesse Natalie [Mon, 1 May 2023 20:08:12 +0000 (13:08 -0700)]
microsoft/compiler: Unroll loops in opt passes

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

14 months agospirv2dxil: Mark SSBO reads for bindless as CAN_REORDER
Jesse Natalie [Mon, 1 May 2023 20:07:01 +0000 (13:07 -0700)]
spirv2dxil: Mark SSBO reads for bindless as CAN_REORDER

This makes it so that they can be CSE'd, which helps prevent redundant
reads of the same data.

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