platform/upstream/mesa.git
19 months agoutil/vbuf: clarify indirect draws handling
Pierre-Eric Pelloux-Prayer [Fri, 31 Mar 2023 14:59:32 +0000 (16:59 +0200)]
util/vbuf: clarify indirect draws handling

It wasn't obvious from the u_vbuf code alone that num_draws
is guaranteed to be 1 in the indirect case.

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

19 months agomesa: fix invalid index_bo refcounting
Pierre-Eric Pelloux-Prayer [Fri, 31 Mar 2023 14:57:08 +0000 (16:57 +0200)]
mesa: fix invalid index_bo refcounting

If take_index_buffer_ownership is true, then we should reserve
enough references of index_bo or we'll get an underflow later.

Fixes: 819627041e7 ("mesa: set pipe_draw_info::index::resource directly and remove gl_bo")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8747
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>

19 months agozink: be explicit about separate shader dsl indexing during creation
Mike Blumenkrantz [Mon, 3 Apr 2023 16:45:11 +0000 (12:45 -0400)]
zink: be explicit about separate shader dsl indexing during creation

this fixes a minor issue where a fs without a vs dsl would have the wrong
index

Fixes: e3b746e3a31 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22269>

19 months agoanv: check for MESA_SHADER_TESS_CTRL with get_tcs_prog_data
Tapani Pälli [Tue, 4 Apr 2023 07:15:29 +0000 (10:15 +0300)]
anv: check for MESA_SHADER_TESS_CTRL with get_tcs_prog_data

Fixes: 86d931724db ("anv: Implement Wa_14015297576")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>

19 months agoanv: take primitive ID override to account Wa_14015297576
Tapani Pälli [Tue, 4 Apr 2023 05:40:34 +0000 (08:40 +0300)]
anv: take primitive ID override to account Wa_14015297576

Commit ca4ec49b0e0 took primitive ID override fields in to use, this
has to be checked as part of Wa_14015297576.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>

19 months agozink: always store nir serialized
Mike Blumenkrantz [Wed, 29 Mar 2023 11:47:43 +0000 (07:47 -0400)]
zink: always store nir serialized

this saves a ton of memory and has minimal, if any cpu impact

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

19 months agozink: store num_inlinable_uniforms separately for cs programs
Mike Blumenkrantz [Wed, 29 Mar 2023 12:40:14 +0000 (08:40 -0400)]
zink: store num_inlinable_uniforms separately for cs programs

compute is a special case because the zink_shader itself is created
in a thread, which means it cannot be accessed directly at bind time
since it may not have finished creating itself yet

to avoid prematurely waiting on an async fence, the one value needed
at bind time can instead be stored separately

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

19 months agozink: move nir cloning out to callers of zink_shader_compile
Mike Blumenkrantz [Wed, 29 Mar 2023 12:10:51 +0000 (08:10 -0400)]
zink: move nir cloning out to callers of zink_shader_compile

this will make more sense with future changes

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

19 months agozink: break out nir blob deserializing
Mike Blumenkrantz [Wed, 29 Mar 2023 12:08:00 +0000 (08:08 -0400)]
zink: break out nir blob deserializing

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

19 months agozink: simplify assign_io() further
Mike Blumenkrantz [Wed, 29 Mar 2023 11:46:10 +0000 (07:46 -0400)]
zink: simplify assign_io() further

no functional changes

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

19 months agozink: store nir as serialized on zink_shader structs
Mike Blumenkrantz [Tue, 28 Mar 2023 22:52:31 +0000 (18:52 -0400)]
zink: store nir as serialized on zink_shader structs

nir_shader objects are hefty, and they really add up when there's a lot
of them. there's also not much use in keeping them around, as any time
they'll be used, they're always cloned first, and deserializing isn't
likely to be any slower than a clone

cuts driver memory usage by ~40% for tomb raider

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

19 months agozink: streamline nir cloning for assign_io
Mike Blumenkrantz [Tue, 28 Mar 2023 22:51:42 +0000 (18:51 -0400)]
zink: streamline nir cloning for assign_io

more relics from the time of pipe_shader_type

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

19 months agozink: directly return nir from zink_shader_tcs_create
Mike Blumenkrantz [Wed, 29 Mar 2023 12:18:04 +0000 (08:18 -0400)]
zink: directly return nir from zink_shader_tcs_create

not currently used but will be

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

19 months agozink: swap nir pointers when compiling compute shaders
Mike Blumenkrantz [Tue, 28 Mar 2023 22:47:08 +0000 (18:47 -0400)]
zink: swap nir pointers when compiling compute shaders

these are the same pointer, just use a different one

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

19 months agozink: pass nir directly to zink_shader_tcs_create()
Mike Blumenkrantz [Tue, 28 Mar 2023 22:46:02 +0000 (18:46 -0400)]
zink: pass nir directly to zink_shader_tcs_create()

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

19 months agozink: simplify fbfetch output detection from fs
Mike Blumenkrantz [Tue, 28 Mar 2023 22:43:18 +0000 (18:43 -0400)]
zink: simplify fbfetch output detection from fs

this should be identical to the previous code, except it also
handles depth/stencil (not yet supported)

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

19 months agozink: use zink_shader::info instead of zink_shader::nir::info
Mike Blumenkrantz [Tue, 28 Mar 2023 22:42:44 +0000 (18:42 -0400)]
zink: use zink_shader::info instead of zink_shader::nir::info

no functional changes

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

19 months agozink: generate flat_flags during shader creation
Mike Blumenkrantz [Wed, 29 Mar 2023 20:53:52 +0000 (16:53 -0400)]
zink: generate flat_flags during shader creation

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

19 months agozink: pass nir_shader to update_so_info()
Mike Blumenkrantz [Tue, 28 Mar 2023 22:37:49 +0000 (18:37 -0400)]
zink: pass nir_shader to update_so_info()

no functional changes

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

19 months agozink: add and populate a shader_info struct to zink_shader
Mike Blumenkrantz [Tue, 28 Mar 2023 22:39:29 +0000 (18:39 -0400)]
zink: add and populate a shader_info struct to zink_shader

this avoids the need to use the nir pointer to access shader info

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

19 months agozink: delete shader reordering in assign_io()
Mike Blumenkrantz [Tue, 28 Mar 2023 22:22:39 +0000 (18:22 -0400)]
zink: delete shader reordering in assign_io()

this is a relic of when pipe_shader_type was different than gl_shader_stage

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

19 months agov3dv/pipeline: use pipeline depth bias enabled to fill up CFG packet
Alejandro Piñeiro [Sat, 1 Apr 2023 22:19:32 +0000 (00:19 +0200)]
v3dv/pipeline: use pipeline depth bias enabled to fill up CFG packet

Even if the VkPipelineRasterizationStateCreateInfo sets
depthBiasEnable, internally we comput if it is really makes sense, and
use that to decide for example if we emit the Depth Offset packet.

But we were not using this to enable Depth Bias through the depth
offset enable field on the CFG packet.

So in some tests we were enabling depth bias, but not emitting the
packet to configure it, that seemed somewhat inconsistent.

This didn't cause any issue so far, but let's be conservative.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22252>

19 months agointel/perf: fix OA format selection on MTL
Lionel Landwerlin [Mon, 3 Apr 2023 06:25:44 +0000 (09:25 +0300)]
intel/perf: fix OA format selection on MTL

Anything Gfx12.5+ has a different format.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 90c86fe63e ("intel: add MTL performance metrics")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22257>

19 months agointel/dev: set a default valid kmd_type
Lionel Landwerlin [Mon, 3 Apr 2023 06:33:56 +0000 (09:33 +0300)]
intel/dev: set a default valid kmd_type

src/intel/perf/intel_perf_query_layout.c needs a valid kmd type to
look at the metrics

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 757e2dd692 ("intel/perf: Disable it for Xe KMD")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22257>

19 months agointel/fs: Rework the loop of opt_combine_constants that collects constants
Ian Romanick [Thu, 30 Jul 2020 02:10:55 +0000 (19:10 -0700)]
intel/fs: Rework the loop of opt_combine_constants that collects constants

This is a bit more wordy, but it will greatly simplify some future
changes.

v2: Rebase on ADD3 changes.

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

19 months agointel/fs: Refactor part of opt_combine_constants to a separate function
Ian Romanick [Thu, 30 Jul 2020 01:37:42 +0000 (18:37 -0700)]
intel/fs: Refactor part of opt_combine_constants to a separate function

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

19 months agointel/fs: Output opt_combine_constants debug to stderr
Ian Romanick [Wed, 2 Dec 2020 19:31:57 +0000 (11:31 -0800)]
intel/fs: Output opt_combine_constants debug to stderr

It's a lot more useful to have it in the same stream with the
INTEL_DEBUG=fs output.

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

19 months agovulkan/wsi/display: do not dereference a NULL pointer
Iván Briano [Mon, 10 Oct 2022 21:45:58 +0000 (14:45 -0700)]
vulkan/wsi/display: do not dereference a NULL pointer

Fixes dEQP-VK.wsi.direct_drm.swapchain.simulate_oom.*

Cc: mesa-stable
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19025>

19 months agovulkan: Drop VkRenderingSelfDependencyInfoMESA
Faith Ekstrand [Wed, 29 Mar 2023 15:02:15 +0000 (10:02 -0500)]
vulkan: Drop VkRenderingSelfDependencyInfoMESA

It's no longer needed as VK_EXT_attachment_feedback_loop_layout provides
everything we need.

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

19 months agovulkan: Drop vk_render_pass_state::*self_dependenc*
Faith Ekstrand [Wed, 29 Mar 2023 15:02:15 +0000 (10:02 -0500)]
vulkan: Drop vk_render_pass_state::*self_dependenc*

ANV was the only driver using them and now it's on feedback loop flags.
Other drivers should convert instead of depending on the old version.

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

19 months agohasvk/pipeline: Use feedback loop flags for self-dependencies
Faith Ekstrand [Wed, 29 Mar 2023 15:02:15 +0000 (10:02 -0500)]
hasvk/pipeline: Use feedback loop flags for self-dependencies

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

19 months agoanv/pipeline: Use feedback loop flags for self-dependencies
Faith Ekstrand [Wed, 29 Mar 2023 15:02:15 +0000 (10:02 -0500)]
anv/pipeline: Use feedback loop flags for self-dependencies

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

19 months agovulkan: Plumb rendering flags through vk_graphics_pipeline_state
Faith Ekstrand [Thu, 30 Mar 2023 15:27:27 +0000 (10:27 -0500)]
vulkan: Plumb rendering flags through vk_graphics_pipeline_state

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

19 months agovk/render_pass: Support VK_EXT_fragment_density_map
Connor Abbott [Thu, 30 Mar 2023 17:14:21 +0000 (12:14 -0500)]
vk/render_pass: Support VK_EXT_fragment_density_map

Support emulating "classic" FDM with dynamic rendering.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>

19 months agotu: Use vk_pipeline_get_renderpass_flags()
Connor Abbott [Mon, 12 Dec 2022 20:21:17 +0000 (21:21 +0100)]
tu: Use vk_pipeline_get_renderpass_flags()

With this we can remove usage of VkSelfDependencyInfoMESA.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>

19 months agovulkan: Record pipeline flags in the render pass
Jason Ekstrand [Tue, 2 Aug 2022 18:13:54 +0000 (13:13 -0500)]
vulkan: Record pipeline flags in the render pass

This records any rendering pipeline flags in the render pass.  This
provides much-needed information for the VK_KHR_fragment_shading_rate
and VK_EXT_fragment_density_map extensions as well as provides an
alternative to VkRenderingSelfDependencyInfoMESA which is based on
VK_EXT_attachment_feedback_loop_layout.

v2 (Connor): Name something more general
v3 (Faith): Also add the FSR flag

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

19 months agoradv/ci: add one more flake
Samuel Pitoiset [Mon, 3 Apr 2023 07:18:20 +0000 (09:18 +0200)]
radv/ci: add one more flake

This one is randomly failing.

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

19 months agozink/ci: remove primitive-id-no-gs-quads from the NAVI10 fail list
Samuel Pitoiset [Mon, 3 Apr 2023 07:16:53 +0000 (09:16 +0200)]
zink/ci: remove primitive-id-no-gs-quads from the NAVI10 fail list

It has been fixed too.

Fixes: 5fb8ba0eb8b ("zink/ci: remove `primitive-id-no-gs-quads` from radv-vangogh-fails")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22258>

19 months agoradv/gfx11: improve RT scratch allocation
Rhys Perry [Wed, 29 Mar 2023 13:59:00 +0000 (14:59 +0100)]
radv/gfx11: improve RT scratch allocation

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22232>

19 months agoradv: Use linear_dispatch info in GFX11 task/mesh draw packet.
Timur Kristóf [Thu, 30 Mar 2023 18:08:35 +0000 (20:08 +0200)]
radv: Use linear_dispatch info in GFX11 task/mesh draw packet.

This helps the CP (command processor) optimize mesh shader
dispatch when Y = Z = 1.

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

19 months agonir: Gather compile time constant task->mesh dispatch size.
Timur Kristóf [Thu, 30 Mar 2023 17:34:31 +0000 (19:34 +0200)]
nir: Gather compile time constant task->mesh dispatch size.

Some GPUs such as AMD RDNA3 can use this information
to optimize mesh shader dispatches.

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

19 months agoaco: Better phi lowering for merge block when else-side is const.
Timur Kristóf [Tue, 21 Feb 2023 14:04:40 +0000 (15:04 +0100)]
aco: Better phi lowering for merge block when else-side is const.

Add a new special case for binary merge blocks to boolean
phi lowerig. This special case benefits shaders that
have divergent branches with an empty else block,
for example all NGG culling shaders.

Fossil DB stats on Rembrandt (NGG culling enabled):

Totals from 61778 (45.79% of 134913) affected shaders:
SpillVGPRs: 2268 -> 2284 (+0.71%); split: -1.10%, +1.81%
CodeSize: 164317952 -> 162962772 (-0.82%); split: -0.83%, +0.00%
Instrs: 31249824 -> 30910686 (-1.09%); split: -1.09%, +0.00%
Latency: 154948555 -> 154781097 (-0.11%); split: -0.12%, +0.02%
InvThroughput: 30397664 -> 30370872 (-0.09%); split: -0.13%, +0.04%
VClause: 529239 -> 529229 (-0.00%); split: -0.00%, +0.00%
SClause: 783417 -> 783430 (+0.00%)
Copies: 2627570 -> 2595161 (-1.23%); split: -1.25%, +0.02%
Branches: 976506 -> 976508 (+0.00%); split: -0.00%, +0.00%

Fossil DB stats on GFX11 (NGG culling disabled):

Totals from 895 (0.66% of 134913) affected shaders:
SpillVGPRs: 2258 -> 2322 (+2.83%); split: -0.44%, +3.28%
CodeSize: 6229152 -> 6215880 (-0.21%); split: -0.37%, +0.16%
Scratch: 216576 -> 215808 (-0.35%); split: -0.47%, +0.12%
Instrs: 1202077 -> 1198396 (-0.31%); split: -0.43%, +0.13%
Latency: 15921336 -> 16000561 (+0.50%); split: -0.74%, +1.24%
InvThroughput: 7425765 -> 7474891 (+0.66%); split: -0.67%, +1.33%
VClause: 22976 -> 23008 (+0.14%); split: -0.03%, +0.17%
SClause: 38269 -> 38271 (+0.01%)
Copies: 123244 -> 123896 (+0.53%); split: -0.30%, +0.83%
Branches: 47570 -> 47574 (+0.01%); split: -0.00%, +0.01%

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

19 months agoaco: Call dominator_tree before lower_phis.
Timur Kristóf [Tue, 21 Feb 2023 13:33:58 +0000 (14:33 +0100)]
aco: Call dominator_tree before lower_phis.

This just makes it possible to use the dominator
tree information during phi lowering.

No Fossil DB changes on GFX11.

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

19 months agoaco: Pop branch operands when targets are same in SSA elimination.
Timur Kristóf [Sun, 2 Apr 2023 22:05:09 +0000 (00:05 +0200)]
aco: Pop branch operands when targets are same in SSA elimination.

The branch instruction is no longer conditional when the targets are the
same, so the operand is not necessary and can be removed.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>

19 months agoaco: Don't verify branch exec read when eliminating exec writes.
Timur Kristóf [Sun, 2 Apr 2023 22:03:37 +0000 (00:03 +0200)]
aco: Don't verify branch exec read when eliminating exec writes.

Verifying that the branch instruction reads exec is not actually
necessary because the pattern that we look for already implies that.

This prepares for the next commit which will remove the exec operand
from branches that have the same target. These branches will no
longer read exec, but they should still get the same optimization.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>

19 months agoaco: Simplify get_phi_operand using Operand::c32_or_c64.
Timur Kristóf [Sun, 19 Feb 2023 13:07:10 +0000 (14:07 +0100)]
aco: Simplify get_phi_operand using Operand::c32_or_c64.

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

19 months agoaco: Don't remove exec writes that also write other registers.
Timur Kristóf [Sun, 2 Apr 2023 20:11:25 +0000 (22:11 +0200)]
aco: Don't remove exec writes that also write other registers.

Don't eliminate an instruction that writes registers other than exec and scc.
It is possible that this is eg. an s_and_saveexec and the saved value is
used by a later branch.

Fixes: bc130497472cb4ec4ec60695ed99b169d6681118
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>

19 months agoaco: Consider p_cbranch_nz as divergent branch too.
Timur Kristóf [Sun, 2 Apr 2023 20:08:51 +0000 (22:08 +0200)]
aco: Consider p_cbranch_nz as divergent branch too.

A p_cbranch_nz instruction that reads exec is divergent too.

Fixes: f030b75b7d2c359b90c18ee4ed83fa05265c12e0
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>

19 months agoci: disable lima farm, currently out-of-space, needs to be fixed
David Heidelberg [Mon, 3 Apr 2023 12:41:15 +0000 (14:41 +0200)]
ci: disable lima farm, currently out-of-space, needs to be fixed

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

19 months agoradv: Pre-compute descriptor set layout hash.
Tatsuyuki Ishi [Sun, 2 Apr 2023 06:41:25 +0000 (15:41 +0900)]
radv: Pre-compute descriptor set layout hash.

While analyzing cache loading performance, hashing the pipeline layout was
surprisingly consuming around 4% of time, sometimes close to the cost of
hashing shader modules.

Turns out we were hashing the pipeline layout on every pipeline creation.
Considering that pipeline layouts are usually deduplicated by the
application, this was amplifying the hashing cost by a big margin.

With Graphics Pipeline Library, we do need to rebuild the pipeline layout
by combining those from each library, but we can memoize the hash of the
descriptor set layout. The cost of re-hashing hashes is negligible since
each descriptor set layout can amount to 1–2KB in size.

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

19 months agoanv: Bump VkDeviceMemory objects limit to 4GB
Nataraj Deshpande [Tue, 14 Mar 2023 23:39:34 +0000 (16:39 -0700)]
anv: Bump VkDeviceMemory objects limit to 4GB

Android CTS 13_r4 tests dEQP-VK.memory.allocation.random* fail
with VK_ERROR_OUT_OF_DEVICE_MEMORY on ADL boards with 32GB memory
as memory allocation requests from DEQP are much larger(~2.9GB+)
based on device heap size/8.

Increase the limit to unsigned 32bit max(~4GB) which helps to
fix the dEQP-VK.memory.allocation.random* tests.

v1: Bound allocation by the largest memory heap size (Lionel Landwerlin)

v2: Clean up comments to reflect the code change (Ivan Briano)
    Update the value of MAX_MEMORY_ALLOCATION_SIZE (Lionel Landwerlin)

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

19 months agoisl: update max buffer size for SKL+
Lionel Landwerlin [Wed, 22 Mar 2023 10:11:22 +0000 (12:11 +0200)]
isl: update max buffer size for SKL+

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>

19 months agoanv: take care of maxStorageBufferRange being uint32_t
Lionel Landwerlin [Wed, 22 Mar 2023 11:39:42 +0000 (13:39 +0200)]
anv: take care of maxStorageBufferRange being uint32_t

Not fixing anything, but required for another fix.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>

19 months agoac/llvm: remove ac_build_opencoded_load_format
Qiang Yu [Mon, 20 Mar 2023 04:37:22 +0000 (12:37 +0800)]
ac/llvm: remove ac_build_opencoded_load_format

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

19 months agoac/llvm,radeonsi: remove abi->load_inputs implementation
Qiang Yu [Mon, 20 Mar 2023 04:33:26 +0000 (12:33 +0800)]
ac/llvm,radeonsi: remove abi->load_inputs implementation

No nir_load_input in VS now.

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

19 months agoradeonsi: monolithic VS emit prolog in nir directly
Qiang Yu [Mon, 20 Mar 2023 04:26:57 +0000 (12:26 +0800)]
radeonsi: monolithic VS emit prolog in nir directly

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

19 months agoac/llvm: move ac_fixup_ls_hs_input_vgprs to amd common
Qiang Yu [Mon, 20 Mar 2023 04:15:02 +0000 (12:15 +0800)]
ac/llvm: move ac_fixup_ls_hs_input_vgprs to amd common

To be shared with radeonsi.

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

19 months agoac/llvm: vs_rel_patch_id can also be fixed up
Qiang Yu [Mon, 20 Mar 2023 03:49:20 +0000 (11:49 +0800)]
ac/llvm: vs_rel_patch_id can also be fixed up

It's currently used when LS store output to LDS.
The LS/HS bug fix seems does not affect this case.
But we'd better treat it as other fixed args.

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

19 months agoradeonsi: add si_nir_lower_vs_inputs
Qiang Yu [Sat, 18 Mar 2023 13:35:45 +0000 (21:35 +0800)]
radeonsi: add si_nir_lower_vs_inputs

Ported from llvm:
* si_load_vs_input
* ac_build_opencoded_load_format
* ac_ufN_to_float
* get_vertex_index
* ac_build_fast_udiv_nuw

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

19 months agoac/nir: add ac_nir_load_arg_at_offset
Qiang Yu [Sat, 18 Mar 2023 13:32:16 +0000 (21:32 +0800)]
ac/nir: add ac_nir_load_arg_at_offset

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

19 months agoradeonsi: expose si_nir_load_internal_binding
Qiang Yu [Fri, 3 Mar 2023 03:36:20 +0000 (11:36 +0800)]
radeonsi: expose si_nir_load_internal_binding

PS polygon stippling is going to use it too.

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

19 months agohasvk: include "vk_android.h" header in anv_android.c
Mauro Rossi [Sat, 1 Apr 2023 11:24:19 +0000 (13:24 +0200)]
hasvk: include "vk_android.h" header in anv_android.c

Fixes the following building errors:

../src/intel/vulkan_hasvk/anv_android.c:387:34: error: implicit declaration of function 'vk_alloc_ahardware_buffer' is invalid in C99 [-Werror,-
Wimplicit-function-declaration]
   struct AHardwareBuffer *ahw = vk_alloc_ahardware_buffer(pAllocateInfo);
                                 ^
../src/intel/vulkan_hasvk/anv_android.c:387:28: error: incompatible integer to pointer conversion initializing 'struct AHardwareBuffer *' with an expression of type 'int' [-Werror,-Wint-conversion]
   struct AHardwareBuffer *ahw = vk_alloc_ahardware_buffer(pAllocateInfo);
                           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Fixes: b16cfe23 ("vulkan,anv,hasvk,radv: Unify Android hardware buffer creation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22251>

19 months agoac/nir: When task->mesh dispatch Y or Z are 0, also set X to 0.
Timur Kristóf [Thu, 30 Mar 2023 20:41:45 +0000 (22:41 +0200)]
ac/nir: When task->mesh dispatch Y or Z are 0, also set X to 0.

AMD recommends doing this to speed up the CP when it processes
the draw ring entries. LLPC also does this.

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

19 months agoac/nir: Store only lowest 8 bits for task draw ring DWORD3.
Timur Kristóf [Wed, 29 Mar 2023 22:33:17 +0000 (00:33 +0200)]
ac/nir: Store only lowest 8 bits for task draw ring DWORD3.

When writing the draw ready bit, don't write the high 24 bits
of DWORD3, because that is used by the HW for something else
according to LLPC.

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

19 months agoaco: fix nir_var_shader_out barriers for task shaders
Rhys Perry [Fri, 31 Mar 2023 12:59:59 +0000 (13:59 +0100)]
aco: fix nir_var_shader_out barriers for task shaders

These will be used in a future commit.

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

19 months agofreedreno: Support the disable_throttling=true driconf option
Rob Clark [Wed, 29 Mar 2023 21:33:57 +0000 (14:33 -0700)]
freedreno: Support the disable_throttling=true driconf option

At this point, mostly just to make it easier to disable throttling for
performance debugging.

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

19 months agofreedreno: Move driconf settings into sub-struct
Rob Clark [Wed, 29 Mar 2023 21:22:30 +0000 (14:22 -0700)]
freedreno: Move driconf settings into sub-struct

Organize all one of them in a single place before adding more.

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

19 months agofreedreno: Avoid looping shader stages if nothing dirty
Rob Clark [Mon, 27 Mar 2023 18:00:45 +0000 (11:00 -0700)]
freedreno: Avoid looping shader stages if nothing dirty

We have corresponding global dirty bits for each of the per-stage dirty
bits.  We can use this to skip iterating over shader stages when there
is no per-stage dirty state to handle.

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

19 months agofreedreno: Re-work dirty-resource tracking
Rob Clark [Sun, 26 Mar 2023 20:00:25 +0000 (13:00 -0700)]
freedreno: Re-work dirty-resource tracking

If a resource is dirty but already tracked by the current batch, no need
to process it at draw time.

Note that the batch could change (ie. new fb state bound, etc) after the
check if we need resource dirty tracking, but in these cases all the
dirty-resource state is marked dirty.

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

19 months agofreedreno: Inline single-use helpers
Rob Clark [Sun, 26 Mar 2023 19:27:22 +0000 (12:27 -0700)]
freedreno: Inline single-use helpers

bind_sampler_states() / set_sampler_views() have just a single caller.
So inline them.  Needed for next commit.

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

19 months agofreedreno: Extract out a helper
Rob Clark [Sun, 26 Mar 2023 19:16:50 +0000 (12:16 -0700)]
freedreno: Extract out a helper

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

19 months agofreedreno: Hoist dirty vars
Rob Clark [Sun, 26 Mar 2023 18:53:15 +0000 (11:53 -0700)]
freedreno: Hoist dirty vars

Prep to re-work how we track dirty-resource.

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

19 months agofreedreno: Stop being too clever by half
Rob Clark [Mon, 27 Mar 2023 22:06:37 +0000 (15:06 -0700)]
freedreno: Stop being too clever by half

This wasn't taking into account a change in corresponding bit in
writeable_bitmask, causing problem if an SSBO was first bound for
read, and then rebound for write, we wouldn't update the buffers
valid range.  Instead just drop the premature optimization.

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

19 months agofreedreno: Fix or/and'ing two BitmaskEnums
Connor Abbott [Fri, 17 Mar 2023 14:11:53 +0000 (15:11 +0100)]
freedreno: Fix or/and'ing two BitmaskEnums

Previously when there was an & or | with two BitmaskEnums, the compiler
would try to cast the RHS and find a matching overload, but there were
many different casts (to the enum itself, to an integer, to a boolean,
etc.) each with a matching overload which meant that it couldn't pick
one and errored out due to an ambiguous overload. Fix this by
explicitly providing an overload that takes a BitmaskEnum on the RHS.
It has to also provide a BitmaskEnum output, so that subsequent
operators with the result on the LHS (e.g. when or'ing together three
BitmaskEnums without any parentheses tricks) also get the right
overload.

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

19 months agonine: use separate register for aL emulation
Pavel Ondračka [Thu, 9 Feb 2023 19:49:54 +0000 (20:49 +0100)]
nine: use separate register for aL emulation

NIR loop unrolling is only working if the loop counter is a scalar.
So keep the loop counter separate and move the aL emulation and
the aL increment to a new register.

This allows loop unrolling with vec4 backends where unconditional
scalarizing of phi nodes is undesirable, like for example r300.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7222
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21243>

19 months agorusticl/kernel: make use of cso info
Karol Herbst [Fri, 18 Nov 2022 14:51:18 +0000 (15:51 +0100)]
rusticl/kernel: make use of cso info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agopanfrost: implement get_compute_state_info
Karol Herbst [Wed, 30 Nov 2022 16:53:43 +0000 (17:53 +0100)]
panfrost: implement get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agopanfrost: move max_thread_count and take reg_count into account
Karol Herbst [Wed, 30 Nov 2022 16:53:12 +0000 (17:53 +0100)]
panfrost: move max_thread_count and take reg_count into account

We'll need it to report proper thread counts for OpenCL.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agonvc0: implement get_compute_state_info
Karol Herbst [Wed, 30 Nov 2022 13:55:30 +0000 (14:55 +0100)]
nvc0: implement get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agonv50: implement get_compute_state_info
Karol Herbst [Wed, 30 Nov 2022 16:17:48 +0000 (17:17 +0100)]
nv50: implement get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agoiris: implement get_compute_state_info
Karol Herbst [Fri, 18 Nov 2022 20:20:05 +0000 (21:20 +0100)]
iris: implement get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agolp: implement get_compute_state_info
Karol Herbst [Wed, 30 Nov 2022 11:53:57 +0000 (12:53 +0100)]
lp: implement get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agogallium: add get_compute_state_info
Karol Herbst [Wed, 16 Nov 2022 22:22:13 +0000 (23:22 +0100)]
gallium: add get_compute_state_info

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agorusticl/kernel: set has_variable_shared_mem on the nir
Karol Herbst [Tue, 22 Nov 2022 22:00:46 +0000 (23:00 +0100)]
rusticl/kernel: set has_variable_shared_mem on the nir

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agonir: track existence of variable shared memory
Karol Herbst [Tue, 22 Nov 2022 21:47:29 +0000 (22:47 +0100)]
nir: track existence of variable shared memory

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>

19 months agoRevert "d3d12: Honor suggested driver profile/level for H264/HEVC encode"
Sil Vilerino [Fri, 31 Mar 2023 15:12:28 +0000 (11:12 -0400)]
Revert "d3d12: Honor suggested driver profile/level for H264/HEVC encode"

This reverts commit 37652da61612aadfedc23ba484b33781654d5d56.

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

19 months agoaco: don't optimize s_or_b64(v_cmp_u_f32(a, b), cmp(a, a))
Rhys Perry [Thu, 30 Mar 2023 14:33:57 +0000 (15:33 +0100)]
aco: don't optimize s_or_b64(v_cmp_u_f32(a, b), cmp(a, a))

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22214>

19 months agodocs: add a few vulkan extensions supported by multiple drivers
Charlie Birks [Thu, 17 Jun 2021 11:23:29 +0000 (11:23 +0000)]
docs: add a few vulkan extensions supported by multiple drivers

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11445>

19 months agoradv/ci: Update ray tracing pipeline fail/skip lists
Konstantin Seurer [Thu, 2 Mar 2023 12:57:03 +0000 (13:57 +0100)]
radv/ci: Update ray tracing pipeline fail/skip lists

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

19 months agoradv: fix binding raytracing/compute pipelines
Samuel Pitoiset [Fri, 31 Mar 2023 11:32:59 +0000 (13:32 +0200)]
radv: fix binding raytracing/compute pipelines

If a compute pipeline is bound after a raytracing pipeline, the
computes shader slot (aka RT prolog) will be overwritten.

To fix this, move the RT prolog outside of the compute shader slot.

Fixes: d109362a3da ("radv: copy bound shaders to the cmdbuf state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235>

19 months agoradv: add the raygen shader BO to the cmdbuf list
Samuel Pitoiset [Fri, 31 Mar 2023 11:55:38 +0000 (13:55 +0200)]
radv: add the raygen shader BO to the cmdbuf list

Found by inspection.

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

19 months agoac/nir/ngg: Slightly improve attribute ring offset calculation.
Timur Kristóf [Thu, 30 Mar 2023 21:44:18 +0000 (23:44 +0200)]
ac/nir/ngg: Slightly improve attribute ring offset calculation.

Inspired by Nicolai Hähnle's commit in LLPC.
Instead of using a SALU instruction to add to the scalar
offset, rely on the buffer swizzling and use constant offset.

Fossil DB stats on GFX1100:

Totals from 47910 (35.51% of 134913) affected shaders:
CodeSize: 87927612 -> 86968136 (-1.09%)
Instrs: 17584007 -> 17440094 (-0.82%)
Latency: 97232173 -> 97126311 (-0.11%)
InvThroughput: 9904586 -> 9905288 (+0.01%); split: -0.02%, +0.02%
VClause: 544430 -> 542566 (-0.34%)

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

19 months agoradv: Use radv_get_shader to get vertex shader when binding pipeline.
Timur Kristóf [Fri, 31 Mar 2023 03:05:36 +0000 (05:05 +0200)]
radv: Use radv_get_shader to get vertex shader when binding pipeline.

The shaders[MESA_SHADER_VERTEX] can be NULL for merged shaders.

Fixes: b2ac40e734194fcb571a72396b5644b1d351e48a
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8749
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22229>

19 months agoradv: configure PA_SC_MODE_CNTL_1 during cmdbuf recording
Samuel Pitoiset [Thu, 30 Mar 2023 15:08:27 +0000 (17:08 +0200)]
radv: configure PA_SC_MODE_CNTL_1 during cmdbuf recording

Two graphics pipeline parameters need to be copied to the cmdbuf
state.

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

19 months agoradv: set PS_ITER_SAMPLE(1) for sample shading during cmdbuf recording
Samuel Pitoiset [Thu, 30 Mar 2023 15:40:28 +0000 (17:40 +0200)]
radv: set PS_ITER_SAMPLE(1) for sample shading during cmdbuf recording

This shouldn't be configured in the pipeline.

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

19 months agoradv: copy db_render_control to the cmdbuf state
Samuel Pitoiset [Thu, 30 Mar 2023 12:06:14 +0000 (14:06 +0200)]
radv: copy db_render_control to the cmdbuf state

This register is only used for meta operations.

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

19 months agoiris: Implement Xe version of bo_madvise() and bo_set_caching()
José Roberto de Souza [Tue, 14 Feb 2023 19:54:16 +0000 (11:54 -0800)]
iris: Implement Xe version of bo_madvise() and bo_set_caching()

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>

19 months agoiris: Place scanout buffers only into lmem for discrete GPUs
Maarten Lankhorst [Thu, 15 Dec 2022 17:48:13 +0000 (18:48 +0100)]
iris: Place scanout buffers only into lmem for discrete GPUs

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>

19 months agoiris: Handle allocation of scanout buffers in Xe
José Roberto de Souza [Tue, 14 Feb 2023 19:58:34 +0000 (11:58 -0800)]
iris: Handle allocation of scanout buffers in Xe

Bos that will be scanout in display need to be allocated with
flags = XE_GEM_CREATE_FLAG_SCANOUT in Xe and that implies to different
caching rules for this buffer.

So here not allowing to get scanout buffer from cache or allow it
to be placed in a cache bucket for reuse.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>

19 months agoiris: Handle allocation of exported buffers in Xe kmd
José Roberto de Souza [Tue, 14 Feb 2023 19:49:17 +0000 (11:49 -0800)]
iris: Handle allocation of exported buffers in Xe kmd

Bos that will be exported need to be allocated with vm_id = 0 in Xe,
so don't try to get a bo from cache that was allocated with a
valid vm_id.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>