platform/upstream/mesa.git
16 months agofreedreno: Account for multi-draw in num_draws
Rob Clark [Sun, 5 Feb 2023 19:36:54 +0000 (11:36 -0800)]
freedreno: Account for multi-draw in num_draws

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

16 months agoradv/rt: don't hash maxPipelineRayRecursionDepth
Daniel Schürmann [Tue, 14 Feb 2023 13:49:00 +0000 (14:49 +0100)]
radv/rt: don't hash maxPipelineRayRecursionDepth

The stack size has no effect on the generated shader anymore.

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

16 months agoradv/rt: use dynamic_callable_stack_base also for static stack_sizes
Daniel Schürmann [Tue, 14 Feb 2023 13:28:37 +0000 (14:28 +0100)]
radv/rt: use dynamic_callable_stack_base also for static stack_sizes

This patch also removes rt_pipeline->dynamic_stack_size and replaces
it by checking for rt_pipeline->stack_size == -1u.

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

16 months agoradv/rt: introduce and set rt_pipeline->stack_size
Daniel Schürmann [Tue, 14 Feb 2023 13:17:59 +0000 (14:17 +0100)]
radv/rt: introduce and set rt_pipeline->stack_size

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

16 months agoradv: unconditionally enable scratch for RT shaders
Daniel Schürmann [Wed, 8 Feb 2023 09:35:30 +0000 (10:35 +0100)]
radv: unconditionally enable scratch for RT shaders

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

16 months agoradv: rename shader_info->cs.uses_sbt -> shader_info->cs.is_rt_shader
Daniel Schürmann [Wed, 8 Feb 2023 09:28:54 +0000 (10:28 +0100)]
radv: rename shader_info->cs.uses_sbt -> shader_info->cs.is_rt_shader

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

16 months agoradv: Clean up dynamic RT stack allocation
Konstantin Seurer [Tue, 7 Feb 2023 16:39:56 +0000 (17:39 +0100)]
radv: Clean up dynamic RT stack allocation

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

16 months agozink: Add missing features to the profile file
Sidney Just [Wed, 25 Jan 2023 23:53:05 +0000 (15:53 -0800)]
zink: Add missing features to the profile file

Fixes: 2ea481b2f0a ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20920>

16 months agozink: add check for samplerMirrorClampToEdge Vulkan 1.2 feature
Sidney Just [Sat, 4 Feb 2023 00:41:29 +0000 (16:41 -0800)]
zink: add check for samplerMirrorClampToEdge Vulkan 1.2 feature

This adds a check to advertise PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE when either the extension is present or the Vulkan 1.2 feature is enabled.

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

16 months agohasvk: Fix SPIR-V warning about TF unsupported on gen7.
Emma Anholt [Thu, 9 Feb 2023 05:32:10 +0000 (21:32 -0800)]
hasvk: Fix SPIR-V warning about TF unsupported on gen7.

It's supported now.

Fixes: d82826ad4446 ("anv: Implement VK_EXT_transform_feedback on Gen7")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>

16 months agohasvk: Silence conformance warning in CI.
Emma Anholt [Thu, 9 Feb 2023 05:26:51 +0000 (21:26 -0800)]
hasvk: Silence conformance warning in CI.

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

16 months agoci: Add a manual full and 1/10th hasvk CTS runs.
Emma Anholt [Wed, 8 Feb 2023 20:14:55 +0000 (12:14 -0800)]
ci: Add a manual full and 1/10th hasvk CTS runs.

These are manual since they're on a runner in my basement that sometimes
can go down, but it'll be nice to have this for throwing the rare hasvk MR
at.

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

16 months agoci/tu: Add 1/200 pass to test for stale reg usage
Danylo Piliaiev [Wed, 15 Feb 2023 15:53:17 +0000 (16:53 +0100)]
ci/tu: Add 1/200 pass to test for stale reg usage

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>

16 months agodocs/freedreno: Add info about stale reg stomper dbg option
Danylo Piliaiev [Wed, 15 Feb 2023 13:37:33 +0000 (14:37 +0100)]
docs/freedreno: Add info about stale reg stomper dbg option

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>

16 months agoturnip: Add debug option to find usage of stale reg values
Danylo Piliaiev [Mon, 6 Feb 2023 19:50:41 +0000 (20:50 +0100)]
turnip: Add debug option to find usage of stale reg values

MESA_VK_ABORT_ON_DEVICE_LOSS=1 \
TU_DEBUG_STALE_REGS_RANGE=0x00000c00,0x0000be01 \
TU_DEBUG_STALE_REGS_FLAGS=cmdbuf,renderpass \
./app

To pinpoint the reg causing a failure reducing regs range could be
used for bisection. Some failures may be caused by multi-reg combination,
in such case set 'inverse' flag which would change the meaning of reg
range to "do not stomp these regs".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>

16 months agoaco: Remove MTBUF zero operand.
Timur Kristóf [Thu, 2 Feb 2023 23:32:06 +0000 (00:32 +0100)]
aco: Remove MTBUF zero operand.

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

16 months agoaco: Don't set scalar offset on buffer load instructions when it's zero.
Timur Kristóf [Fri, 3 Feb 2023 01:03:46 +0000 (02:03 +0100)]
aco: Don't set scalar offset on buffer load instructions when it's zero.

This helps generate slightly more optimal instructions.

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

16 months agointel/common: Move i915 files to i915 folder
José Roberto de Souza [Thu, 9 Feb 2023 17:32:37 +0000 (09:32 -0800)]
intel/common: Move i915 files to i915 folder

Following the organization done in intel/dev and intel/vulkan.

Probably due to some rebase issue we had a duplicated copyright header
in intel_gem_i915.h that is being removed in here too.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21256>

16 months agovl/dri3: avoid deadlocking when polling deleted windows for events
Mike Blumenkrantz [Wed, 15 Feb 2023 15:10:26 +0000 (10:10 -0500)]
vl/dri3: avoid deadlocking when polling deleted windows for events

upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>

16 months agovulkan/wsi: avoid deadlocking dri3 when polling deleted windows for events
Mike Blumenkrantz [Wed, 15 Feb 2023 15:10:26 +0000 (10:10 -0500)]
vulkan/wsi: avoid deadlocking dri3 when polling deleted windows for events

upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

fixes #6685

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>

16 months agodri3: avoid deadlocking when polling deleted windows for events
Mike Blumenkrantz [Wed, 15 Feb 2023 15:10:26 +0000 (10:10 -0500)]
dri3: avoid deadlocking when polling deleted windows for events

upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>

16 months agoaco: Get rid of redundant load_vmem_mubuf function.
Timur Kristóf [Thu, 2 Feb 2023 23:59:05 +0000 (00:59 +0100)]
aco: Get rid of redundant load_vmem_mubuf function.

Call emit_load directly from visit_load_buffer instead.

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

16 months agoradv: Move VS input lowering to new file: radv_nir_lower_vs_inputs.
Timur Kristóf [Fri, 10 Feb 2023 07:29:53 +0000 (08:29 +0100)]
radv: Move VS input lowering to new file: radv_nir_lower_vs_inputs.

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

16 months agoac/llvm: Change ac_build_tbuffer_load to take format and channel type.
Timur Kristóf [Mon, 13 Feb 2023 10:31:54 +0000 (11:31 +0100)]
ac/llvm: Change ac_build_tbuffer_load to take format and channel type.

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>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>

16 months agoac/llvm: Fix ac_build_buffer_load to work with more than 4 channels.
Timur Kristóf [Mon, 13 Feb 2023 11:14:04 +0000 (12:14 +0100)]
ac/llvm: Fix ac_build_buffer_load to work with more than 4 channels.

LLVM is unable to select instructions for num_channels > 4, so we
workaround that by manually splitting larger buffer loads.

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>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>

16 months agoac/llvm: Fix buffer_load_amd with larger than 32-bit channel sizes.
Timur Kristóf [Mon, 13 Feb 2023 09:56:37 +0000 (10:56 +0100)]
ac/llvm: Fix buffer_load_amd with larger than 32-bit channel sizes.

LLVM is unable to select instructions for larger than 32-bit channel types.
Workaround by using i32 and casting to the correct type later.

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>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>

16 months agoac/llvm: Remove "structurized" argument and instead check vindex.
Timur Kristóf [Sat, 11 Feb 2023 00:32:50 +0000 (01:32 +0100)]
ac/llvm: Remove "structurized" argument and instead check vindex.

Change ac_build_buffer_load_common and ac_build_tbuffer_load so
the use structurized load when the vindex argument is not NULL.
Adjust callers to match the new behaviour.

This fixes the load_buffer_amd intrinsic with index source.

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>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>

16 months agoac: Port ACO's get_fetch_format to ac_get_safe_fetch_size.
Timur Kristóf [Thu, 2 Feb 2023 16:10:25 +0000 (17:10 +0100)]
ac: Port ACO's get_fetch_format to ac_get_safe_fetch_size.

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

16 months agonir: Clarify comment above load_buffer_amd.
Timur Kristóf [Sun, 5 Feb 2023 16:52:23 +0000 (17:52 +0100)]
nir: Clarify comment above load_buffer_amd.

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>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>

16 months agomesa/st: refactor st_destroy_texcompress_compute condition
Tapani Pälli [Tue, 14 Feb 2023 12:22:09 +0000 (14:22 +0200)]
mesa/st: refactor st_destroy_texcompress_compute condition

What happened is that we did not call init but still called dtor, this
makes us do some unnecessary work.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21309>

16 months agov3dv: fix stencil view aspect selection of depth/stencil image
Iago Toral Quiroga [Thu, 16 Feb 2023 08:21:38 +0000 (09:21 +0100)]
v3dv: fix stencil view aspect selection of depth/stencil image

Instead of fixing the swizzle to X001, we should compose this
swizzle with the image view's own swizzle.

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

16 months agoci/lava: Fix LAVA logs issues for Collabora jobs
Guilherme Gallo [Wed, 15 Feb 2023 01:42:40 +0000 (22:42 -0300)]
ci/lava: Fix LAVA logs issues for Collabora jobs

Since the Collabora LAVA update related to the downtime from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21119, the
LAVA logs from Collabora continued to use the hack for older versions
which digested some control characters, such as carriage returns acting
as newlines, which made it necessary to recover from split lines to make
Gitlab sections work in job logs as expected.

Collabora's LAVA instance now gives a more raw log output. It is
necessary to pay attention to newlines at the end of each log message,
which may cause double newlines when printed with Python built-in
`print` function. I decided to remove the repeating `\n` from the
received log messages to make them transparent to LogFollower users.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8242

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>

16 months agoci/lava: Add LavaFarm class to find LAVA farm from runner tag
Guilherme Gallo [Wed, 15 Feb 2023 01:36:58 +0000 (22:36 -0300)]
ci/lava: Add LavaFarm class to find LAVA farm from runner tag

LavaFarm is a class created to handle the different types of LAVA farms
and their tags in Mesa CI. Since specific jobs may require different
types of LAVA farms to run on, it is essential to determine which farm
the runner is running on to configure the job correctly.

LavaFarm provides an easy-to-use interface for checking the runner tag
and returning the corresponding LAVA farm, making it simple for Mesa CI
to configure jobs appropriately. By adding tests for LavaFarm, the team
can ensure that this class is functioning as expected, allowing for the
smooth execution of Mesa CI jobs on the correct LAVA farm.

The tests ensure that get_lava_farm returns the correct LavaFarm value
when given invalid or valid tags and that it returns LavaFarm.UNKNOWN
when no tag is provided. The tests use Hypothesis strategies to generate
various labels and farms for testing.

Example of use:
```
from lava.utils.lava_farm import LavaFarm, get_lava_farm

lava_farm = get_lava_farm()
if lava_farm == LavaFarm.DUMMY:
    # Configure the job for the DUMMY farm
    ...
elif lava_farm == LavaFarm.COLLABORA:
    # Configure the job for the COLLABORA farm
    ...
elif lava_farm == LavaFarm.KERNELCI:
    # Configure the job for the KERNELCI farm
    ...
else:
    # Handle the case where the LAVA farm is unknown
    ...
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>

16 months agoci/lava: Move LAVA dependencies to pip
Guilherme Gallo [Wed, 15 Feb 2023 03:13:16 +0000 (00:13 -0300)]
ci/lava: Move LAVA dependencies to pip

Use requirements.txt and requirements-test.txt to organize better Python
dependencies related to LAVA.

Now LAVA tooling can use recent and fixed library versions.
And test-related libs will not trigger container rebuilding anymore.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>

16 months agoradv: Hash VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_* flags
Konstantin Seurer [Tue, 14 Feb 2023 19:43:46 +0000 (20:43 +0100)]
radv: Hash VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_* flags

Found by inspection.

Fixes: 687a82d ("radv/rt: Handle no-null shader flags")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21320>

16 months agofrontend/dri: Initialize callbacks in dri_swrast_kms_init_screen
Michel Dänzer [Wed, 15 Feb 2023 11:40:39 +0000 (12:40 +0100)]
frontend/dri: Initialize callbacks in dri_swrast_kms_init_screen

This was missed in the commit below.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8232
Fixes: 7d5b1cd02c4d ("frontend/dri: move callbacks from the VTable into dri_screen, dri_drawable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21333>

16 months agogallium: Add MCJIT target triplet for Windows ARM64
GH Cao [Thu, 12 Jan 2023 17:04:42 +0000 (01:04 +0800)]
gallium: Add MCJIT target triplet for Windows ARM64

MCJIT on Windows requires a special LLVM target triplet with ELF object
format, add one for Windows ARM64.

Tested locally on real hardware.

Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20675>

16 months agogallium: Use DETECT_OS_WINDOWS instead of 'WIN32'
driver1998 [Thu, 2 Feb 2023 04:45:19 +0000 (12:45 +0800)]
gallium: Use DETECT_OS_WINDOWS instead of 'WIN32'

Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20675>

16 months agoradv: revert Metro Exodus workaround which was moved to common code
Tapani Pälli [Wed, 15 Feb 2023 09:53:01 +0000 (11:53 +0200)]
radv: revert Metro Exodus workaround which was moved to common code

This reverts commit 4397c166c01b641c57348d9e0d881a4a1f351455.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>

16 months agospirv: add workaround for Metro Exodus in spirv_to_nir
Tapani Pälli [Mon, 13 Feb 2023 08:23:37 +0000 (10:23 +0200)]
spirv: add workaround for Metro Exodus in spirv_to_nir

This is commit 4397c166c01 for spirv_to_nir, otherwise we hit
the same assert with anv driver.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>

17 months agoasahi: Vectorize background colour load
Alyssa Rosenzweig [Wed, 15 Feb 2023 03:36:44 +0000 (22:36 -0500)]
asahi: Vectorize background colour load

No point to scalarizing this, the background can handle the vector load fine
since bfa7ec0aa0f ("agx: Don't scalarize preambles in NIR").

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

17 months agoamd/surface: fix base_mip_width of subsampled formats
Pierre-Eric Pelloux-Prayer [Sat, 11 Feb 2023 00:38:33 +0000 (19:38 -0500)]
amd/surface: fix base_mip_width of subsampled formats

base_mip_width is used in si_compute_copy_image when the
SI_IMAGE_ACCESS_BLOCK_FORMAT_AS_UINT flag is used.

   width = tex->surface.u.gfx9.base_mip_width;

This will be incorrect if we don't adjust it. For instance,
with a 260x256 image, surf_pitch and base_mip_width are
320 before surf_pitch is updated to be 192.

Both need to match, or computing the width from base_mip_width
leads to incorrect result.

Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21253>

17 months agoturnip: avoid FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8 for event blits
Chia-I Wu [Wed, 1 Feb 2023 18:38:01 +0000 (10:38 -0800)]
turnip: avoid FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8 for event blits

We don't need it for event blits.  It also does not support fast clears
which makes it slower.

For event blits, blob has

  VK_FORMAT_D16_UNORM           -> FMT6_16_UNORM
  VK_FORMAT_X8_D24_UNORM_PACK32 -> FMT6_Z24_UNORM_S8_UINT
  VK_FORMAT_D32_SFLOAT          -> FMT6_32_FLOAT
  VK_FORMAT_S8_UINT             -> FMT6_8_UINT
  VK_FORMAT_D24_UNORM_S8_UINT   -> FMT6_Z24_UNORM_S8_UINT
  VK_FORMAT_D32_SFLOAT_S8_UINT  -> FMT6_32_FLOAT + FMT6_8_UINT

and always sets RB_BLIT_INFO:DEPTH.  It is unclear what
RB_BLIT_INFO:DEPTH is for but we set it anyway.

Improves "glmark2 -b refract" on angle by 15-20% on a618/a635.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8218
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21116>

17 months agovenus: update venus-protocol headers to partially fix WA1
Ryan Neph [Sat, 11 Feb 2023 00:45:21 +0000 (16:45 -0800)]
venus: update venus-protocol headers to partially fix WA1

Begin encoding/decoding
VkDrmFormatModifierPropertiesList2EXT::drmFormatModifierCount to fix a
workaround (WA1) in the venus-protocol.

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

17 months agohasvk: fix KHR_shader_float_controls reporting
Lionel Landwerlin [Wed, 15 Feb 2023 20:05:08 +0000 (22:05 +0200)]
hasvk: fix KHR_shader_float_controls reporting

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 13f68bcce1 ("hasvk: Tell spirv_to_nir float controls are always supported")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21349>

17 months agoanv: Move execute_simple_batch() and queue_exec_locked() to kmd backend
José Roberto de Souza [Thu, 9 Feb 2023 21:00:46 +0000 (13:00 -0800)]
anv: Move execute_simple_batch() and queue_exec_locked() to kmd backend

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

17 months agoanv: Add gem_mmap to kmd backend
José Roberto de Souza [Thu, 9 Feb 2023 14:29:28 +0000 (06:29 -0800)]
anv: Add gem_mmap to kmd backend

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

17 months agoanv: Add gem_close to kmd backend
José Roberto de Souza [Thu, 9 Feb 2023 14:05:54 +0000 (06:05 -0800)]
anv: Add gem_close to kmd backend

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

17 months agoasahi: Drop agx_device.memctx
Asahi Lina [Wed, 15 Feb 2023 13:12:31 +0000 (22:12 +0900)]
asahi: Drop agx_device.memctx

No longer used.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>

17 months agoasahi: Do not use memctx for pools / meta cache
Asahi Lina [Wed, 15 Feb 2023 10:46:37 +0000 (19:46 +0900)]
asahi: Do not use memctx for pools / meta cache

ralloc is not thread-safe, so we can't use dev->memctx for allocating
context-specific things without locking. On top of that, we always
need to explicitly clean up pools anyway since we need to unref the BOs,
so there is no point to using a memctx.

And since pools need to be explicitly cleaned up, the meta cache code
needs explicit cleanup, so add that and drop memctx from there too.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>

17 months agoasahi: Fix shader key cloning overreads
Asahi Lina [Wed, 15 Feb 2023 08:58:18 +0000 (17:58 +0900)]
asahi: Fix shader key cloning overreads

We call agx_get_shader_variant through with casted inner shader key
types, so it has to make sure to only copy as much of the union as is
actually valid.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>

17 months agoturnip: fix a null descriptor set dereference
Chia-I Wu [Wed, 15 Feb 2023 05:51:55 +0000 (21:51 -0800)]
turnip: fix a null descriptor set dereference

Fixed
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.null_descriptor_set_in_monolithic_pipeline.

Fixes: cb3872f2cdc ("tu: Implement VK_EXT_descriptor_buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>

17 months agoturnip: fix a major leak with GPL LTO
Chia-I Wu [Wed, 15 Feb 2023 05:22:48 +0000 (21:22 -0800)]
turnip: fix a major leak with GPL LTO

This allows dEQP-VK.pipeline.pipeline_library.* to run to finish.

Fixes: e9f5de11d40 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>

17 months agotu: Don't expose KHR_present_id,KHR_present_wait without KHR_swapchain
Danylo Piliaiev [Wed, 15 Feb 2023 18:09:29 +0000 (19:09 +0100)]
tu: Don't expose KHR_present_id,KHR_present_wait without KHR_swapchain

VK_KHR_present_id and VK_KHR_present_wait depend on VK_KHR_swapchain
being present, which is not present at least on Android/KGSL.

Fixes:
src/vulkan/util/vk_extensions.h:450: void assert_device_extensions_requirements(
 const struct vk_device_extension_table *, const struct vk_instance_extension_table *):
 assertion "!device_ext->KHR_present_id || device_ext->KHR_swapchain" failed

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21345>

17 months agoanv,hasvk: flush what UNIFORM_READ flushes on SHADER_READ
Constantine Shablya [Tue, 14 Feb 2023 13:03:51 +0000 (15:03 +0200)]
anv,hasvk: flush what UNIFORM_READ flushes on SHADER_READ

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8287
Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21310>

17 months agoegl/kopper: Pass ancillary invalidate flush flags down to gallium.
Emma Anholt [Tue, 14 Feb 2023 18:32:57 +0000 (10:32 -0800)]
egl/kopper: Pass ancillary invalidate flush flags down to gallium.

We can just add the flags to the kopper interface, since it's private to
Mesa.  This gets us depth/stencil invalidation on swapbuffers, which is
critical for tiler performance.

glmark2-es2 -b texture (windowed) goes from 1650 to 1930 fps on
zink+turnip with ZINK_DEBUG=rp.

Part of #7321 (we're still a little behind freedreno's 2180 fps)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>

17 months agoegl/kopper: Use the kopper private interface for swapBuffers.
Emma Anholt [Tue, 14 Feb 2023 18:27:31 +0000 (10:27 -0800)]
egl/kopper: Use the kopper private interface for swapBuffers.

I'm going to be introducing an extra flag to indicate EGL vs GLX behavior
in the private interface.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>

17 months agoegl: Add a note explaining the swapBuffers badness in dri2_x11_copy_buffers().
Emma Anholt [Tue, 14 Feb 2023 22:48:32 +0000 (14:48 -0800)]
egl: Add a note explaining the swapBuffers badness in dri2_x11_copy_buffers().

I tried to drop the swapBuffers path, but it turns out it's being taken by
softpipe/llvmpipe, and the tests are passing.  The piglit egl-copy-buffers
test even passes on zink, but you end up with a bad display because of an
un-preserved back buffer.

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

17 months agoegl/kopper: Add assert for no kopper in dri2_copy_region.
Emma Anholt [Tue, 14 Feb 2023 18:24:25 +0000 (10:24 -0800)]
egl/kopper: Add assert for no kopper in dri2_copy_region.

This shouldn't be doing a swapBuffers, that's not what this function is
supposed to do.  But also, we shouldn't be doing this from zink, which the
swap was introduced for, because we don't implement the extension.  Cleans
up some strangeness from 3c4be122cc49 ("egl: implement more hooks for
swrast")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>

17 months agoRevert "meson: Fix Asahi build on macOS"
Erik Faye-Lund [Wed, 8 Feb 2023 16:03:53 +0000 (17:03 +0100)]
Revert "meson: Fix Asahi build on macOS"

This reverts commit 4ca4a05627e40e8212a8ea957f8ef2f697e4e322.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>

17 months agomeson: don't pass vk wsi args where they don't belong
Erik Faye-Lund [Wed, 8 Feb 2023 08:34:34 +0000 (09:34 +0100)]
meson: don't pass vk wsi args where they don't belong

Only code that cares about Vulkan WSI should get the corresponding
arguments passed. Otherwise, the Vulkan headers might end up including
other headers that we don't have the correct dependencies passed for.
So let's give those a dedicated variable, and only pass that where it's
actually needed.

Fixes: b39958a3a18 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8193
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>

17 months agovulkan: prefer vulkan_core.h over vulkan.h
Erik Faye-Lund [Wed, 8 Feb 2023 09:07:21 +0000 (10:07 +0100)]
vulkan: prefer vulkan_core.h over vulkan.h

If we include vulkan.h, we risk including the WSI bits as well, which we
don't need here. Only trouble can follow from including these where
they're not needed.

So let's include vulkan_core.h in these places instead.

Fixes: b39958a3a18 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>

17 months agogallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state
Mike Blumenkrantz [Mon, 19 Sep 2022 17:16:45 +0000 (13:16 -0400)]
gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state

some drivers may find this useful

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18695>

17 months agoradv/ci: add missing expected failures with RADV_PERFTEST=gpl on GFX1100
Samuel Pitoiset [Wed, 15 Feb 2023 11:04:18 +0000 (12:04 +0100)]
radv/ci: add missing expected failures with RADV_PERFTEST=gpl on GFX1100

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

17 months agohasvk: use Vulkan runtime's robust buffer access
Constantine Shablya [Wed, 15 Feb 2023 16:35:37 +0000 (18:35 +0200)]
hasvk: use Vulkan runtime's robust buffer access

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

17 months agoanv: use Vulkan runtime's robust buffer access
Constantine Shablya [Wed, 15 Feb 2023 16:35:14 +0000 (18:35 +0200)]
anv: use Vulkan runtime's robust buffer access

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

17 months agofrontends/va: Map VAEncCodedBufferType buffer as PIPE_MAP_READ
David Rosca [Sun, 18 Dec 2022 17:01:37 +0000 (18:01 +0100)]
frontends/va: Map VAEncCodedBufferType buffer as PIPE_MAP_READ

VAEncCodedBufferType is used for reading back encoded data.
Mapping it for read instead of write speeds up reading
the data on CPU.

On radeonsi this will result in VRAM copy to staging buffer
in cached GTT, making the CPU read much faster.

Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20376>

17 months agofix: clover/llvm: replace llvm::None with std::nullopt for LLVM 17+
Kai Wasserbäch [Sun, 5 Feb 2023 11:09:52 +0000 (12:09 +0100)]
fix: clover/llvm: replace llvm::None with std::nullopt for LLVM 17+

llvm::None was deprecated and builds started failing with

  error: ‘None’ is not a member of ‘llvm’

Instead of using the temporarily available include in ADT which would
add a deprecation warning to the build, directly replace llvm::None with
the recommended std::nullopt

This change takes only effect with LLVM 17 or newer.

Reference: https://github.com/llvm/llvm-project/blob/d4f38ef288c3a4cf2318182c8585a5c7e760877a/llvm/include/llvm/ADT/None.h
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21125>

17 months agoir3: Consider dst type in ubo_vec4 to ldc lowering
Danylo Piliaiev [Tue, 14 Feb 2023 18:24:59 +0000 (19:24 +0100)]
ir3: Consider dst type in ubo_vec4 to ldc lowering

The dst type could be either 16b or 32b.

Fixes validation failure in dEQP-VK.subgroups.* tests which deal with
16b types.

 validation fail: (type_size(instr->cat6.type) <= 16) == !!((instr->dsts[0])->flags & IR3_REG_HALF)
   -> for instruction: MESA: info: 0023:0000:000:        ldc.offset0.base0 hssa_23 (wrmask=0x3), ssa_1, ssa_22

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21316>

17 months agopvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.
Karmjit Mahil [Fri, 27 Jan 2023 18:25:57 +0000 (18:25 +0000)]
pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.

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

17 months agopvr: Upload spm load programs to device.
Karmjit Mahil [Fri, 18 Nov 2022 14:51:37 +0000 (14:51 +0000)]
pvr: Upload spm load programs to device.

The programs are currently unused but will be needed for the spm
background object load op.

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

17 months agopvr: Add SPM load usc empty programs
Karmjit Mahil [Thu, 2 Feb 2023 16:34:34 +0000 (16:34 +0000)]
pvr: Add SPM load usc empty programs

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

17 months agoiris: Drop iris_cache_flush_for_render
Nanley Chery [Fri, 10 Feb 2023 22:28:41 +0000 (14:28 -0800)]
iris: Drop iris_cache_flush_for_render

Before dropping this function, handle the two callers of this function:

* The call in iris_blorp.c is redundant. The required cache flushes are
  already handled by the callers of blorp functions. Delete this.

* The call in iris_resolve.c is still providing a benefit because it
  calls iris_emit_buffer_barrier_for internally. Inline the needed
  barrier.

Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>

17 months agoiris: Flush caches for aux-mode changes more often
Nanley Chery [Tue, 14 Feb 2023 01:52:58 +0000 (17:52 -0800)]
iris: Flush caches for aux-mode changes more often

Memory accesses can get corrupted when there's a disagreement between:
* the aux-mode of existing cache lines for a surface and
* the aux-usage in that surface's RENDER_SURFACE_STATE object

We have already prevented hardware from seeing this conflict for
rendering operations, but due to how the L3 is shared among multiple
clients in gfx12 (e.g., sampler engine, render engine, etc.), we need to
expand the scope of the existing solution. Now, before any access of a
compressible resource, we make sure to flush the prior aux-mode from the
caches.

The majority of changes here refactor things for use in a new function,
flush_previous_aux_mode. The remaining change calls that function from
within iris_resource_prepare_access.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6558
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7625
Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>

17 months agoiris: Update comment in iris_cache_flush_for_render
Nanley Chery [Tue, 14 Feb 2023 00:45:02 +0000 (16:45 -0800)]
iris: Update comment in iris_cache_flush_for_render

Update the comment to reflect the fact that iris no longer switches
between CCS_E and CCS_D.

Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>

17 months agomeson: Combine duplicated c_args and cpp_args
Yonggang Luo [Wed, 28 Sep 2022 14:39:28 +0000 (22:39 +0800)]
meson: Combine duplicated c_args and cpp_args

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19185>

17 months agomeson: Split c_cpp_args from pre_args
Yonggang Luo [Sat, 11 Feb 2023 06:49:59 +0000 (14:49 +0800)]
meson: Split c_cpp_args from pre_args

pre_args should not include compiler options

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19185>

17 months agomeson: drop `TODO: opengl`, it's done
Eric Engestrom [Sat, 21 Jan 2023 12:21:34 +0000 (12:21 +0000)]
meson: drop `TODO: opengl`, it's done

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>

17 months agomeson: only build glsl when needed
Eric Engestrom [Tue, 17 Jan 2023 17:58:33 +0000 (17:58 +0000)]
meson: only build glsl when needed

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>

17 months agomeson: only build libglsl_util when needed
Eric Engestrom [Tue, 17 Jan 2023 17:57:43 +0000 (17:57 +0000)]
meson: only build libglsl_util when needed

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>

17 months agomeson: only build the loader when needed
Eric Engestrom [Sat, 5 Nov 2022 08:47:04 +0000 (08:47 +0000)]
meson: only build the loader when needed

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>

17 months agomeson: only build mapi when needed
Eric Engestrom [Sat, 5 Nov 2022 08:47:04 +0000 (08:47 +0000)]
meson: only build mapi when needed

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>

17 months agomeson: move float64_glsl_file one meson.build up
Eric Engestrom [Tue, 17 Jan 2023 17:56:22 +0000 (17:56 +0000)]
meson: move float64_glsl_file one meson.build up

anv uses it.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>

17 months agolavapipe: enable linear filtering for depth formats
Mike Blumenkrantz [Mon, 23 Jan 2023 15:53:29 +0000 (10:53 -0500)]
lavapipe: enable linear filtering for depth formats

this seems to work according to cts

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20859>

17 months agointel: Implement Wa_16011448509
Mark Janes [Fri, 10 Feb 2023 23:22:47 +0000 (15:22 -0800)]
intel: Implement Wa_16011448509

"Use 3DSTATE_CONST command for individual shaders instead of
3DSTATE_CONST_ALL COMMAND"

On gen 12.0 platforms, 3DSTATE_CONSTANT_ALL command is not processed
correctly in certain cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-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/21301>

17 months agozink: block LINEAR filtered blits for zs formats
Mike Blumenkrantz [Tue, 14 Feb 2023 15:10:20 +0000 (10:10 -0500)]
zink: block LINEAR filtered blits for zs formats

this is illegal, and the u_blitter path has to be taken to guarantee
enough accuracy that the strictest piglit tests pass

cc: mesa-stable

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

17 months agoRevert "zink: always use NEAREST for zs blits"
Mike Blumenkrantz [Tue, 14 Feb 2023 15:08:22 +0000 (10:08 -0500)]
Revert "zink: always use NEAREST for zs blits"

This reverts commit 067545eb9af79414054e4bef3ab48af003758663.

this is good enough for CI but not enough for anholt's piglit tests

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

17 months agovk/runtime: turn vk.xml extension requirements into asserts
Eric Engestrom [Thu, 21 Jul 2022 21:38:27 +0000 (22:38 +0100)]
vk/runtime: turn vk.xml extension requirements into asserts

More specifically, turn
  <extension name="VK_KHR_foo" requires="VK_KHR_bar">
into
  assert(!ext->KHR_foo || ext->KHR_bar);

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>

17 months agovk/runtime: keep track of supported instance extensions
Eric Engestrom [Fri, 10 Feb 2023 17:56:36 +0000 (17:56 +0000)]
vk/runtime: keep track of supported instance extensions

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>

17 months agovk/util: keep track of extension requirements
Eric Engestrom [Thu, 21 Jul 2022 21:38:27 +0000 (22:38 +0100)]
vk/util: keep track of extension requirements

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>

17 months agodzn: Enable KHR_storage_buffer_storage_class
Jesse Natalie [Tue, 14 Feb 2023 00:56:19 +0000 (16:56 -0800)]
dzn: Enable KHR_storage_buffer_storage_class

It's required for VK1.1 and Mesa's SPIR-V parser handles it for us.

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

17 months agointel/fs: bound subgroup invocation read to dispatch size
Lionel Landwerlin [Wed, 8 Feb 2023 18:48:25 +0000 (20:48 +0200)]
intel/fs: bound subgroup invocation read to dispatch size

This is to avoid out of bound register accesses (potentially leading
to hangs) when the dispatch size is smaller than when is reported in
the NIR subgroup_size.

v2: Implement bounding with a mask (since workgroup sizes are powers of 2) (Faith)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 530de844ef4d ("intel,anv,iris,crocus: Drop subgroup size from the shader key")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21282>

17 months agozink: enable renderpass optimizations by default for selected drivers
Mike Blumenkrantz [Mon, 13 Feb 2023 22:15:57 +0000 (17:15 -0500)]
zink: enable renderpass optimizations by default for selected drivers

CI has been running this for months on turnip, so let's give it some
broader testing

also add a ZINK_DEBUG=norp for testing

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

17 months agoaco: Don't use vcmpx with DPP.
Georg Lehmann [Thu, 5 Jan 2023 16:20:42 +0000 (17:20 +0100)]
aco: Don't use vcmpx with DPP.

V_CMPX+DPP returns 0 with reads from disabled lanes, unlike V_CMP+DPP (RDNA3 ISA doc, 7.7)

Fixes: baab6f18c91 ("aco: Optimize branching sequence during SSA elimination.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20537>

17 months agonir/from_ssa: Use more helpers in resolve_parallel_copies
Faith Ekstrand [Mon, 13 Feb 2023 23:24:18 +0000 (17:24 -0600)]
nir/from_ssa: Use more helpers in resolve_parallel_copies

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>

17 months agonir: Fix typos in the from-SSA pass comments
Kenneth Graunke [Fri, 10 Feb 2023 09:14:11 +0000 (01:14 -0800)]
nir: Fix typos in the from-SSA pass comments

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

17 months agonir: Fix merge_set_dump() to compile again
Kenneth Graunke [Fri, 10 Feb 2023 07:47:38 +0000 (23:47 -0800)]
nir: Fix merge_set_dump() to compile again

This #if 0'd debug code has been broken since -Werror=vla was added.

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

17 months agonir: Print divergence information for registers as well as SSA defs
Kenneth Graunke [Thu, 9 Feb 2023 23:18:05 +0000 (15:18 -0800)]
nir: Print divergence information for registers as well as SSA defs

This patch causes us to print "con" and "div" for registers as well as
SSA defs.  We print it on both register declarations, and destinations.
The latter isn't strictly necessary, but it is handy to be able to see
e.g. a convergent value being assigned to a divergent register without
having to constantly refer back to definitions that might be much
earlier in the program.  I originally printed it for sources as well,
but that got to be a bit wordy, so I dropped that.

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

17 months agomeson: remove unused USE_FOO_ASM defines
Erik Faye-Lund [Thu, 9 Feb 2023 08:31:12 +0000 (09:31 +0100)]
meson: remove unused USE_FOO_ASM defines

The usage of these defines was removed, so let's remove the definitions
as well.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21212>

17 months agoanv/blorp: use existing function to convert the op to a string
Rohan Garg [Wed, 1 Feb 2023 17:46:47 +0000 (18:46 +0100)]
anv/blorp: use existing function to convert the op to a string

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>