platform/upstream/mesa.git
19 months agovulkan: add hepler for vkGetPhysicalDeviceFeatures2
Constantine Shablya [Wed, 15 Mar 2023 15:44:46 +0000 (17:44 +0200)]
vulkan: add hepler for vkGetPhysicalDeviceFeatures2

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

19 months agovulkan: delete trailing namespace
Constantine Shablya [Wed, 15 Mar 2023 15:45:58 +0000 (17:45 +0200)]
vulkan: delete trailing namespace

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

19 months agovulkan: tidy up vk_physical_device_features
Constantine Shablya [Wed, 15 Mar 2023 15:38:51 +0000 (17:38 +0200)]
vulkan: tidy up vk_physical_device_features

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

19 months agovulkan: relocate rmv to its correct home
Constantine Shablya [Wed, 15 Mar 2023 14:03:49 +0000 (16:03 +0200)]
vulkan: relocate rmv to its correct home

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

19 months agoradeonsi: monolithic TCS emit tessfactor in nir directly
Qiang Yu [Tue, 14 Feb 2023 04:01:46 +0000 (12:01 +0800)]
radeonsi: monolithic TCS emit tessfactor 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/21437>

19 months agoradeonsi: lower nir_load_ring_tess_factors_offset_amd
Qiang Yu [Tue, 14 Feb 2023 07:54:48 +0000 (15:54 +0800)]
radeonsi: lower nir_load_ring_tess_factors_offset_amd

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

19 months agoac/llvm,radeonsi: lower nir_load_ring_tess_factors_amd
Qiang Yu [Tue, 14 Feb 2023 07:26:56 +0000 (15:26 +0800)]
ac/llvm,radeonsi: lower nir_load_ring_tess_factors_amd

No one implement this intrinsic in llvm, so remove the
llvm entry too.

This will be used in TCS nir tess factor write.

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

19 months agoac/nir: handle tess factor output missing case
Qiang Yu [Tue, 14 Mar 2023 07:01:19 +0000 (15:01 +0800)]
ac/nir: handle tess factor output missing case

tcs_tess_lvl_(in|out)_loc may be not set if user miss tess
factor output.

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

19 months agoac/nir: init tess factor location with IO remap
Qiang Yu [Wed, 15 Feb 2023 11:21:55 +0000 (19:21 +0800)]
ac/nir: init tess factor location with IO remap

Radeonsi is going to use nir tess factor write, so need to
remap tess factor location.

RADV set tess factor driver location to be 0 and 1 in
get_linked_variable_location(). While radeonsi also set them
to be 0 and 1 in st->map_io aka. si_shader_io_get_unique_index_patch().

We could just set them to be 0 and 1 at the beginning of
ac_nir_lower_hs_outputs_to_mem(), but in order to keep the
location map at the same place, we still do this in
lower_hs_output_store().

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

19 months agoac/nir: tcs write tess factor support pass by reg
Qiang Yu [Tue, 14 Feb 2023 02:48:18 +0000 (10:48 +0800)]
ac/nir: tcs write tess factor support pass by reg

For radeonsi usage.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>

19 months agoac/nir: move store_var_components to common place
Qiang Yu [Tue, 14 Feb 2023 02:19:44 +0000 (10:19 +0800)]
ac/nir: move store_var_components to common place

It will be shared by other nir lowering too.

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

19 months agopanfrost: Don't round up Midgard polygon list BOs
Alyssa Rosenzweig [Mon, 31 Oct 2022 01:37:51 +0000 (21:37 -0400)]
panfrost: Don't round up Midgard polygon list BOs

Rounding up the polygon list BO can waste large amounts of memory. In a common
case I observed, it rounded up 11MB to 16MB, wasting 5MB. That adds up quickly
across processes, especially on the 2GB machines.

This only applies to Midgard. On Bifrost and newer, the driver does not
explicitly allocate this data structure. Cc stable because this rounding is
incorrect and the increase in RAM usage can cause real problems (especially
given how slow the shrinker is).

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

19 months agoglsl: allow 64-bit integer on RHS of shift
Timothy Arceri [Wed, 15 Mar 2023 04:18:46 +0000 (15:18 +1100)]
glsl: allow 64-bit integer on RHS of shift

Fixes: 9ba9a7f854dd ("glsl: Add 64-bit integer support to some operations.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6862

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

19 months agoaco: remove aco::rt_stack variable
Daniel Schürmann [Tue, 14 Mar 2023 23:14:07 +0000 (00:14 +0100)]
aco: remove aco::rt_stack variable

Since we initialize scratch in the RT proglog,
there is no need for this variable anymore.

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

19 months agoradv/rt: use prolog for raytracing shaders
Daniel Schürmann [Tue, 21 Feb 2023 16:37:04 +0000 (17:37 +0100)]
radv/rt: use prolog for raytracing shaders

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>

19 months agoradv/rt: Add shader config combination/postprocessing utils
Friedrich Vock [Tue, 7 Mar 2023 20:28:16 +0000 (21:28 +0100)]
radv/rt: Add shader config combination/postprocessing utils

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

19 months agoradv: Emit RT shader VA user SGPR
Friedrich Vock [Tue, 7 Mar 2023 17:21:45 +0000 (18:21 +0100)]
radv: Emit RT shader VA user SGPR

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

19 months agoradv: compile rt_prolog
Daniel Schürmann [Tue, 21 Feb 2023 14:02:31 +0000 (15:02 +0100)]
radv: compile rt_prolog

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

19 months agoradv: add radv_create_rt_prolog()
Daniel Schürmann [Tue, 21 Feb 2023 13:21:39 +0000 (14:21 +0100)]
radv: add radv_create_rt_prolog()

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>

19 months agoaco: implement select_rt_prolog()
Daniel Schürmann [Thu, 26 Jan 2023 14:58:01 +0000 (15:58 +0100)]
aco: implement select_rt_prolog()

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>

19 months agoaco: create hw_init_scratch() function for p_init_scratch lowering
Daniel Schürmann [Thu, 9 Mar 2023 19:50:06 +0000 (20:50 +0100)]
aco: create hw_init_scratch() function for p_init_scratch lowering

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

19 months agoaco: implement load_ray_launch_{id|size}
Daniel Schürmann [Tue, 21 Feb 2023 16:12:24 +0000 (17:12 +0100)]
aco: implement load_ray_launch_{id|size}

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

19 months agoaco: move rt_dynamic_callable_stack_base_amd to VGPR
Daniel Schürmann [Fri, 10 Mar 2023 12:14:01 +0000 (13:14 +0100)]
aco: move rt_dynamic_callable_stack_base_amd to VGPR

In future, we will use a VGPR arg for that between RT stages.

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

19 months agoaco: don't set private_segment_buffer/scratch_offset on GFX9+
Daniel Schürmann [Tue, 21 Feb 2023 16:54:19 +0000 (17:54 +0100)]
aco: don't set private_segment_buffer/scratch_offset on GFX9+

It is unused. Also don't initialize scratch in raytracing stages as it gets
initialized in the prolog shader.

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>

19 months agoaco: add RT stage enums
Daniel Schürmann [Fri, 13 May 2022 10:06:49 +0000 (12:06 +0200)]
aco: add RT stage enums

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

19 months agoradv: add RT shader handling to radv_postprocess_config
Daniel Schürmann [Mon, 12 Sep 2022 13:57:05 +0000 (15:57 +0200)]
radv: add RT shader handling to radv_postprocess_config

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

19 months agoradv: add RT stages to radv_get_shader_name()
Daniel Schürmann [Fri, 13 May 2022 10:08:03 +0000 (12:08 +0200)]
radv: add RT stages to radv_get_shader_name()

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

19 months agoradv: handle RT stages in radv_nir_shader_info_pass()
Daniel Schürmann [Fri, 13 May 2022 14:10:01 +0000 (16:10 +0200)]
radv: handle RT stages in radv_nir_shader_info_pass()

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

19 months agoradv: add RT shader args
Daniel Schürmann [Tue, 21 Feb 2023 12:17:29 +0000 (13:17 +0100)]
radv: add RT shader args

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>

19 months agomesa: add gl_shader_stage_is_rt()
Daniel Schürmann [Fri, 13 May 2022 14:06:21 +0000 (16:06 +0200)]
mesa: add gl_shader_stage_is_rt()

to indicate raytracing shader stages.

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

19 months agodriconf: Work around incorrect GI discard/invalidate
Rob Clark [Tue, 14 Mar 2023 23:09:25 +0000 (16:09 -0700)]
driconf: Work around incorrect GI discard/invalidate

Genshin Impact does a depth+stencil invalidate (or discard, not sure
which entrypoint they are using) and then proceeds to do draws with
depth test enabled.  For IMRs (or freedreno in sysmem mode) this is no
problem.  But for tilers that use this as a hint that they can skip the
z/s tile load, it is.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

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

19 months agodriconf: Add ignore_discard_framebuffer option
Rob Clark [Tue, 14 Mar 2023 23:07:43 +0000 (16:07 -0700)]
driconf: Add ignore_discard_framebuffer option

Some apps use glDiscardFramebuffer()/glInvalidateFramebuffer() when they
only kidding.  Add a knob to disable that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

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

19 months agomesa: Rework discard_framebuffer()
Rob Clark [Wed, 15 Mar 2023 14:54:23 +0000 (07:54 -0700)]
mesa: Rework discard_framebuffer()

Decouple the logic turning API attachment enums into gl_buffer_index.
This will make it easier to re-use discard_attachments() internally (See
!21910)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

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

19 months agoaco_validate: allow for wave32 in p_dual_src_export_gfx11
Lynne [Wed, 15 Mar 2023 18:17:22 +0000 (19:17 +0100)]
aco_validate: allow for wave32 in p_dual_src_export_gfx11

Fixes RADV_PERFTEST=pswave32

Fixes: bb90d29660b ("aco: add p_dual_src_export_gfx11 for dual source blending on GFX11")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21934>

19 months agointel: use generated helpers for Wa_1409433168/Wa_16011107343
Mark Janes [Tue, 14 Mar 2023 22:02:40 +0000 (15:02 -0700)]
intel: use generated helpers for Wa_1409433168/Wa_16011107343

HSD 1306463417 is a hardware defect.  The originating software
workaround for the issue is Wa_1409433168.  Convert all references to
the software workaround number, and use generated helpers instead of
GFX comparisons.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21914>

19 months agoci/turnip: Move some more of the 1.3.5 new xfails under links.
Emma Anholt [Wed, 15 Mar 2023 18:51:26 +0000 (11:51 -0700)]
ci/turnip: Move some more of the 1.3.5 new xfails under links.

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

19 months agoci/turnip: Disable dEQP-VK.image.queue_transfer.* for now.
Emma Anholt [Wed, 15 Mar 2023 18:48:39 +0000 (11:48 -0700)]
ci/turnip: Disable dEQP-VK.image.queue_transfer.* for now.

We're waiting on the upstream CTS fix to land.  Until then, quiet the spam
in #freedreno-ci to see if we have any other flakes we need to be managing
right now.

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

19 months agoci/turnip: Clear out stale xfails.
Emma Anholt [Wed, 15 Mar 2023 16:51:47 +0000 (09:51 -0700)]
ci/turnip: Clear out stale xfails.

These were all fixed in the CTS, but missed from removal due to fractional runs.

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

19 months agoturnip: Don't push inline uniform buffer contents outside constlen.
Emma Anholt [Tue, 14 Mar 2023 23:02:03 +0000 (16:02 -0700)]
turnip: Don't push inline uniform buffer contents outside constlen.

This would apparently lead to trying to load from this inline uniform
buffer in later submits.

Fixes: 37cde2c63483 ("tu: Rewrite inline uniform implementation")
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8219
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>

19 months agoaux/trace: delete GALLIUM_TRACE_NIR log message
Mike Blumenkrantz [Tue, 28 Feb 2023 22:16:40 +0000 (17:16 -0500)]
aux/trace: delete GALLIUM_TRACE_NIR log message

this is not only annoying, it breaks trace xml output

cc: mesa-stable

Acked-by: Simon Zeni <simon@bl4ckb0ne.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21609>

19 months agoanv: Handle external objects allocation in Xe
José Roberto de Souza [Fri, 10 Feb 2023 16:01:59 +0000 (08:01 -0800)]
anv: Handle external objects allocation in Xe

External(imported or exported) objects needs to have vm_id set to 0.

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

19 months agoanv: Properly alloc buffers that will be promoted to framebuffer in Xe KMD
José Roberto de Souza [Fri, 3 Mar 2023 19:03:18 +0000 (11:03 -0800)]
anv: Properly alloc buffers that will be promoted to framebuffer in Xe KMD

Xe KMD does a special caching handling for buffers that will be
scanout to display, so that is why it needs a flag set during
allocation.

Checking if VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA
is available in AllocateMemory() and marking the buffer as scanout.

All WSI code paths but one sets
VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA.
The only one that doesn't requires that WSI is initialize with
wsi_device_options.sw_device = true to be executed, what is not the
case for ANV.

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

19 months agoanv: Implement Xe version of anv_physical_device_get_parameters()
José Roberto de Souza [Thu, 9 Feb 2023 18:09:16 +0000 (10:09 -0800)]
anv: Implement Xe version of anv_physical_device_get_parameters()

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

19 months agozink: fix `final_hash` update in `zink_gfx_program_update`
antonino [Wed, 15 Mar 2023 12:09:34 +0000 (13:09 +0100)]
zink: fix `final_hash` update in `zink_gfx_program_update`

The logic that updates `ctx->gfx_pipeline_state.final_hash` assumed that
the program is replaced. It is supposed to xor `final_hash` with the
hash first and then with the new hash however when the program is
updated it end up xor-ing the new hash twice so it does nothing.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: 15450d2c2e2 ("zink: incrementally hash all pipeline component hashes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21925>

19 months agozink: Add driver name and API version to renderer name
SoroushIMG [Wed, 15 Mar 2023 12:11:04 +0000 (12:11 +0000)]
zink: Add driver name and API version to renderer name

Having driver name in the renderer will be useful to differentiate
between open source and proprietary drivers as they can have different
feature sets/quirks.

Vulkan API version is also added to the name to match up with ANGLE.

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

19 months agozink: fix copy box merging adjacency
Mike Blumenkrantz [Wed, 15 Mar 2023 12:09:05 +0000 (08:09 -0400)]
zink: fix copy box merging adjacency

these cases need to increase the box size, not just adjust the offset

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

19 months agozink: fix copy box iteration when adding
Mike Blumenkrantz [Wed, 15 Mar 2023 12:08:42 +0000 (08:08 -0400)]
zink: fix copy box iteration when adding

need to use the iterator, not the base pointer

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

19 months agoaco, radv: Remove VS IO information from ACO.
Timur Kristóf [Thu, 2 Feb 2023 17:06:16 +0000 (18:06 +0100)]
aco, radv: Remove VS IO information from ACO.

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

19 months agoac/llvm: Remove unused function ac_build_struct_tbuffer_load.
Timur Kristóf [Mon, 13 Feb 2023 10:35:02 +0000 (11:35 +0100)]
ac/llvm: Remove unused function ac_build_struct_tbuffer_load.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>

19 months agoradv: Remove VS inputs code from LLVM backend.
Timur Kristóf [Fri, 10 Feb 2023 22:48:33 +0000 (23:48 +0100)]
radv: Remove VS inputs code from LLVM backend.

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

19 months agoaco: Rename visit_load_input to visit_load_fs_input.
Timur Kristóf [Thu, 2 Feb 2023 16:57:25 +0000 (17:57 +0100)]
aco: Rename visit_load_input to visit_load_fs_input.

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

19 months agoaco: Remove VS inputs from visit_load_input.
Timur Kristóf [Thu, 2 Feb 2023 16:55:06 +0000 (17:55 +0100)]
aco: Remove VS inputs from visit_load_input.

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

19 months agoradv: Apply swizzle and alpha adjust in radv_nir_lower_vs_inputs.
Timur Kristóf [Mon, 6 Mar 2023 20:29:28 +0000 (12:29 -0800)]
radv: Apply swizzle and alpha adjust in radv_nir_lower_vs_inputs.

Deal with VS input related things in a single pass instead of
having two different passes.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 174 (0.13% of 134913) affected shaders:
VGPRs: 7736 -> 7520 (-2.79%)
CodeSize: 354004 -> 353604 (-0.11%); split: -0.17%, +0.06%
MaxWaves: 4196 -> 4248 (+1.24%)
Instrs: 65228 -> 65139 (-0.14%); split: -0.19%, +0.06%
Latency: 265823 -> 265728 (-0.04%); split: -0.12%, +0.08%
InvThroughput: 84629 -> 84644 (+0.02%); split: -0.08%, +0.10%
VClause: 1618 -> 1606 (-0.74%); split: -0.93%, +0.19%
SClause: 1382 -> 1379 (-0.22%); split: -0.36%, +0.14%
Copies: 5586 -> 5566 (-0.36%); split: -0.55%, +0.20%
PreSGPRs: 4994 -> 5037 (+0.86%); split: -0.10%, +0.96%
PreVGPRs: 4948 -> 4955 (+0.14%); split: -0.04%, +0.18%

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

19 months agoradv: Lower non-dynamic VS inputs in NIR.
Timur Kristóf [Fri, 10 Feb 2023 07:37:06 +0000 (08:37 +0100)]
radv: Lower non-dynamic VS inputs in NIR.

Add a new RADV specific NIR pass which lowers VS input
loads to AMD specific buffer load instructions.
We do this because we want to remove the RADV specific
VS input handling from the shader compiler back-ends.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 32507 (24.09% of 134913) affected shaders:
VGPRs: 1245512 -> 1245344 (-0.01%); split: -0.35%, +0.34%
SpillSGPRs: 1068 -> 1102 (+3.18%)
CodeSize: 90333192 -> 90327232 (-0.01%); split: -0.07%, +0.06%
MaxWaves: 881816 -> 881388 (-0.05%); split: +0.23%, -0.28%
Instrs: 17264710 -> 17264562 (-0.00%); split: -0.09%, +0.09%
Latency: 87300501 -> 86586480 (-0.82%); split: -1.07%, +0.25%
InvThroughput: 13700046 -> 13685931 (-0.10%); split: -0.20%, +0.10%
VClause: 361520 -> 361301 (-0.06%); split: -1.32%, +1.26%
SClause: 441018 -> 441505 (+0.11%); split: -0.54%, +0.65%
Copies: 1371477 -> 1373838 (+0.17%); split: -0.57%, +0.75%
Branches: 496639 -> 496611 (-0.01%); split: -0.01%, +0.00%
PreSGPRs: 1122956 -> 1122663 (-0.03%); split: -0.09%, +0.06%
PreVGPRs: 976051 -> 995717 (+2.01%); split: -0.12%, +2.14%

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

19 months agoac/llvm: Implement typed buffer load intrinsic.
Timur Kristóf [Fri, 10 Feb 2023 22:44:05 +0000 (23:44 +0100)]
ac/llvm: Implement typed buffer load intrinsic.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>

19 months agoaco: Implement load_typed_buffer_amd.
Timur Kristóf [Fri, 3 Feb 2023 00:03:22 +0000 (01:03 +0100)]
aco: Implement load_typed_buffer_amd.

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

19 months agonir: Add load_typed_buffer_amd intrinsic.
Timur Kristóf [Thu, 2 Feb 2023 09:47:58 +0000 (10:47 +0100)]
nir: Add load_typed_buffer_amd intrinsic.

This new intrinsic maps to the MTBUF instruction format on AMD GPUs
and represents a typed buffer load in NIR.

Also add an unsigned upper bound for the new intrinsic.
Code for that ported from aco_instruction_selection_setup.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@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/16805>

19 months agoaco: Remove vtx_binding from MUBUF/MTBUF instructions.
Timur Kristóf [Fri, 3 Mar 2023 01:09:14 +0000 (17:09 -0800)]
aco: Remove vtx_binding from MUBUF/MTBUF instructions.

We haven't measured any noteworthy perf improvement
from these, and they are difficult to port to NIR,
so remove them before the NIR based VS input lowering
in order to make it easier to bisect and analyze stats.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 21750 (16.12% of 134913) affected shaders:
VGPRs: 868512 -> 868664 (+0.02%); split: -0.00%, +0.02%
CodeSize: 64406804 -> 64397572 (-0.01%); split: -0.08%, +0.07%
MaxWaves: 567904 -> 567888 (-0.00%); split: +0.00%, -0.00%
Instrs: 12327212 -> 12324851 (-0.02%); split: -0.10%, +0.08%
Latency: 61367324 -> 61371204 (+0.01%); split: -0.04%, +0.05%
InvThroughput: 9687734 -> 9686000 (-0.02%); split: -0.03%, +0.01%
VClause: 248207 -> 303449 (+22.26%); split: -0.02%, +22.28%
SClause: 314942 -> 315564 (+0.20%); split: -0.09%, +0.29%
Copies: 921581 -> 921820 (+0.03%); split: -0.16%, +0.19%
Branches: 341964 -> 341967 (+0.00%); split: -0.00%, +0.00%

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

19 months agoradeonsi: correct an assertion if we get a display list with no vertex buffers
Marek Olšák [Mon, 13 Mar 2023 06:21:29 +0000 (02:21 -0400)]
radeonsi: correct an assertion if we get a display list with no vertex buffers

It's possible to get a display list with no vertex buffers if the linker
eliminates all VS inputs or if the list was built with glArrayElement with
no enabled attribs.

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

19 months agoradeonsi: don't use fp16_rtz for FP formats in the compute blit
Marek Olšák [Mon, 7 Nov 2022 04:46:47 +0000 (23:46 -0500)]
radeonsi: don't use fp16_rtz for FP formats in the compute blit

It doesn't change the test results.

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

19 months agoradeonsi: don't convert to fp16 in the compute blit if not testing
Marek Olšák [Mon, 7 Nov 2022 02:42:38 +0000 (21:42 -0500)]
radeonsi: don't convert to fp16 in the compute blit if not testing

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

19 months agoradeonsi: fix AMD_TEST=computeblit being rejected on gfx < 11
Marek Olšák [Mon, 7 Nov 2022 02:35:37 +0000 (21:35 -0500)]
radeonsi: fix AMD_TEST=computeblit being rejected on gfx < 11

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

19 months agoradeonsi: don't print the base non-view texture format for AMD_TEST=computeblit
Marek Olšák [Mon, 7 Nov 2022 02:44:06 +0000 (21:44 -0500)]
radeonsi: don't print the base non-view texture format for AMD_TEST=computeblit

it's confusing in the output and it affects nothing

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

19 months agoradeonsi: add AMD_DEBUG=nowcstream to enable caching for stream_uploader
Marek Olšák [Sun, 12 Mar 2023 22:13:31 +0000 (18:13 -0400)]
radeonsi: add AMD_DEBUG=nowcstream to enable caching for stream_uploader

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

19 months agoradeonsi: rework MSAA resolve averaging to exploit instruction-level parallelism
Marek Olšák [Mon, 6 Mar 2023 18:28:42 +0000 (13:28 -0500)]
radeonsi: rework MSAA resolve averaging to exploit instruction-level parallelism

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

19 months agoradeonsi: remove duplicated gfx11 check in si_msaa_resolve_blit_via_CB
Marek Olšák [Mon, 6 Mar 2023 18:36:25 +0000 (13:36 -0500)]
radeonsi: remove duplicated gfx11 check in si_msaa_resolve_blit_via_CB

The function really does that twice. You'll find the same code a few lines
above this change.

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

19 months agoradeonsi: replace nonir,noir,noasm,preoptir options with new reworked options
Marek Olšák [Sat, 11 Mar 2023 02:55:08 +0000 (21:55 -0500)]
radeonsi: replace nonir,noir,noasm,preoptir options with new reworked options

New options depending on what you want to print:
- initnir  = initial NIR of shader CSOs
- nir      = final NIR of variants after all lowering
- initllvm = LLVM IR before optimizations
- llvm     = final LLVM IR
- asm      = asm

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

19 months agoradeonsi: dump shader stats only if dumping asm shaders
Marek Olšák [Sat, 11 Mar 2023 02:53:28 +0000 (21:53 -0500)]
radeonsi: dump shader stats only if dumping asm shaders

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

19 months agoradeonsi: remove unused TCS/TES SGPR fields
Marek Olšák [Sat, 11 Mar 2023 01:48:21 +0000 (20:48 -0500)]
radeonsi: remove unused TCS/TES SGPR fields

We stopped using them when we switched to ac_nir_lower_hs_outputs_to_mem.

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

19 months agoradv: set RADEON_SURF_NO_TEXTURE flag in radv_get_surface_flags()
Yogesh Mohan Marimuthu [Tue, 21 Feb 2023 10:26:35 +0000 (15:56 +0530)]
radv: set RADEON_SURF_NO_TEXTURE flag in radv_get_surface_flags()

In vkCreateImage() if block comrpessed format and VK_IMAGE_TILING_LINEAR is
used, then the app crashes in vega gpu.

This is because addrlib does not support BC + linear as from function
ValidateSwModeParams(). From Marek Olšák the addrlib behaviour is correct.

In pal driver, flags.texture is not set in DetermineSurfaceFlags() function
if BC + linear. pal driver does it because it is expected that the
BC + linear image is only used as transfer resource.

This patch sets RADEON_SURF_NO_TEXTURE flag if usage is not
VK_IMAGE_USAGE_SAMPLED_BIT and and VK_IMAGE_USAGE_STORAGE_BIT.
flags.texture flag is not set if RADEON_SURF_NO_TEXTURE and this fixes
the crash.

v1: set NO_TEXTURE if not SAMPLED or STORAGE (Marek Olšák)

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

19 months agoamd/surface: add RADEON_SURF_NO_TEXTURE flag
Yogesh Mohan Marimuthu [Tue, 21 Feb 2023 09:27:49 +0000 (14:57 +0530)]
amd/surface: add RADEON_SURF_NO_TEXTURE flag

Block compressed + linear format is not supported in addrlib. But these
surface can be used as transfer resource. RADEON_SURF_NO_TEXTURE flag
indicates not to set flags.texture flag in gfx9_compute_surface().

This will help to fix the vkCreateImage() crash where block
compressed + linear format image is requested.

v2: combine RADEON_SURF_NO_TEXTURE to below line (Marek Olšák)
v1: add RADEON_SURF_NO_TEXTURE flag (Marek Olšák)

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

19 months agoanv: break out of the loop when the first color attachment is found
Rohan Garg [Tue, 14 Mar 2023 10:12:06 +0000 (11:12 +0100)]
anv: break out of the loop when the first color attachment is found

Fixes: 2bd304bc ("anv: Skip the RT flush when doing depth-only rendering")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21903>

19 months agovbo: fix current attribs not updating gallium vertex elements
Marek Olšák [Thu, 9 Mar 2023 02:59:35 +0000 (21:59 -0500)]
vbo: fix current attribs not updating gallium vertex elements

An initial workaround that helped discover this was written by:
Illia Polishchuk illia.a.polishchuk@globallogic.com

Closes: #8440
Fixes: a18b9d07 ("st/mesa: optimize uploading zero-stride vertex attribs")

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

19 months agoasahi: Fix occlusion query lifetime
Alyssa Rosenzweig [Sat, 11 Mar 2023 21:19:43 +0000 (16:19 -0500)]
asahi: Fix occlusion query lifetime

Theoretical lifetime issue, now easy to hit with the batch sync changes. Fixes
memory badness.

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

19 months agoci/iris: Add skips for slow tests on APL.
Emma Anholt [Mon, 13 Mar 2023 16:58:39 +0000 (09:58 -0700)]
ci/iris: Add skips for slow tests on APL.

These get reported as flakes for timing out before passing when the shader
cache is hot.

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

19 months agoci/turnip: Extend a630 vk full timeout to 3 hours.
Emma Anholt [Wed, 8 Mar 2023 19:42:05 +0000 (11:42 -0800)]
ci/turnip: Extend a630 vk full timeout to 3 hours.

With the CTS coverage and tu featureset extending, these jobs have been
reliably timing out for a while.  I've updated the xfails based on a
single run, we'll see how that goes in the upcoming nightlies.

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

19 months agoci/zink: Update TGL xfails/flakes based on the last nightly pipelines.
Emma Anholt [Wed, 8 Mar 2023 19:37:15 +0000 (11:37 -0800)]
ci/zink: Update TGL xfails/flakes based on the last nightly pipelines.

The 2f8073f87cb95c21db1f6c39d95ffd4d021c93e3 fix changed some results, qbo
changed a week or so ago, and spec@ext_texture_array@compressed
texsubimage pbo has been crashing for a long time.

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

19 months agoradeonsi: fix memory leak related to ureg_get_tokens()
Patrick Lerda [Wed, 8 Mar 2023 16:20:22 +0000 (17:20 +0100)]
radeonsi: fix memory leak related to ureg_get_tokens()

Indeed, ureg_get_tokens() returns an allocated string that should be
freed using ureg_free_tokens().

For instance, with "piglit/bin/arb_shader_image_load_store-invalid -auto -fbo"
Direct leak of 768 byte(s) in 2 object(s) allocated from:
    #0 0x7fa819a78b48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7fa80e189e04 in tokens_expand ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:239
    #2 0x7fa80e189e04 in get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:262
    #3 0x7fa80e191f6e in copy_instructions ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2079
    #4 0x7fa80e191f6e in ureg_finalize ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2129
    #5 0x7fa80e19447b in ureg_get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2206
    #6 0x7fa80ec68b91 in si_create_fmask_expand_cs ../src/gallium/drivers/radeonsi/si_shaderlib_tgsi.c:564

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21871>

19 months agoradv/trace: don't attempt to emit trace on non-graphics/compute queues
Dave Airlie [Tue, 14 Mar 2023 04:12:49 +0000 (14:12 +1000)]
radv/trace: don't attempt to emit trace on non-graphics/compute queues

This will just break on video queues

Fixes: 9477f117f4d4 ("radv/video: add initial frameworking.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>

19 months agoradv/video: fix h265 decoding sizes.
Dave Airlie [Thu, 9 Mar 2023 05:06:05 +0000 (15:06 +1000)]
radv/video: fix h265 decoding sizes.

Fixes the misrendering/hangs on hevc content.

Fixes: 6c3c242361da778 ("radv/video: add h265 decode UVD support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>

19 months agoradv/video: fix used for reference flags.
Dave Airlie [Fri, 3 Mar 2023 04:26:05 +0000 (14:26 +1000)]
radv/video: fix used for reference flags.

These weren't getting programmed properly for interlaced videos

Fixes: 3e2c768aa860 ("radv/vcn: enable dynamic dpb tier 2 for h264/h265 on navi21+")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>

19 months agoradv/video: fix h264 frame heights when field images are in use
Dave Airlie [Fri, 3 Mar 2023 02:57:16 +0000 (12:57 +1000)]
radv/video: fix h264 frame heights when field images are in use

This was breaking MBAFF decoding.

Fixes: 8a29291dbe6c ("radv/video: add h264 support for uvd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671>

19 months agoci: Update trace expectations for GLSL constant prop removal.
Emma Anholt [Tue, 7 Mar 2023 17:10:18 +0000 (09:10 -0800)]
ci: Update trace expectations for GLSL constant prop removal.

Somewhere along the way there were minor pixel value changes.

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

19 months agoglsl: Delete constant-variables pass.
Emma Anholt [Fri, 3 Mar 2023 00:02:17 +0000 (16:02 -0800)]
glsl: Delete constant-variables pass.

Now that we don't do GLSL IR constant propagation or constant folding, we
can leave constant variable detection and handling to NIR.  This also
avoids some OOB array access in GLSL IR in a piglit test!

Freedreno stats again look like noise:

total instructions in shared programs: 2718412 -> 2718746 (0.01%)
instructions in affected programs: 80497 -> 80831 (0.41%)
total last-baryf in shared programs: 110015 -> 110510 (0.45%)
last-baryf in affected programs: 35263 -> 35758 (1.40%)
total full in shared programs: 189486 -> 189480 (<.01%)
full in affected programs: 52 -> 46 (-11.54%)
total constlen in shared programs: 494540 -> 494496 (<.01%)
constlen in affected programs: 452 -> 408 (-9.73%)
total sstall in shared programs: 198297 -> 197928 (-0.19%)
sstall in affected programs: 3691 -> 3322 (-10.00%)
total systall in shared programs: 432150 -> 431799 (-0.08%)
systall in affected programs: 6070 -> 5719 (-5.78%)
total waves in shared programs: 435098 -> 435110 (<.01%)
waves in affected programs: 92 -> 104 (13.04%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>

19 months agoglsl: Delete constant folding pass.
Emma Anholt [Thu, 2 Mar 2023 23:44:38 +0000 (15:44 -0800)]
glsl: Delete constant folding pass.

NIR is happy to take care of constant folding for us, and it's easier to
do in SSA.

This required adjusting of lower_precision unit tests to have un-folded
constants.

freedreno results look like noise.  Some excerpts:

total instructions in shared programs: 2718343 -> 2718412 (<.01%)
instructions in affected programs: 6847 -> 6916 (1.01%)
total last-baryf in shared programs: 109992 -> 110015 (0.02%)
last-baryf in affected programs: 117 -> 140 (19.66%)
total sstall in shared programs: 198312 -> 198297 (<.01%)
sstall in affected programs: 148 -> 133 (-10.14%)
total systall in shared programs: 432163 -> 432150 (<.01%)
systall in affected programs: 1016 -> 1003 (-1.28%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>

19 months agoglsl: Delete constant propagation pass.
Emma Anholt [Thu, 2 Mar 2023 23:40:20 +0000 (15:40 -0800)]
glsl: Delete constant propagation pass.

freedreno results look like noise.  Excerpts:

total instructions in shared programs: 2718355 -> 2718343 (<.01%)
instructions in affected programs: 2001 -> 1989 (-0.60%)
total last-baryf in shared programs: 109960 -> 109992 (0.03%)
last-baryf in affected programs: 789 -> 821 (4.06%)
total sstall in shared programs: 198273 -> 198312 (0.02%)
sstall in affected programs: 140 -> 179 (27.86%)
total systall in shared programs: 432224 -> 432163 (-0.01%)
systall in affected programs: 241 -> 180 (-25.31%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>

19 months agoglsl_to_nir: Use a variable's constant_value if it wasn't const-propped out.
Emma Anholt [Tue, 7 Mar 2023 00:26:14 +0000 (16:26 -0800)]
glsl_to_nir: Use a variable's constant_value if it wasn't const-propped out.

glsl has been constant-propagating out references to ir->constant_value
(the value of a variable declared as const), but we can get rid of that
whole pass if we just have glsl-to-nir hand the constant propagating
problem off to NIR.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>

19 months agoglsl/nir: Include early glsl-to-nir output in NIR_DEBUG=print.
Emma Anholt [Tue, 7 Mar 2023 00:15:16 +0000 (16:15 -0800)]
glsl/nir: Include early glsl-to-nir output in NIR_DEBUG=print.

These passes were missing the macros to handle debug output and extra
validation.  But also, for working on GLSL, it's nice to see the raw
output of glsl-to-nir before you move on.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>

19 months agoiris: Move iris_bufmgr_init_global_vm() to i915/iris_bufmgr.c and prepare for Xe KMD
José Roberto de Souza [Tue, 1 Nov 2022 15:31:16 +0000 (08:31 -0700)]
iris: Move iris_bufmgr_init_global_vm() to i915/iris_bufmgr.c and prepare for Xe KMD

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

19 months agoiris: Drop usage of i915 EXEC_OBJECT_WRITE
José Roberto de Souza [Wed, 7 Dec 2022 20:30:45 +0000 (12:30 -0800)]
iris: Drop usage of i915 EXEC_OBJECT_WRITE

The whole usage of this flag is to call iris_use_pinned_bo() with
writable argument, for that we don't need any i915_drm.h specific type.
IRIS_BLORP_RELOC_FLAGS_EXEC_OBJECT_WRITE could have any other value but
keeping the same as i915_drm.h.

With this we can drop 2 i915_drm.h imports from generic Iris code.

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

19 months agoiris: Drop I915_EXEC_FENCE types
José Roberto de Souza [Wed, 7 Dec 2022 20:11:03 +0000 (12:11 -0800)]
iris: Drop I915_EXEC_FENCE types

Those are i915_drm.h specific types and should not be in code paths
shared by i915 and Xe KMD.

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

19 months agoglthread: align small buffer uploads to 4 bytes
Mike Blumenkrantz [Mon, 13 Mar 2023 15:29:08 +0000 (11:29 -0400)]
glthread: align small buffer uploads to 4 bytes

some apps (e.g., supertuxkart) use a ton of 4 byte subdata calls, and
this halves their memory consumption

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

19 months agoanv: remove GetBufferMemoryRequirements2()
Mohamed Ahmed [Tue, 14 Mar 2023 12:13:54 +0000 (14:13 +0200)]
anv: remove GetBufferMemoryRequirements2()

Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>

19 months agovulkan/runtime: implement vkGetBufferMemoryRequirements2()
Mohamed Ahmed [Tue, 14 Mar 2023 12:12:16 +0000 (14:12 +0200)]
vulkan/runtime: implement vkGetBufferMemoryRequirements2()

Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>

19 months agovulkan/runtime: move common buffer related entrypoints to vk_buffer.c
Mohamed Ahmed [Tue, 14 Mar 2023 11:57:40 +0000 (13:57 +0200)]
vulkan/runtime: move common buffer related entrypoints to vk_buffer.c

Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>

19 months agoci: Allow to use crosvm-runner before deqp-runner
Corentin Noël [Fri, 3 Mar 2023 13:20:19 +0000 (14:20 +0100)]
ci: Allow to use crosvm-runner before deqp-runner

Since the addition of unified sections, many scripts need to be aware of the content
of the setup-test-env.sh file. The use of bash is also mandatory to have exports of
function declarations.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21900>

19 months agoci: Setup XDG_RUNTIME_DIR in crosvm-init
Corentin Noël [Tue, 14 Mar 2023 14:55:13 +0000 (15:55 +0100)]
ci: Setup XDG_RUNTIME_DIR in crosvm-init

This environment variable has to be set to use the wayland platform.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21900>

19 months agopanfrost: Note glDrawRangeElements underflow
Alyssa Rosenzweig [Tue, 14 Mar 2023 18:11:33 +0000 (14:11 -0400)]
panfrost: Note glDrawRangeElements underflow

Hopefully this helps someone wiring up robustness later on.

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

19 months agopanfrost/ci: Remove fbo-mrt-new-bind fail+flake
Alyssa Rosenzweig [Tue, 14 Mar 2023 03:15:35 +0000 (23:15 -0400)]
panfrost/ci: Remove fbo-mrt-new-bind fail+flake

Seems to pass reliably now.

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

19 months agopanfrost/ci: Add some Piglit skips
Alyssa Rosenzweig [Tue, 14 Mar 2023 00:48:53 +0000 (20:48 -0400)]
panfrost/ci: Add some Piglit skips

Skip heavyweight crashing tests that have the potential to take down not just
themselves but also other Piglit tests running concurrently via piglit-runner
(which would otherwise become piglit-runner level flakes).

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