platform/upstream/mesa.git
2 years agoci: Add testing of the khr-single tests.
Emma Anholt [Wed, 3 Aug 2022 20:40:37 +0000 (13:40 -0700)]
ci: Add testing of the khr-single tests.

These got split out from gl4[3456]-master a while back, so we were missing
coverage in CI.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17876>

2 years agoci/swrast: Add some flakes I've noticed in the IRC channel.
Emma Anholt [Fri, 5 Aug 2022 00:09:43 +0000 (17:09 -0700)]
ci/swrast: Add some flakes I've noticed in the IRC channel.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17876>

2 years agonir/lower_alu: drop unnecessary iand on uadd_carry result
Iago Toral Quiroga [Thu, 4 Aug 2022 08:29:16 +0000 (10:29 +0200)]
nir/lower_alu: drop unnecessary iand on uadd_carry result

uadd_carry returns 1 or 0, so ANDing with 1 is unnecessary. Probably
this was implemented thinking that it was returning a boolean value.

shader-db results for V3D:

total instructions in shared programs: 12463571 -> 12462964 (<.01%)
instructions in affected programs: 28994 -> 28387 (-2.09%)
helped: 110
HURT: 1

total uniforms in shared programs: 3704591 -> 3704588 (<.01%)
uniforms in affected programs: 247 -> 244 (-1.21%)
helped: 3
HURT: 0

total max-temps in shared programs: 2148138 -> 2148117 (<.01%)
max-temps in affected programs: 729 -> 708 (-2.88%)
helped: 23
HURT: 2

total sfu-stalls in shared programs: 21230 -> 21232 (<.01%)
sfu-stalls in affected programs: 0 -> 2
helped: 0
HURT: 2

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

2 years agobroadcom/compiler: simplify code emitted for centroid coordinates
Iago Toral Quiroga [Fri, 5 Aug 2022 11:51:01 +0000 (13:51 +0200)]
broadcom/compiler: simplify code emitted for centroid coordinates

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

2 years agoac/nir/cull: Tweak phi for cull_small_primitive branch.
Timur Kristóf [Fri, 5 Aug 2022 23:21:47 +0000 (01:21 +0200)]
ac/nir/cull: Tweak phi for cull_small_primitive branch.

cull_small_primitive will now allow the caller to pass an
SSA def that it will use to determine if the primitive was
initially rejected.

This allows ACO to remove an s_branch instruction from every
NGG culling shader.

Fossil DB stats on Navi 21:

Totals from 60918 (45.16% of 134906) affected shaders:
CodeSize: 160086644 -> 159355824 (-0.46%); split: -0.46%, +0.00%
Instrs: 30477916 -> 30356092 (-0.40%); split: -0.40%, +0.00%
Latency: 139587915 -> 139611487 (+0.02%); split: -0.00%, +0.02%
InvThroughput: 21184261 -> 21184346 (+0.00%)
Copies: 2762930 -> 2702024 (-2.20%); split: -2.20%, +0.00%
Branches: 1236970 -> 1176052 (-4.92%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17919>

2 years agoradv: Implement radv_flush_before_query_copy to workaround UE Vulkan bugs.
Tatsuyuki Ishi [Tue, 10 May 2022 05:03:03 +0000 (14:03 +0900)]
radv: Implement radv_flush_before_query_copy to workaround UE Vulkan bugs.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5740

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14208>

2 years agoci: Windows runner is experiencing DNS issues; disable Microsoft farm
David Heidelberg [Sat, 6 Aug 2022 09:07:02 +0000 (11:07 +0200)]
ci: Windows runner is experiencing DNS issues; disable Microsoft farm

Ref: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7008

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17925>

2 years agovirgl: Fix unmapping of blob resources
Dmitry Osipenko [Fri, 5 Aug 2022 13:30:22 +0000 (16:30 +0300)]
virgl: Fix unmapping of blob resources

OpenGL API calls like glClearBufferData() result in mapping/unmapping
of a given buffer by Mesa and unmapping of a host blob fails in
virglrenderer because VirGL driver uses command that is intended for
unmapping of a guest buffer. In particular this causes problem for the
"Total War: Warhammer" game that gets GL_OUT_OF_MEMORY error due to the
failed unmapping command. Fix this by setting the mapping usage flag in
accordance to the resource flags, allowing virgl_buffer_transfer_unmap()
to differentiate host buffer from guest.

Fixes: 3b54e5837a152364 ("virgl: support PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17914>

2 years agoaco: Remove branch instruction when exec is constant non-zero.
Timur Kristóf [Wed, 4 May 2022 11:58:39 +0000 (13:58 +0200)]
aco: Remove branch instruction when exec is constant non-zero.

This mainly helps the "if (elect())" that is used in
NGG culling shaders, effectively removing a useless branch
from every culling shader.

Totals from 58346 (45.35% of 128653) affected shaders:
CodeSize: 153238668 -> 153005284 (-0.15%)
Instrs: 29066198 -> 29007852 (-0.20%)
Latency: 133626003 -> 133598182 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 20208765 -> 20208689 (-0.00%)
Branches: 1190209 -> 1131863 (-4.90%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13383>

2 years agoaco: Optimize branching sequence during SSA elimination.
Timur Kristóf [Wed, 4 May 2022 08:32:24 +0000 (10:32 +0200)]
aco: Optimize branching sequence during SSA elimination.

Totals from 63245 (49.16% of 128653) affected shaders:
CodeSize: 166703680 -> 166436164 (-0.16%)
Instrs: 31618383 -> 31551504 (-0.21%)
Latency: 149404811 -> 149337729 (-0.04%); split: -0.05%, +0.00%
InvThroughput: 23996388 -> 23994734 (-0.01%); split: -0.01%, +0.00%
Copies: 2794107 -> 2727228 (-2.39%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13383>

2 years agoac/nir/cull: Make cull functions more consistent.
Timur Kristóf [Wed, 3 Aug 2022 10:03:00 +0000 (12:03 +0200)]
ac/nir/cull: Make cull functions more consistent.

Now they all return whether the primitive was rejected.

No Fossil DB changes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17870>

2 years agoac/nir/ngg: Move LDS store of accepted flag into the inner branch.
Timur Kristóf [Wed, 3 Aug 2022 09:53:29 +0000 (11:53 +0200)]
ac/nir/ngg: Move LDS store of accepted flag into the inner branch.

For primitives which are rejected based on only W and face, this
will reduce the number of executed branches.

Fossil DB stats on Navi 21:

Totals from 60918 (45.16% of 134906) affected shaders:
CodeSize: 160330564 -> 160086644 (-0.15%)
Instrs: 30477385 -> 30477916 (+0.00%); split: -0.00%, +0.00%
Latency: 139802763 -> 139587915 (-0.15%); split: -0.15%, +0.00%
InvThroughput: 21198444 -> 21184261 (-0.07%); split: -0.07%, +0.00%
SClause: 749811 -> 749810 (-0.00%)
Copies: 2701482 -> 2762930 (+2.27%); split: -0.00%, +2.28%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17870>

2 years agoac/nir/cull: Change if condition for bounding box culling.
Timur Kristóf [Wed, 3 Aug 2022 09:40:12 +0000 (11:40 +0200)]
ac/nir/cull: Change if condition for bounding box culling.

The previous code checked all_w_positive in the if condition.
Instead, always execute the bbox culling code and include
all_w_positive at the end.

We assume checking in the if is not beneficial because it's
very unlikely that there is no primitive in a wave whose W are
not all positive.

This allows moving other things to the condition
in the next commit.

Fossil DB stats on Navi 21:

Totals from 60918 (45.16% of 134906) affected shaders:
CodeSize: 160574204 -> 160330564 (-0.15%); split: -0.15%, +0.00%
Instrs: 30538297 -> 30477385 (-0.20%); split: -0.20%, +0.00%
Latency: 139810902 -> 139802763 (-0.01%); split: -0.01%, +0.00%
InvThroughput: 21198449 -> 21198444 (-0.00%); split: -0.00%, +0.00%
SClause: 749810 -> 749811 (+0.00%)
Copies: 2701474 -> 2701482 (+0.00%); split: -0.00%, +0.00%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17870>

2 years agoac/nir/cull: Move the contents of cull_bbox into ac_nir_cull_triangle.
Timur Kristóf [Wed, 3 Aug 2022 09:36:34 +0000 (11:36 +0200)]
ac/nir/cull: Move the contents of cull_bbox into ac_nir_cull_triangle.

No Fossil DB changes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17870>

2 years agoac/nir/cull: Move some code from cull_bbox into helper functions.
Timur Kristóf [Wed, 3 Aug 2022 09:28:45 +0000 (11:28 +0200)]
ac/nir/cull: Move some code from cull_bbox into helper functions.

No Fossil DB changes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17870>

2 years agoradv: implement VK_EXT_attachment_feedback_loop_layout
Samuel Pitoiset [Thu, 11 Mar 2021 12:58:35 +0000 (13:58 +0100)]
radv: implement VK_EXT_attachment_feedback_loop_layout

This extension introduces a new layout which allows applications
to both render and sample from the same image inside the same draw
(aka. feedback loops).

Previously, the GENERAL layout was used and this introduced some
rendering artifacts because the hw can't read&write DCC/HTILE for
the same image, and we try to keep it compressed on GFX10+.

This helps fixing corruption with D3D9 and RPCS3 games which
are candidate for feedback loops.

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

2 years agovulkan: add support for VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT
Samuel Pitoiset [Mon, 28 Feb 2022 18:56:07 +0000 (19:56 +0100)]
vulkan: add support for VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT

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

2 years agovulkan: Update the XML and headers to 1.3.224
Mike Blumenkrantz [Thu, 4 Aug 2022 11:40:48 +0000 (07:40 -0400)]
vulkan: Update the XML and headers to 1.3.224

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17883>

2 years agofreedreno: Drop fixed upper bound on # of tiles
Rob Clark [Thu, 4 Aug 2022 19:25:57 +0000 (12:25 -0700)]
freedreno: Drop fixed upper bound on # of tiles

Placate things that think 16k x 16k FBO is a good idea.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6997
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>

2 years agofreedreno/gmem: Fix col0 calc
Rob Clark [Fri, 5 Aug 2022 15:40:38 +0000 (08:40 -0700)]
freedreno/gmem: Fix col0 calc

Fix typo in calculation of position of start of a row of tiles.  This
could otherwise cause an out-of-bounds access in the next patch.

Fixes: 81d85be9a5c freedreno/gmem: Reverse order of alternative tile rows
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>

2 years agofreedreno/drm: Fix potential bo cache vs export crash
Rob Clark [Thu, 4 Aug 2022 16:25:07 +0000 (09:25 -0700)]
freedreno/drm: Fix potential bo cache vs export crash

Keep the list head valid (empty) after allocation from bo cache.  Avoids
a potential later crash in lookup_bo in the following sequence:

1. alloc, bo cache hit
2. export
3. re-import

Cc: mesa-stable
Fixes: f3cc0d27475 ("freedreno: import libdrm_freedreno + redesign submit")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6988
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888>

2 years agovirgl/ci: Update virglrenderer
Corentin Noël [Tue, 2 Aug 2022 10:53:07 +0000 (12:53 +0200)]
virgl/ci: Update virglrenderer

Update virglrenderer to the latest version on time.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17853>

2 years agoci: separate wine setup into own script
David Heidelberg [Thu, 4 Aug 2022 13:57:51 +0000 (15:57 +0200)]
ci: separate wine setup into own script

It will be used by LAVA jobs too.

Reviewed-by: "Sergi Blanch Torne" <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17887>

2 years agoci: make shellcheck happy on dxvk script
David Heidelberg [Thu, 4 Aug 2022 13:47:39 +0000 (15:47 +0200)]
ci: make shellcheck happy on dxvk script

Reviewed-by: "Sergi Blanch Torne" <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17887>

2 years agoci: move DXVK instalation outside of x86_test-vk
David Heidelberg [Thu, 4 Aug 2022 13:45:30 +0000 (15:45 +0200)]
ci: move DXVK instalation outside of x86_test-vk

It will be used by LAVA jobs.

Reviewed-by: "Sergi Blanch Torne" <sergi.blanch.torne@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17887>

2 years agod3d12: Fixes compile error with mingw/gcc-x64 when static linkage to runtime library
Yonggang Luo [Thu, 4 Aug 2022 17:24:05 +0000 (01:24 +0800)]
d3d12: Fixes compile error with mingw/gcc-x64 when static linkage to runtime library

Closes #6968

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Suggested-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17889>

2 years agoci: Turn off the entire Lima farm (devices report out-of-space)
David Heidelberg [Fri, 5 Aug 2022 12:14:24 +0000 (14:14 +0200)]
ci: Turn off the entire Lima farm (devices report out-of-space)

Reference: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7009

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17910>

2 years agoanv: Don't require 32-bit addresses for scratch on Gen12.5+
Jason Ekstrand [Thu, 11 Feb 2021 19:13:03 +0000 (13:13 -0600)]
anv: Don't require 32-bit addresses for scratch on Gen12.5+

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

2 years agogenxml: Add BVH data structures
Jason Ekstrand [Wed, 5 Aug 2020 22:03:55 +0000 (17:03 -0500)]
genxml: Add BVH data structures

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

2 years agointel/rt: Handle multiple exits in lower_shader_returns
Jason Ekstrand [Wed, 17 Feb 2021 19:48:57 +0000 (13:48 -0600)]
intel/rt: Handle multiple exits in lower_shader_returns

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

2 years agointel/rt: Handle halts in any-hit shaders properly
Jason Ekstrand [Wed, 17 Feb 2021 04:03:17 +0000 (22:03 -0600)]
intel/rt: Handle halts in any-hit shaders properly

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

2 years agointel/fs_reg_allocate: Improve compressed instruction self-interference
Jason Ekstrand [Mon, 7 Sep 2020 06:21:23 +0000 (01:21 -0500)]
intel/fs_reg_allocate: Improve compressed instruction self-interference

The old version worked fine for SIMD16 instructions but SIMD8
instructions where the destination spans two registers have the same
problem.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17908>

2 years agointel/nir: specify synchronous value for tracing op
Lionel Landwerlin [Fri, 18 Feb 2022 12:57:26 +0000 (14:57 +0200)]
intel/nir: specify synchronous value for tracing op

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17908>

2 years agointel/compiler: document units of brw_ubo_range fields
Lionel Landwerlin [Tue, 26 Oct 2021 08:42:37 +0000 (11:42 +0300)]
intel/compiler: document units of brw_ubo_range fields

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17908>

2 years agointel/fs: fixup simd selection with shader calls
Lionel Landwerlin [Wed, 3 Nov 2021 10:42:29 +0000 (12:42 +0200)]
intel/fs: fixup simd selection with shader calls

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17908>

2 years agointel/fs: store num of resume shaders in prog_data
Lionel Landwerlin [Wed, 13 Oct 2021 13:05:59 +0000 (13:05 +0000)]
intel/fs: store num of resume shaders in prog_data

That way we can look at the SBT entries for debug purposes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17908>

2 years agor300: add khr r400 failures
Filip Gawin [Fri, 5 Aug 2022 10:43:30 +0000 (12:43 +0200)]
r300: add khr r400 failures

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

2 years agor300: add list of deqp gles2 r400 failures
Filip Gawin [Wed, 3 Aug 2022 21:29:13 +0000 (23:29 +0200)]
r300: add list of deqp gles2 r400 failures

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

2 years agobroadcom/compiler: use nir_opt_idiv_const
Iago Toral Quiroga [Wed, 3 Aug 2022 10:46:10 +0000 (12:46 +0200)]
broadcom/compiler: use nir_opt_idiv_const

total instructions in shared programs: 12463625 -> 12463571 (<.01%)
instructions in affected programs: 1758 -> 1704 (-3.07%)
helped: 12
HURT: 0

total uniforms in shared programs: 3704589 -> 3704591 (<.01%)
uniforms in affected programs: 17 -> 19 (11.76%)
helped: 0
HURT: 1

total max-temps in shared programs: 2148088 -> 2148138 (<.01%)
max-temps in affected programs: 170 -> 220 (29.41%)
helped: 0
HURT: 10

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

2 years agobroadcom/compiler: don't use imprecise_32bit_lowering for idiv lowering
Iago Toral Quiroga [Wed, 3 Aug 2022 08:44:45 +0000 (10:44 +0200)]
broadcom/compiler: don't use imprecise_32bit_lowering for idiv lowering

This is known to produce bogus results for certain combinations of
operands, so don't use it. See this issue for details:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/6555

With this change, the idiv lowering will produce mul_high instructions,
so we need to instruct the compiler to lower those with the ALU lowering
right after the idiv lowering by adding the lower_mul_high option (we
only need to add this to V3D, since V3DV already had it set). This will
cause injection of uadd_carry instructions, for which we have backend
implementations that produce better code for us than the NIR lowering.

total instructions in shared programs: 12457692 -> 12463625 (0.05%)
instructions in affected programs: 23115 -> 29048 (25.67%)
helped: 0
HURT: 111

total threads in shared programs: 416372 -> 416368 (<.01%)
threads in affected programs: 8 -> 4 (-50.00%)
helped: 0
HURT: 2

total uniforms in shared programs: 3704067 -> 3704589 (0.01%)
uniforms in affected programs: 5804 -> 6326 (8.99%)
helped: 2
HURT: 109

total max-temps in shared programs: 2147845 -> 2148088 (0.01%)
max-temps in affected programs: 2456 -> 2699 (9.89%)
helped: 6
HURT: 91

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

2 years agoac/llvm: handle external textures in ac_nir_lower_resinfo
Marek Olšák [Fri, 5 Aug 2022 08:36:57 +0000 (04:36 -0400)]
ac/llvm: handle external textures in ac_nir_lower_resinfo

Fixes: 4f622d62d0dd8 - ac/nir: add ac_nir_lower_resinfo
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6993

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17902>

2 years agoradeonsi: fix a regression due to reordering PIPE_SHADER_*
Marek Olšák [Fri, 5 Aug 2022 01:58:22 +0000 (21:58 -0400)]
radeonsi: fix a regression due to reordering PIPE_SHADER_*

Fixes: 27f46465c7a408d3 - gallium/tgsi: reorder pipe shader type defines.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17902>

2 years agoradeonsi/ci: update failing tests on navi21
Marek Olšák [Fri, 5 Aug 2022 00:53:24 +0000 (20:53 -0400)]
radeonsi/ci: update failing tests on navi21

These pass now.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17902>

2 years agoradeonsi: don't assume that TC_ACTION_ENA invalidates L1 cache on gfx9
Marek Olšák [Thu, 4 Aug 2022 06:09:23 +0000 (02:09 -0400)]
radeonsi: don't assume that TC_ACTION_ENA invalidates L1 cache on gfx9

Just got into a midnight discussion with a hw guy.
TC_ACTION_ENA apparently doesn't invalidate L1, so don't clear
the INV_VCACHE flag.

Fixes: 4056e953fe43bd667 - radeonsi: move emit_cache_flush functions into si_gfx_cs.c

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17902>

2 years agoiris: Handle new untyped dataport cache flush PIPE_CONTROL field
Sagar Ghuge [Tue, 24 Aug 2021 19:23:57 +0000 (12:23 -0700)]
iris: Handle new untyped dataport cache flush PIPE_CONTROL field

Also while switching to GPGPU pipeline, make sure to flush the untyped
dataport cache. HDC pipeline flush bit must be set if we are flushing
untyped dataport L1 data cache.

v2: Add utrace support (Lionel)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agoanv: Handle bits to flush data-port's Untyped L1 data cache
Sagar Ghuge [Wed, 11 Aug 2021 23:53:42 +0000 (16:53 -0700)]
anv: Handle bits to flush data-port's Untyped L1 data cache

v2: Drop ANV_PIPE_UNTYPED_DATAPORT_CACHE_FLUSH_BIT from invalidate bits (Lionel)
    Add utrace support
    Expand on comment about PIPE_CONTROL::UntypedDataPortCache

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agointel/ds: track untyped dataport flushes
Lionel Landwerlin [Tue, 7 Jun 2022 11:33:04 +0000 (14:33 +0300)]
intel/ds: track untyped dataport flushes

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agoiris: Specify Untyped L1 cache policy for stateless accesses
Sagar Ghuge [Mon, 16 Aug 2021 19:29:37 +0000 (12:29 -0700)]
iris: Specify Untyped L1 cache policy for stateless accesses

Set write back L1 cache policy in STATE_BASE_ADDRESS instruction for A64
messages.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agoanv: Specify Untyped L1 cache policy for stateless accesses
Sagar Ghuge [Mon, 16 Aug 2021 19:16:49 +0000 (12:16 -0700)]
anv: Specify Untyped L1 cache policy for stateless accesses

Set write back L1 cache policy in STATE_BASE_ADDRESS instruction for A64
messages.

v2: Also set the value in genX_state.c (Lionel)

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agointel/isl: Setting L1 caching policy to Write-back mode
Sagar Ghuge [Thu, 12 Aug 2021 18:53:47 +0000 (11:53 -0700)]
intel/isl: Setting L1 caching policy to Write-back mode

For a RW L1 cache, both reads and writes are cached in the L1, at high
priority (MRU position). For a RO L1 cache, reads are cached at higher
priority and writes bypass the cache.

v1: (Ken)
- Set caching policy for buffer surfaces too

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agoanv: fixup PIPE_CONTROL restriction on gfx8
Lionel Landwerlin [Tue, 7 Jun 2022 15:39:28 +0000 (18:39 +0300)]
anv: fixup PIPE_CONTROL restriction on gfx8

We're missing a condition that is currently papered over by having
ANV_PIPE_HDC_PIPELINE_FLUSH_BIT in the invalidate bits.

v2: rework with simplication (Caio)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16905>

2 years agovc4: properly restore vc4 debug option
Juan A. Suarez Romero [Thu, 4 Aug 2022 11:28:03 +0000 (13:28 +0200)]
vc4: properly restore vc4 debug option

Otherwise VC4_DEBUG does not work.

Fixes: c3f5d276317 ("vc4/v3d: restore calling debug_get_option_vc4/v3d_debug")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17882>

2 years agodraw: don't touch info values that aren't valid.
Dave Airlie [Thu, 4 Aug 2022 03:24:25 +0000 (13:24 +1000)]
draw: don't touch info values that aren't valid.

These shouldn't be accessed, and shows up as an uninit access in
valgrind with piglit rasterpos

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

2 years agollvmpipe/ci: update ci results for clover.
Dave Airlie [Tue, 2 Aug 2022 00:47:31 +0000 (10:47 +1000)]
llvmpipe/ci: update ci results for clover.

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

2 years agolavapipe: scan shader for info before lowering images.
Dave Airlie [Fri, 7 May 2021 00:14:15 +0000 (10:14 +1000)]
lavapipe: scan shader for info before lowering images.

Otherwise the values will be wrong.

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

2 years agolavapipe: lower images to non-derefs in vulkan side
Dave Airlie [Thu, 6 May 2021 02:27:35 +0000 (12:27 +1000)]
lavapipe: lower images to non-derefs in vulkan side

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

2 years agogallivm/nir/st: lower image derefs in advance.
Dave Airlie [Wed, 5 May 2021 03:13:14 +0000 (13:13 +1000)]
gallivm/nir/st: lower image derefs in advance.

This improves clover from crashing to just failing, but I mainly
want it this to cleanup the nir code first

It's also important the shaders coming from the state tracker
for feedback get images lowered when they are draw shaders now.

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

2 years agovirgl/vtest: fix memory overwrite problem in virgl_vtest_send_get_caps()
Feng Jiang [Fri, 5 Aug 2022 02:09:44 +0000 (10:09 +0800)]
virgl/vtest: fix memory overwrite problem in virgl_vtest_send_get_caps()

Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17901>

2 years agovenus: double the abort timeout to allow long shader compiles
Yiwei Zhang [Thu, 4 Aug 2022 20:31:36 +0000 (20:31 +0000)]
venus: double the abort timeout to allow long shader compiles

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

2 years agovenus: increase busy wait order in vn_relax
Yiwei Zhang [Thu, 4 Aug 2022 19:06:17 +0000 (19:06 +0000)]
venus: increase busy wait order in vn_relax

This is mainly to workaround a platform issue that has huge sleep
penalty, which could lead to a timeout if the small synchronous queries
are going to sleep.

This change adjusts the warn and abort order correspondingly so that to
match prior timing.

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

2 years agozink: remove an old RGBA4 nvidia workaround
Mike Blumenkrantz [Wed, 3 Aug 2022 20:29:36 +0000 (16:29 -0400)]
zink: remove an old RGBA4 nvidia workaround

this should be automatically handled

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

2 years agozink: don't fixup sparse texops
Mike Blumenkrantz [Wed, 3 Aug 2022 19:57:00 +0000 (15:57 -0400)]
zink: don't fixup sparse texops

this is broken, and these will never need to be fixed

Fixes: 3a475766876 ("zink: add a compiler pass to match up tex op dest types")

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

2 years agozink: add all format modifiers when adding for dmabuf export
Mike Blumenkrantz [Wed, 3 Aug 2022 17:22:37 +0000 (13:22 -0400)]
zink: add all format modifiers when adding for dmabuf export

adding LINEAR before was a good starter step, but LINEAR
might not actually be supported (e.g., nvidia)

cc: mesa-stable

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

2 years agozink: don't add modifiers if EXT_image_drm_format_modifier isn't present
Mike Blumenkrantz [Tue, 2 Aug 2022 16:31:54 +0000 (12:31 -0400)]
zink: don't add modifiers if EXT_image_drm_format_modifier isn't present

cc: mesa-stable

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

2 years agozink: use modifier_aspect to check for modifier plane in zink_resource_get_param
Mike Blumenkrantz [Tue, 2 Aug 2022 16:27:59 +0000 (12:27 -0400)]
zink: use modifier_aspect to check for modifier plane in zink_resource_get_param

cc: mesa-stable

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

2 years agozink: demote dmabuf tiling to linear if modifiers aren't supported
Mike Blumenkrantz [Tue, 2 Aug 2022 16:26:55 +0000 (12:26 -0400)]
zink: demote dmabuf tiling to linear if modifiers aren't supported

this is effectively the same as LINEAR, and it still allows dmabuf creation

cc: mesa-stable

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

2 years agozink: add u_queue.h to kopper header
Mike Blumenkrantz [Tue, 2 Aug 2022 16:14:37 +0000 (12:14 -0400)]
zink: add u_queue.h to kopper header

types are used, so include the header

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

2 years agonine: check return on resource_get_handle
Mike Blumenkrantz [Mon, 1 Aug 2022 19:59:48 +0000 (15:59 -0400)]
nine: check return on resource_get_handle

this has a return code, and if it return false, this is probably an
exit condition

cc: mesa-stable

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

2 years agozink: support PIPE_QUERY_TIMESTAMP_DISJOINT
Mike Blumenkrantz [Mon, 1 Aug 2022 13:10:21 +0000 (09:10 -0400)]
zink: support PIPE_QUERY_TIMESTAMP_DISJOINT

the key point here is that disjoint is always false, but also return a handwavy
guess at frequency value based on timestampPeriod

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

2 years agozink: export PIPE_CAP_MULTISAMPLE_Z_RESOLVE
Mike Blumenkrantz [Fri, 29 Jul 2022 16:38:42 +0000 (12:38 -0400)]
zink: export PIPE_CAP_MULTISAMPLE_Z_RESOLVE

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

2 years agozink: rewrite all undefined shader reads as 0001 instead of undef
Mike Blumenkrantz [Fri, 29 Jul 2022 15:39:44 +0000 (11:39 -0400)]
zink: rewrite all undefined shader reads as 0001 instead of undef

this is a little less hostile towards broken/buggy apps

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

2 years agozink: handle invalid gl_TexCoord reads
Mike Blumenkrantz [Fri, 29 Jul 2022 15:36:33 +0000 (11:36 -0400)]
zink: handle invalid gl_TexCoord reads

if a texcoord input is read in a fragment shader but not written in
the previous stage, the texcoord variable must be preserved until
nir_lower_texcoord_replace has (possibly) run, and only then can it
be replaced with a 0000 read

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

2 years agozink: explicitly set nir cursor in rewrite_and_discard_read
Mike Blumenkrantz [Fri, 29 Jul 2022 15:36:10 +0000 (11:36 -0400)]
zink: explicitly set nir cursor in rewrite_and_discard_read

not sure if this is a bug but it looks weird

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

2 years agozink: fix return for PIPE_CAP_DEPTH_CLIP_DISABLE
Mike Blumenkrantz [Thu, 28 Jul 2022 17:15:33 +0000 (13:15 -0400)]
zink: fix return for PIPE_CAP_DEPTH_CLIP_DISABLE

this uses the extension now

Fixes: 21ea19d504b ("zink: Always enable depth clamping, make depth clipping independent.")

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

2 years agozink: handle !half_pixel_center
Mike Blumenkrantz [Thu, 28 Jul 2022 16:20:54 +0000 (12:20 -0400)]
zink: handle !half_pixel_center

the shader is already getting a -0.5,-0.5 bias, but the viewport also
needs to be shifted by 0.5 to match

cc: mesa-stable

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

2 years agozink: handle unscaled depth bias from nine
Mike Blumenkrantz [Thu, 28 Jul 2022 15:12:42 +0000 (11:12 -0400)]
zink: handle unscaled depth bias from nine

nine uses this to pass unscaled units for depth bias, which means
the units must be scaled based on the format of the depth buffer

cc: mesa-stable

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

2 years agozink: drop mode_changed check from linewidth/depthbias draw updates
Mike Blumenkrantz [Thu, 28 Jul 2022 15:09:19 +0000 (11:09 -0400)]
zink: drop mode_changed check from linewidth/depthbias draw updates

this doesn't need to be updated on primtype change since it's always
set

cc: mesa-stable

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

2 years agozink: allow sw loading with D3D_ALWAYS_SOFTWARE for nine
Mike Blumenkrantz [Wed, 27 Jul 2022 21:03:42 +0000 (17:03 -0400)]
zink: allow sw loading with D3D_ALWAYS_SOFTWARE for nine

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775>

2 years agozink: use maintenance4
Mike Blumenkrantz [Wed, 27 Jul 2022 20:13:21 +0000 (16:13 -0400)]
zink: use maintenance4

just by enabling this there are fewer validation warnings

truly incredible.

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

2 years agozink: force a new framebuffer for clear_depth_stencil if the clear region is big
Mike Blumenkrantz [Wed, 27 Jul 2022 20:04:54 +0000 (16:04 -0400)]
zink: force a new framebuffer for clear_depth_stencil if the clear region is big

can't clear outside the framebuffer, so set a new one if necessary

Fixes: f1f08e3529d ("zink: massively simplify zink_clear_depth_stencil")

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

2 years agozink: force flush clears on fb change if fb geometry changes
Mike Blumenkrantz [Wed, 27 Jul 2022 20:03:42 +0000 (16:03 -0400)]
zink: force flush clears on fb change if fb geometry changes

Fixes: 66ceea7ed9a ("zink: lift clearing on fb state change up a level")

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

2 years agotu: Implement VK_EXT_vertex_input_dynamic_state
Connor Abbott [Thu, 14 Jul 2022 12:16:39 +0000 (14:16 +0200)]
tu: Implement VK_EXT_vertex_input_dynamic_state

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

2 years agotu: Decouple vertex input state from shader
Connor Abbott [Wed, 13 Jul 2022 13:48:57 +0000 (15:48 +0200)]
tu: Decouple vertex input state from shader

Emit VFD_DECODE and VFD_DEST separately, similarly to what Gallium does.
This means we emit a few more VFD_DECODE for binning shaders and when
there are unused attributes, but hopefully the overhead won't be too
much. In exchange we lose one draw state, and in the future we can
pre-compute the dynamic vertex state independently of the shader, so
there should be lower CPU overhead with dynamic vertex inputs.

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

2 years agofreedreno: Disable UBWC for frontbuffer rendering
Rob Clark [Thu, 28 Jul 2022 21:27:56 +0000 (14:27 -0700)]
freedreno: Disable UBWC for frontbuffer rendering

Note that glamor would still need to set this new
GBM_BO_USE_FRONT_RENDERING flag.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6865
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17799>

2 years agogbm: Add USE_FRONT_RENDERING flag
Rob Clark [Thu, 28 Jul 2022 21:04:27 +0000 (14:04 -0700)]
gbm: Add USE_FRONT_RENDERING flag

Provide a use flag to let the driver know that the allocated buffer will
be used for frontbuffer rendering.  For example, bandwidth compressed
formats should usually be avoided for frontbuffer rendering to avoid the
visual corruption that results from this display racing with the GPU
writing header data vs. pixel data.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17799>

2 years agoci/zink: Re-enable a630 zink-on-turnip traces job using gbm as the backend.
Emma Anholt [Fri, 15 Jul 2022 00:03:02 +0000 (17:03 -0700)]
ci/zink: Re-enable a630 zink-on-turnip traces job using gbm as the backend.

This is a workaround for #6753, without having to build and install a
custom xlib in our containers.  Maybe some day debian will have a
backport?

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

2 years agozink: Replace the "optimal_tiling" flag with a "linear" flag instead.
Emma Anholt [Tue, 26 Jul 2022 23:52:20 +0000 (16:52 -0700)]
zink: Replace the "optimal_tiling" flag with a "linear" flag instead.

That's what it actually means now.

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

2 years agozink: Take the tiling path for resources with modifiers.
Emma Anholt [Wed, 27 Jul 2022 18:59:22 +0000 (11:59 -0700)]
zink: Take the tiling path for resources with modifiers.

transfer_map (the only consumer of the flag now) was doing direct mapping
on resources with modifiers (UBWC compressed images on turnip) and
accessing them as linear.  We definitely want the staging blit path
instead.

Fixes glReadPixels() from gbm surfaces on turnip.

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

2 years agoutil/memstream: insert null terminator on windows
Karol Herbst [Thu, 4 Aug 2022 11:13:16 +0000 (13:13 +0200)]
util/memstream: insert null terminator on windows

Libc's open_memstream is doing so on Unix systems already.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agogallium: mark the input data as const in pipe_grid_info
Karol Herbst [Fri, 1 Jul 2022 12:40:33 +0000 (14:40 +0200)]
gallium: mark the input data as const in pipe_grid_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agovtn: silence warning about linkage
Karol Herbst [Tue, 3 May 2022 23:08:58 +0000 (01:08 +0200)]
vtn: silence warning about linkage

For OpenCL kernels we simply link together SPIR-V files, so the only case
where we are left with linking shaders together is libclc and we handle
that just fine.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agoclc: undefine spirv defs to work around LLVMs headers
Karol Herbst [Thu, 12 May 2022 21:57:24 +0000 (23:57 +0200)]
clc: undefine spirv defs to work around LLVMs headers

Clang unconditionally adds those definitions if using a spirv LLVM target.

That's not a problem on its own, but clang's internal OpenCL header enable
a bunch of OpenCL extensions if those are set.

Lucky for us, we can simply undefine them and spare us the trouble of
finding an upstream solution to this problem :)

This fixes the OpenCL CTS' compiler features_macro test.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agomicrosoft/clc: drop inline sampler reordering
Karol Herbst [Wed, 3 Aug 2022 17:20:35 +0000 (19:20 +0200)]
microsoft/clc: drop inline sampler reordering

nir_dedup_inline_samplers is now taking care of it.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agonir: Clean up and improve nir_dedup_inline_samplers
Jason Ekstrand [Fri, 15 Jul 2022 14:35:55 +0000 (16:35 +0200)]
nir: Clean up and improve nir_dedup_inline_samplers

It now removes dead inline sampler variables and moves everything to the
end so we no longer need nir_move_inline_samplers_to_end().

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

2 years agonir: extract the clc inline sampler dedup pass from clc
Karol Herbst [Fri, 1 Jul 2022 12:38:11 +0000 (14:38 +0200)]
nir: extract the clc inline sampler dedup pass from clc

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agonir/lower_images: extract from clover
Karol Herbst [Sat, 2 Jul 2022 16:50:55 +0000 (18:50 +0200)]
nir/lower_images: extract from clover

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agonir: serialize printf metadata for CL kernels
Karol Herbst [Fri, 1 Jul 2022 12:35:23 +0000 (14:35 +0200)]
nir: serialize printf metadata for CL kernels

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agoprintf: add some unit tests
Karol Herbst [Tue, 2 Aug 2022 20:15:19 +0000 (22:15 +0200)]
printf: add some unit tests

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agoprintf: extract clovers printf impl
Karol Herbst [Sat, 16 Apr 2022 08:48:08 +0000 (10:48 +0200)]
printf: extract clovers printf impl

Also make the code cleaner and simplier.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17334>

2 years agoci/bin: ignore Gitlab GQL cache
David Heidelberg [Thu, 4 Aug 2022 14:22:17 +0000 (16:22 +0200)]
ci/bin: ignore Gitlab GQL cache

Fixes: 266e3a627fbf ("ci/bin: Cache GQL queries")

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17885>