platform/upstream/mesa.git
17 months agoradv/nir: use ac_nir_unpack_arg() for packed shader input user SGPRS
Samuel Pitoiset [Wed, 31 May 2023 11:12:32 +0000 (13:12 +0200)]
radv/nir: use ac_nir_unpack_arg() for packed shader input user SGPRS

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

17 months agoradv/ci: removed expected failures that are skipped now
Samuel Pitoiset [Thu, 1 Jun 2023 06:22:09 +0000 (08:22 +0200)]
radv/ci: removed expected failures that are skipped now

These tests were failing because CTS wasn't checking a feature bit.
Now that CTS is fixed, these tests are skipped and can't fail at all.

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

17 months agofreedreno/a6xx: Fix memory leak on error path.
Vinson Lee [Mon, 29 May 2023 03:20:09 +0000 (20:20 -0700)]
freedreno/a6xx: Fix memory leak on error path.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable fd6_ctx going out of scope leaks the storage it points to.

Fixes: de3b34df973 ("freedreno: Add a6xx backend")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23289>

17 months agopanfrost: Use util_pipe_image_to_sampler_view
Alyssa Rosenzweig [Thu, 25 May 2023 21:05:51 +0000 (17:05 -0400)]
panfrost: Use util_pipe_image_to_sampler_view

The common helper is based on what we had locally, with some more cases handled.
Let's use it instead of vendoring.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23273>

17 months agogallium: Add util_image_to_sampler_view helper
Alyssa Rosenzweig [Thu, 25 May 2023 21:04:56 +0000 (17:04 -0400)]
gallium: Add util_image_to_sampler_view helper

This helper is useful to implement images. This implementation is based on the
one in Panfrost and extended to handle all pipe_image_views (notably including
tex2d_from_buf which did not exist when the panfrost version was written). It
will be used in both Panfrost and Asahi.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23273>

17 months agodrm-shim: Avoid assertion fail if someone does close(-1).
Emma Anholt [Thu, 18 May 2023 23:21:44 +0000 (16:21 -0700)]
drm-shim: Avoid assertion fail if someone does close(-1).

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

17 months agoci: uprev VVL to 1.3.251
Mike Blumenkrantz [Wed, 31 May 2023 18:31:31 +0000 (14:31 -0400)]
ci: uprev VVL to 1.3.251

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

17 months agogitlab: prefill MR template with first multiline commit message
David Heidelberg [Wed, 31 May 2023 21:09:17 +0000 (23:09 +0200)]
gitlab: prefill MR template with first multiline commit message

Resolve situation for one commit MR, with description inside.

Acked-By: Mike Blumenkrantz <michae
l.blumenkrantz@gmail.com>

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23346>

17 months agonir_opt_algebraic: Don't shrink 64-bit bitwise ops if pack_split is going to be lowered
Jesse Natalie [Tue, 23 May 2023 20:22:42 +0000 (13:22 -0700)]
nir_opt_algebraic: Don't shrink 64-bit bitwise ops if pack_split is going to be lowered

Otherwise this can cause optimizations to fight resulting in infinite
optimization loops with opt_algebraic, constant_folding, and copy_prop.

Fixes: 368be872 ("nir/algebraic: shrink 64-bit bitwise operations with 0/-1 constant half")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23192>

17 months agomesa/st: fix buffer overflow related to set_program_string()
Patrick Lerda [Thu, 25 May 2023 14:20:09 +0000 (16:20 +0200)]
mesa/st: fix buffer overflow related to set_program_string()

For instance, this is triggered with "piglit/bin/ext_direct_state_access-named-program -auto -fbo":
==5695==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606000050031 at pc 0x7f78dfca8d46 bp 0x7ffd9043b4a0 sp 0x7ffd9043ac50
READ of size 50 at 0x606000050031 thread T0
    #0 0x7f78dfca8d45  (/usr/lib64/libasan.so.6+0x3fd45)
    #1 0x7f78d450b18f in set_program_string ../src/mesa/main/arbprogram.c:385
    #2 0x7f78d3fdbd3e in execute_list ../src/mesa/main/dlist.c:13025
    #3 0x7f78d40c2564 in _mesa_CallList ../src/mesa/main/dlist.c:13451
    #4 0x7f78d42f380a in _mesa_unmarshal_CallList ../src/mesa/main/glthread_list.c:43
    #5 0x7f78d38e85c5 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:122
    #6 0x7f78d38ea20d in _mesa_glthread_finish ../src/mesa/main/glthread.c:382
    #7 0x7f78d38ea20d in _mesa_glthread_finish ../src/mesa/main/glthread.c:347
    #8 0x7f78d3d73f69 in _mesa_marshal_IsProgramARB src/mapi/glapi/gen/marshal_generated2.c:4256

Fixes: 0b196b40a3ae ("mesa: don't compute the same SHA1 twice in glShaderSource")
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/23295>

17 months agodocs: increase contrast in dark-theme
Erik Faye-Lund [Thu, 25 May 2023 10:39:10 +0000 (12:39 +0200)]
docs: increase contrast in dark-theme

The contrast-ratio between the foreground and background colors aren't
quite ideal in dark mode. This improves the situation a bit, by making
the body-text a bit brighter.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9043
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23236>

17 months agov3d/ci: update traces
Juan A. Suarez Romero [Tue, 30 May 2023 09:33:12 +0000 (11:33 +0200)]
v3d/ci: update traces

Add new traces, remove old ones, and add more information for the
unsupported/crashes.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23319>

17 months agospirv: Assert sampler_dim is valid when building nir_tex_instr
Caio Oliveira [Tue, 21 Sep 2021 20:31:10 +0000 (13:31 -0700)]
spirv: Assert sampler_dim is valid when building nir_tex_instr

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

17 months agospirv: Validate Dim of OpTypeSampledImage and OpSampledImage
Caio Oliveira [Tue, 21 Sep 2021 20:10:05 +0000 (13:10 -0700)]
spirv: Validate Dim of OpTypeSampledImage and OpSampledImage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14244>

17 months agointel: Fix support of kernel versions without DRM_I915_QUERY_ENGINE_INFO
José Roberto de Souza [Fri, 26 May 2023 14:12:40 +0000 (07:12 -0700)]
intel: Fix support of kernel versions without DRM_I915_QUERY_ENGINE_INFO

As Matt Turner pointed out, the commit here fixed breaks in Iris and
ANV in kernel versions without support for DRM_I915_QUERY_ENGINE_INFO.
As compute engines are only present in gfx12 and newer, and support
for DRM_I915_QUERY_ENGINE_INFO was added before any gfx12 platform,
we can check for gfx version before trying to get engine info.

For ANV, this is done by checking if engine_info is not NULL, like in
other places in the ANV source code.

Fixes: a364f23a6cfa ("intel: Make gen12 URB space reservation dependent on compute engine presence")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9099
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23257>

17 months agodriconf: set vk_x11_strict_image_count for Wolfenstein II
Blisto [Tue, 30 May 2023 17:34:31 +0000 (17:34 +0000)]
driconf: set vk_x11_strict_image_count for Wolfenstein II

Prevents crash with vsync turned off on xwayland.

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

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

17 months agohasvk: enable single texel alignment
Rohan Garg [Tue, 30 May 2023 16:26:01 +0000 (18:26 +0200)]
hasvk: enable single texel alignment

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23321>

17 months agoanv: fix incorrect asserts when combining CPS and per sample interpolation
Rohan Garg [Tue, 30 May 2023 16:10:53 +0000 (18:10 +0200)]
anv: fix incorrect asserts when combining CPS and per sample interpolation

CPS is dynamically turned off when per sample interpolation is active.
Update the asserts to reflect this.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5644011f06 ("intel/compiler: Convert wm_prog_key::persample_interp to a tri-state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23103>

17 months agomesa/st: fix refcnt imbalance related to st_feedback_draw_vbo()
Patrick Lerda [Fri, 28 Apr 2023 10:52:08 +0000 (12:52 +0200)]
mesa/st: fix refcnt imbalance related to st_feedback_draw_vbo()

This issue is happening on radeonsi. The reference was allocated
via _mesa_get_bufferobj_reference() with setup_arrays().
The same reference was never freed.

For instance, this issue is triggered on radeonsi with
"piglit/bin/gl-1.0-rendermode-feedback -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: ff8c2a1748b9 ("mesa/bufferobj: rename bufferobj functions to be more consistent.")
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/22921>

17 months agoci/windows: Update WARP to 1.0.7.1
Jesse Natalie [Tue, 30 May 2023 23:23:28 +0000 (16:23 -0700)]
ci/windows: Update WARP to 1.0.7.1

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23330>

17 months agoc11: Remove _MTX_INITIALIZER_NP as it's not used anymore
Yonggang Luo [Fri, 10 Feb 2023 11:09:18 +0000 (19:09 +0800)]
c11: Remove _MTX_INITIALIZER_NP as it's not used anymore

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agovdpau: Replace usage of mtx_t with simple_mtx_t in htab.c
Yonggang Luo [Fri, 10 Feb 2023 11:07:13 +0000 (19:07 +0800)]
vdpau: Replace usage of mtx_t with simple_mtx_t in htab.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agoomx: Replace usage of mtx_t with simple_mtx_t in vid_omx_common.c
Yonggang Luo [Fri, 10 Feb 2023 11:02:55 +0000 (19:02 +0800)]
omx: Replace usage of mtx_t with simple_mtx_t in vid_omx_common.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agonine: Replace usage of mtx_t with simple_mtx_t in nine_lock.c
Yonggang Luo [Fri, 10 Feb 2023 11:01:07 +0000 (19:01 +0800)]
nine: Replace usage of mtx_t with simple_mtx_t in nine_lock.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agortasm: Replace usage of mtx_t with simple_mtx_t in rtasm_execmem.c
Yonggang Luo [Fri, 10 Feb 2023 10:50:17 +0000 (18:50 +0800)]
rtasm: Replace usage of mtx_t with simple_mtx_t in rtasm_execmem.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agortasm: Trim trailing spaces and replace tab with 3 space
Yonggang Luo [Fri, 10 Feb 2023 10:46:29 +0000 (18:46 +0800)]
rtasm: Trim trailing spaces and replace tab with 3 space

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agoxlib: Replace usage of mtx_t with simple_mtx_t in xm_api.c
Yonggang Luo [Fri, 10 Feb 2023 10:52:27 +0000 (18:52 +0800)]
xlib: Replace usage of mtx_t with simple_mtx_t in xm_api.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agohud: Replace usage of mtx_t with simple_mtx_t in hud_sensors_temp.c
Yonggang Luo [Fri, 10 Feb 2023 10:40:47 +0000 (18:40 +0800)]
hud: Replace usage of mtx_t with simple_mtx_t in hud_sensors_temp.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agohud: Replace usage of mtx_t with simple_mtx_t in hud_nic.c
Yonggang Luo [Fri, 10 Feb 2023 10:38:58 +0000 (18:38 +0800)]
hud: Replace usage of mtx_t with simple_mtx_t in hud_nic.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agohud: Replace usage of mtx_t with simple_mtx_t in hud_diskstat.c
Yonggang Luo [Fri, 10 Feb 2023 10:36:33 +0000 (18:36 +0800)]
hud: Replace usage of mtx_t with simple_mtx_t in hud_diskstat.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agohud: Replace usage of mtx_t with simple_mtx_t in hud_cpufreq.c
Yonggang Luo [Fri, 10 Feb 2023 08:33:56 +0000 (16:33 +0800)]
hud: Replace usage of mtx_t with simple_mtx_t in hud_cpufreq.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agodrm: Replace usage of mtx_t with simple_mtx_t in nouveau_drm_winsys.c
Yonggang Luo [Fri, 10 Feb 2023 06:45:43 +0000 (14:45 +0800)]
drm: Replace usage of mtx_t with simple_mtx_t in nouveau_drm_winsys.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agodrm: Replace usage of mtx_t with simple_mtx_t in drm/radeon_drm_winsys.c
Yonggang Luo [Fri, 10 Feb 2023 06:42:29 +0000 (14:42 +0800)]
drm: Replace usage of mtx_t with simple_mtx_t in drm/radeon_drm_winsys.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agodrm: Replace usage of mtx_t with simple_mtx_t in virgl/drm/virgl_drm_winsys.c
Yonggang Luo [Fri, 10 Feb 2023 06:14:49 +0000 (14:14 +0800)]
drm: Replace usage of mtx_t with simple_mtx_t in virgl/drm/virgl_drm_winsys.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agodrm-shim: Replace usage of mtx_t with simple_mtx_t in drm_shim.c
Yonggang Luo [Wed, 9 Nov 2022 06:18:37 +0000 (14:18 +0800)]
drm-shim: Replace usage of mtx_t with simple_mtx_t in drm_shim.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agovc4: Replace usage of mtx_t with simple_mtx_t in vc4/vc4_simulator.c
Yonggang Luo [Fri, 10 Feb 2023 06:18:43 +0000 (14:18 +0800)]
vc4: Replace usage of mtx_t with simple_mtx_t in vc4/vc4_simulator.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agov3d: Replace usage of mtx_t with simple_mtx_t in v3d_simulator.c
Yonggang Luo [Wed, 9 Nov 2022 06:17:05 +0000 (14:17 +0800)]
v3d: Replace usage of mtx_t with simple_mtx_t in v3d_simulator.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agoloader: Replace usage of mtx_t with simple_mtx_t in loader/loader_dri3_helper.c
Yonggang Luo [Wed, 9 Nov 2022 06:14:00 +0000 (14:14 +0800)]
loader: Replace usage of mtx_t with simple_mtx_t in loader/loader_dri3_helper.c

This is a prepare for removing _MTX_INITIALIZER_NP.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21284>

17 months agoradv: fix msaa feedback loop without tc-compat cmask
Chia-I Wu [Tue, 30 May 2023 22:43:16 +0000 (15:43 -0700)]
radv: fix msaa feedback loop without tc-compat cmask

When in an msaa feedback loop and when the image does not have tc-compat
cmask, we have to decompress and expand fmask.  This can happen on gfx9
when sample count > 2 or when RADV_DEBUG=notccompatcmask is specified.

Fixes: a38de4c011d ("radv: disable tc_compatible_cmask on GFX9 in some cases")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23331>

17 months agoci: Disable "opencl-external-clang-headers" when "microsoft-clc" is enabled
Dor Askayo [Fri, 26 May 2023 11:54:17 +0000 (14:54 +0300)]
ci: Disable "opencl-external-clang-headers" when "microsoft-clc" is enabled

Signed-off-by: Dor Askayo <dor.askayo@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23255>

17 months agomeson: add feature option for use of system Clang headers at runtime
Dor Askayo [Fri, 26 May 2023 11:19:23 +0000 (14:19 +0300)]
meson: add feature option for use of system Clang headers at runtime

Enabling or disabling the "microsoft-clc" option previously changed
shared logic for all compiler/clc users, which was surprising.

In addition, the option to avoid the use of system Clang headers at
runtime is useful outside the scope of Windows.

Separating the two concepts by making this a neutral feature option
addresses both matters.

Signed-off-by: Dor Askayo <dor.askayo@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23255>

17 months agoaco: cleanup v_cmp_class usage
Georg Lehmann [Tue, 30 May 2023 09:53:24 +0000 (11:53 +0200)]
aco: cleanup v_cmp_class usage

It's not the best way to check for NaN.

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

17 months agoci/zink+radv: mark flakes as such
Eric Engestrom [Wed, 31 May 2023 09:26:53 +0000 (10:26 +0100)]
ci/zink+radv: mark flakes as such

They failed again when I retried, but apparently they are actually
flakes, so mark them as such.

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

17 months agopvr: Use common vkGetPhysicalDeviceFeatures2() implementation
Matt Coster [Mon, 15 May 2023 08:49:44 +0000 (09:49 +0100)]
pvr: Use common vkGetPhysicalDeviceFeatures2() implementation

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

17 months agopvr: Use correct pbe format for VK_FORMAT_A8B8G8R8_UNORM_PACK32
Matt Coster [Fri, 19 May 2023 15:28:48 +0000 (16:28 +0100)]
pvr: Use correct pbe format for VK_FORMAT_A8B8G8R8_UNORM_PACK32

Fixes:
  - dEQP-VK.api.image_clearing.core.clear_color_image.1d.linear
      .single_layer.a8b8g8r8_unorm_pack32_71x1
  - dEQP-VK.api.image_clearing.core.clear_color_image.2d.linear
      .single_layer.a8b8g8r8_unorm_pack32_33x128

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reported-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23312>

17 months agopvr: Fix rect splitting logic in pvr_unwind_rects()
Matt Coster [Fri, 19 May 2023 10:46:38 +0000 (11:46 +0100)]
pvr: Fix rect splitting logic in pvr_unwind_rects()

Fixes:
  dEQP-VK.api.copy_and_blit.core.image_to_buffer.buffer_offset_relaxed
  dEQP-VK.api.image_clearing.core.clear_color_image.3d.optimal
    .single_layer.r8_unorm_200x180x16

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reported-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reported-by: Oskar Rundgren <oskar.rundgren@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23309>

17 months agoetnaviv: don't flush implicit flush resources when forced
Lucas Stach [Tue, 30 May 2023 22:18:57 +0000 (00:18 +0200)]
etnaviv: don't flush implicit flush resources when forced

Resources only need to become visible when the application requested
the context flush, so we can safely skip the flushing when the flush
is forced internally by running out of commandstream space.

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

17 months agoetnaviv: update derived state after forced commandstream flush
Lucas Stach [Tue, 30 May 2023 22:15:37 +0000 (00:15 +0200)]
etnaviv: update derived state after forced commandstream flush

If we run out of space in the commandstream while emitting the
current state the drived states won't be recomputed for the
now fully dirty context as the state derivation is called before
any state emitted. Fix this by explicitly updating the derived
state after a forced flush.

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

17 months agoetnaviv: nir: improve uniform usage for ALU opc
Christian Gmeiner [Sun, 28 May 2023 12:42:57 +0000 (14:42 +0200)]
etnaviv: nir: improve uniform usage for ALU opc

The current code in lower_alu(..) counts how many const values
are used by one ALU opc. If there are used more then one the
compiler tries to fix this issues by e.g. resolve with a single
combined const src.

We are doing this as some GPUs only allow one const src per
ISA instruction. But it is allowed to use the same const for
multiple srcs.

Lets have a closer look at a real world shader:

impl main {
        /* preds: */
        vec1 32 ssa_0 = load_const (0x3f800000 = 1.000000)
        vec1 32 ssa_1 = load_const (0x00000000 = 0.000000)
        vec4 32 ssa_2 = intrinsic load_uniform (ssa_1) (base=0, range=1, dest_type=bool32 /*38*/)       /* u_var */
        vec1 32 ssa_4 = fmul ssa_2.x, ssa_2.y
        vec1 32 ssa_11 = load_const (0x00000000 = 0.000000)
        vec1 32 ssa_13 = seq ssa_2.w, ssa_11
        vec1 32 ssa_6 = fmul ssa_2.z, ssa_13
        vec1 32 ssa_7 = fmul ssa_4, ssa_6
        vec1 32 ssa_9 = deref_var &gl_FragColor (shader_out vec4)
        vec4 32 ssa_10 = vec4 ssa_7, ssa_7, ssa_7, ssa_0
        intrinsic store_deref (ssa_9, ssa_10) (wrmask=xyzw /*15*/, access=0)
        /* succs: block_1 */
        block block_1:
}

The current compiler transforms it to:

impl main {
        block block_0:
        /* preds: */
        vec1 32 ssa_0 = load_const (0x3f800000 = 1.000000)
        vec4 32 ssa_14 = load_const (0x00000000, 0x00000001, 0x00000002, 0x00000003) = (0.000000, 0.000000, 0.000000, 0.000000)
        vec2 32 ssa_15 = load_const (0x00000000, 0x00000001) = (0.000000, 0.000000)
        vec1 32 ssa_4 = fmul ssa_15.x, ssa_15.y
        vec2 32 ssa_16 = load_const (0x00000003, 0x00000000) = (0.000000, 0.000000)
        vec1 32 ssa_13 = seq ssa_16.x, ssa_16.y
        vec1 32 ssa_6 = fmul ssa_14.z, ssa_13
        vec1 32 ssa_7 = fmul ssa_4, ssa_6
        vec1 32 ssa_9 = deref_var &gl_FragColor (shader_out vec4)
        vec1 32 ssa_17 = mov ssa_0
        vec4 32 ssa_10 = vec4 ssa_7, ssa_7, ssa_7, ssa_17
        intrinsic store_deref (ssa_9, ssa_10) (wrmask=xyzw /*15*/, access=0)
        /* succs: block_1 */
        block block_1:
}

There is no need to create ssa_15 as we can use ssa_14 for the first fmul.

With this change the compiler creates the following shader:

impl main {
        block block_0:
        /* preds: */
        vec1 32 ssa_0 = load_const (0x3f800000 = 1.000000)
        vec4 32 ssa_14 = load_const (0x00000000, 0x00000001, 0x00000002, 0x00000003) = (0.000000, 0.000000, 0.000000, 0.000000)
        vec1 32 ssa_4 = fmul ssa_14.x, ssa_14.y
        vec2 32 ssa_15 = load_const (0x00000003, 0x00000000) = (0.000000, 0.000000)
        vec1 32 ssa_13 = seq ssa_15.x, ssa_15.y
        vec1 32 ssa_6 = fmul ssa_14.z, ssa_13
        vec1 32 ssa_7 = fmul ssa_4, ssa_6
        vec1 32 ssa_9 = deref_var &gl_FragColor (shader_out vec4)
        vec1 32 ssa_16 = mov ssa_0
        vec4 32 ssa_10 = vec4 ssa_7, ssa_7, ssa_7, ssa_16
        intrinsic store_deref (ssa_9, ssa_10) (wrmask=xyzw /*15*/, access=0)
        /* succs: block_1 */
        block block_1:
}

This change reduces immediate pressure and reduces spend CPU cycles.

No piglit or deqp regression seen.

shader-db results for GC2000:

total instructions in shared programs: 955128 -> 955128 (0.00%)
instructions in affected programs: 0 -> 0
helped: 0
HURT: 0

total temps in shared programs: 85689 -> 85689 (0.00%)
temps in affected programs: 0 -> 0
helped: 0
HURT: 0

total immediates in shared programs: 155428 -> 155240 (-0.12%)
immediates in affected programs: 1840 -> 1652 (-10.22%)
helped: 34
HURT: 1
helped stats (abs) min: 4 max: 16 x̄: 5.65 x̃: 4
helped stats (rel) min: 2.94% max: 33.33% x̄: 16.92% x̃: 16.67%
HURT stats (abs)   min: 4 max: 4 x̄: 4.00 x̃: 4
HURT stats (rel)   min: 14.29% max: 14.29% x̄: 14.29% x̃: 14.29%
95% mean confidence interval for immediates value: -6.57 -4.17
95% mean confidence interval for immediates %-change: -19.83% -12.23%
Immediates are helped.

total loops in shared programs: 0 -> 0
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

LOST:   0
GAINED: 0

Total CPU time (seconds): 102.55 -> 96.35 (-6.05%)

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

17 months agoFix DGC bug where indirect count > maxSequencesCount.
Hans-Kristian Arntzen [Fri, 26 May 2023 10:31:49 +0000 (12:31 +0200)]
Fix DGC bug where indirect count > maxSequencesCount.

Need to explicitly clamp the indirect count against maxSequencesCount,
or we risk writing bogus commands into spill region.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23252>

17 months agoaco: remove nir_intrinsic_load_barycentric_at_sample occurences
Samuel Pitoiset [Tue, 30 May 2023 09:01:50 +0000 (11:01 +0200)]
aco: remove nir_intrinsic_load_barycentric_at_sample occurences

This is lowered earlier and shouldn't get there.

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

17 months agoradv/meta: fix uninitialised stack memory usage.
Dave Airlie [Tue, 30 May 2023 19:23:03 +0000 (05:23 +1000)]
radv/meta: fix uninitialised stack memory usage.

==10199== Conditional jump or move depends on uninitialised value(s)
==10199==    at 0xA107B13: radv_resume_queries (radv_meta.c:93)
==10199==    by 0xA108097: radv_meta_restore (radv_meta.c:225)
==10199==  Uninitialised value was created by a stack allocation
==10199==    at 0xA1145B2: fill_buffer_shader (radv_meta_buffer.c:171)

saved_state is never memset, so the value should be inited.

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

17 months agor600/sfn: Initialize BlockScheduler member m_chip_family.
Vinson Lee [Mon, 29 May 2023 03:35:54 +0000 (20:35 -0700)]
r600/sfn: Initialize BlockScheduler member m_chip_family.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_chip_family is not initialized
in this constructor nor in any functions that it calls.

Fixes: e57643cf548 ("r600/sfn: Add handling for R600 indirect access alias handling")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23290>

17 months agov3dv: Update texture padding logic to match v3d changes
Lucas Fryzek [Fri, 26 May 2023 18:52:54 +0000 (14:52 -0400)]
v3dv: Update texture padding logic to match v3d changes

Piglit tests for v3d highlighted issues with the padding
computation when allocating memory for slices. This change
moves the fixes from v3d to v3dv.

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

17 months agov3d: Add support for ASTC texture compression
Lucas Fryzek [Fri, 26 May 2023 15:41:52 +0000 (11:41 -0400)]
v3d: Add support for ASTC texture compression

Add proper support for ASTC texture compression in the v3d
gallium driver, instead of relying on the fallback software
conversion from gallium, as the hardware has native support
for ASTC compressed textures.

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

17 months agovulkan: use cmd size array for queued cmd allocations
Mike Blumenkrantz [Tue, 30 May 2023 15:11:21 +0000 (11:11 -0400)]
vulkan: use cmd size array for queued cmd allocations

minor simplification for consistency

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

17 months agovulkan/cmd_queue: expose cmd sizes
Mike Blumenkrantz [Tue, 30 May 2023 15:09:45 +0000 (11:09 -0400)]
vulkan/cmd_queue: expose cmd sizes

now that cmds are more precisely allocated, it's necessary for drivers
to have some way to determine what the allocation size is

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

17 months agovulkan/cmd_queue: allocate cmds based on the size of the cmd
Mike Blumenkrantz [Tue, 30 May 2023 15:04:53 +0000 (11:04 -0400)]
vulkan/cmd_queue: allocate cmds based on the size of the cmd

the base size of a vk_cmd_queue_entry is massive since there are a couple
union entries that have a trillion params. by allocating conditionally using
the union member size, memory can be reduced, which will affect some user-facing
api properties

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

17 months agovulkan: reorder vk_cmd_queue_entry
Mike Blumenkrantz [Tue, 30 May 2023 14:51:25 +0000 (10:51 -0400)]
vulkan: reorder vk_cmd_queue_entry

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

17 months agozink/ci: update expected results
Julia Tatz [Tue, 30 May 2023 21:20:32 +0000 (17:20 -0400)]
zink/ci: update expected results

Remove the now passing arb_compute_variable_group_size tests

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

17 months agozink: fix layout(local_size_variable) for vk1.3+
Julia Tatz [Fri, 26 May 2023 00:28:45 +0000 (20:28 -0400)]
zink: fix layout(local_size_variable) for vk1.3+

Use the correct exec-mode op for LocalSizeId
Corrected typo `gl_LocalGroupSize` -> `gl_LocalGroupSizeARB`

Fixes: 99bd1eaf ("zink: use spir-v 1.6 local-size when needed")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23244>

17 months agodocs/venus: advertise VK_EXT_image_2d_view_of_3d
Yiwei Zhang [Wed, 17 May 2023 22:08:55 +0000 (15:08 -0700)]
docs/venus: advertise VK_EXT_image_2d_view_of_3d

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

17 months agovenus: enable VK_EXT_image_2d_view_of_3d
Yiwei Zhang [Wed, 17 May 2023 04:53:44 +0000 (21:53 -0700)]
venus: enable VK_EXT_image_2d_view_of_3d

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

17 months agovenus: sync protocol for VK_EXT_image_2d_view_of_3d
Yiwei Zhang [Wed, 17 May 2023 04:39:33 +0000 (21:39 -0700)]
venus: sync protocol for VK_EXT_image_2d_view_of_3d

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

17 months agovenus: sync to latest protocol from header v1.3.248
Yiwei Zhang [Wed, 17 May 2023 04:36:22 +0000 (21:36 -0700)]
venus: sync to latest protocol from header v1.3.248

This is to make later protocol update CL to be easily backported to
older branches.

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

17 months agovenus: silence -Wuninitialized
Yiwei Zhang [Wed, 17 May 2023 04:59:40 +0000 (21:59 -0700)]
venus: silence -Wuninitialized

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

17 months agointel/dev: switch defect identifiers to use lineage numbers
Mark Janes [Wed, 24 May 2023 20:52:15 +0000 (13:52 -0700)]
intel/dev: switch defect identifiers to use lineage numbers

Update existing workarounds when necessary to match changed
identifiers.

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

17 months agofreedreno: Reallocate on unshared export
Rob Clark [Tue, 30 May 2023 16:37:15 +0000 (09:37 -0700)]
freedreno: Reallocate on unshared export

If we need to export a handle on a resource which was not originally
allocated with PIPE_BIND_SHARED, then re-allocate with shared flag and
try again.

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

17 months agofreedreno: Add aux-context support
Rob Clark [Tue, 30 May 2023 17:20:53 +0000 (10:20 -0700)]
freedreno: Add aux-context support

A global aux-context can be created on-demand for cases where we need to
(for example) blit a resource when we only have a screen ptr.

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

17 months agofreedreno: Handle export error handling
Rob Clark [Tue, 30 May 2023 16:19:50 +0000 (09:19 -0700)]
freedreno: Handle export error handling

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

17 months agofreedreno/drm: Don't try to export suballoc bo
Rob Clark [Tue, 30 May 2023 16:15:07 +0000 (09:15 -0700)]
freedreno/drm: Don't try to export suballoc bo

Suballoc BOs don't have a real handle, so attempting to dmabuf export
won't work.  Likewise for handle or flink-name export.

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

17 months agonir/print: Print locations for geometry shader inputs
Alyssa Rosenzweig [Sat, 27 May 2023 18:32:46 +0000 (14:32 -0400)]
nir/print: Print locations for geometry shader inputs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23259>

17 months agointel/blorp: Use nir_trim_vector
Alyssa Rosenzweig [Fri, 26 May 2023 15:31:54 +0000 (11:31 -0400)]
intel/blorp: Use nir_trim_vector

With Coccinelle patch:

@@
expression b, V;
@@

-nir_vec2(b, nir_channel(b, V, 0), nir_channel(b, V, 1))
+nir_trim_vector(b, V, 2)

@@
expression b, V;
@@

-nir_vec3(b, nir_channel(b, V, 0), nir_channel(b, V, 1), nir_channel(b, V, 2))
+nir_trim_vector(b, V, 3)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23259>

17 months agoradv/query: Use nir_trim_vector
Alyssa Rosenzweig [Fri, 26 May 2023 15:31:40 +0000 (11:31 -0400)]
radv/query: Use nir_trim_vector

With Coccinelle patch:

@@
expression b, V;
@@

-nir_vec2(b, nir_channel(b, V, 0), nir_channel(b, V, 1))
+nir_trim_vector(b, V, 2)

@@
expression b, V;
@@

-nir_vec3(b, nir_channel(b, V, 0), nir_channel(b, V, 1), nir_channel(b, V, 2))
+nir_trim_vector(b, V, 3)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23259>

17 months agopan/lower_framebuffer: Use nir_replicate
Alyssa Rosenzweig [Fri, 26 May 2023 15:16:58 +0000 (11:16 -0400)]
pan/lower_framebuffer: Use nir_replicate

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23259>

17 months agotreewide: Use nir_replicate
Alyssa Rosenzweig [Fri, 26 May 2023 15:15:36 +0000 (11:15 -0400)]
treewide: Use nir_replicate

Via coccinelle.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23259>

17 months agonir/builder: Add nir_replicate helper
Alyssa Rosenzweig [Fri, 26 May 2023 15:10:58 +0000 (11:10 -0400)]
nir/builder: Add nir_replicate helper

Splat a scalar to all components of a vector.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23259>

17 months agoradeonsi: return kernel queried video capability for HEVC and JPEG
Veerabadhran Gopalakrishnan [Wed, 17 May 2023 06:54:40 +0000 (12:24 +0530)]
radeonsi: return kernel queried video capability for HEVC and JPEG

Query and return the values obtained from kernel for VCN_1 and above.
Earlier the HEVC and JPEG capabilities were returned based on
pre-defined values.

Signed-off-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23067>

17 months agoradeonsi: return kernel queried video capability for HEVC and JPEG
Veerabadhran Gopalakrishnan [Wed, 17 May 2023 06:54:40 +0000 (12:24 +0530)]
radeonsi: return kernel queried video capability for HEVC and JPEG

Query and return the values obtained from kernel for VCN_1 and above.
Earlier the HEVC and JPEG capabilities were returned based on
pre-defined values.

Signed-off-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23067>

17 months agogallivm: Fix gather/scatter types for newer llvm
Konstantin Seurer [Fri, 28 Apr 2023 21:15:48 +0000 (23:15 +0200)]
gallivm: Fix gather/scatter types for newer llvm

The types changed with opaque pointer support.

Fixes a bunch of lavapipe regressions.
Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23293>

17 months agodocs/calendar: add 23.2 branchpoint and release candidates
Eric Engestrom [Tue, 23 May 2023 20:42:13 +0000 (21:42 +0100)]
docs/calendar: add 23.2 branchpoint and release candidates

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

17 months agodocs: update calendar for 23.0.4
Dylan Baker [Tue, 30 May 2023 17:41:48 +0000 (10:41 -0700)]
docs: update calendar for 23.0.4

At this point I'm calling 23.0 done. Please use 23.1 for future updates

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

17 months agodocs: Add sha256 sum for 23.0.4
Dylan Baker [Tue, 30 May 2023 17:39:19 +0000 (10:39 -0700)]
docs: Add sha256 sum for 23.0.4

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

17 months agodocs: add release notes for 23.0.4
Dylan Baker [Tue, 30 May 2023 17:11:32 +0000 (10:11 -0700)]
docs: add release notes for 23.0.4

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

17 months agomicrosoft/compiler: Use image formats to determine texture types
Jesse Natalie [Fri, 26 May 2023 17:41:27 +0000 (10:41 -0700)]
microsoft/compiler: Use image formats to determine texture types

Fixes some tests when bindless is disabled, where the image format is
R32, we do atomics on it, but we didn't set the "typed UAV load with
additional formats" feature bit because when we loaded from it, we
only loaded one component. Since the image format on the DXIL side
was declared as U32x4, the DXIL validator said that we should have.

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

17 months agospirv2dxil: Assign formats to image vars before lowering to bindless
Jesse Natalie [Mon, 29 May 2023 02:53:52 +0000 (19:53 -0700)]
spirv2dxil: Assign formats to image vars before lowering to bindless

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

17 months agomicrosoft/compiler: Add a pass to assign image formats based on number of components
Jesse Natalie [Fri, 26 May 2023 17:37:48 +0000 (10:37 -0700)]
microsoft/compiler: Add a pass to assign image formats based on number of components

For loads/stores without formats, let's guess one based on how it's used.
The actual format doesn't matter, we just want to use it for the number
of components it has.

Also copy image formats from variables to intrinsics, to ensure that
deref-based intrinsics have formats assigned and lowered intrinsics
are up to date.

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

17 months agomicrosoft/compiler: Enable emitting type info for textures with <4 comps
Jesse Natalie [Fri, 26 May 2023 17:37:04 +0000 (10:37 -0700)]
microsoft/compiler: Enable emitting type info for textures with <4 comps

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

17 months agoradv/amdgpu: Report 48-bit VAs in bo logs.
Hans-Kristian Arntzen [Fri, 26 May 2023 13:11:31 +0000 (15:11 +0200)]
radv/amdgpu: Report 48-bit VAs in bo logs.

More ergonomic when correlating with page fault addresses.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23256>

17 months agoradv: fix gl_SampleMaskIn for sample shading
Chia-I Wu [Fri, 26 May 2023 05:36:51 +0000 (22:36 -0700)]
radv: fix gl_SampleMaskIn for sample shading

When sample shading, we need

  gl_SampleMaskIn = SampleCoverage & (PsIterMask << gl_SampleID);

Add a new shader arg, ps_iter_mask, to pass PsIterMask to ps.

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

17 months agoac, radeonsi: add and use ac_get_ps_iter_mask
Chia-I Wu [Fri, 26 May 2023 06:11:54 +0000 (23:11 -0700)]
ac, radeonsi: add and use ac_get_ps_iter_mask

It is more natural for ac_get_ps_iter_mask to take sample count.
Replace samplemask_log_ps_iter by ps_iter_smples in
ac_nir_lower_ps_options accordingly.

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

17 months agoaco: fix alignment check in emit_load
Chia-I Wu [Thu, 25 May 2023 21:01:44 +0000 (14:01 -0700)]
aco: fix alignment check in emit_load

align_offset already takes const_offset into consideration.  Remove the
adjustment.

Fixes: 542733dbbf7 ("aco: add emit_load helper")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9097
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23242>

17 months agoanv: remove unused functions
Lionel Landwerlin [Tue, 30 May 2023 13:29:56 +0000 (16:29 +0300)]
anv: remove unused functions

I thought I removed those, it seems my rebase got screwed up :(

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 64f20cec28 ("anv: prepare image/buffer views for non indirect descriptors")
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23317>

17 months agoanv: add support for VK_EXT_dynamic_rendering_unused_attachments
Lionel Landwerlin [Tue, 2 May 2023 17:44:16 +0000 (20:44 +0300)]
anv: add support for VK_EXT_dynamic_rendering_unused_attachments

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23294>

17 months agozink: do not lower line-smooth for non-lines
Erik Faye-Lund [Fri, 26 May 2023 08:53:47 +0000 (10:53 +0200)]
zink: do not lower line-smooth for non-lines

We used to do this correctly, but it seems this accidentally got
dropped.

Fixes: d80a35a7f76 ("zink: unified `zink_set_primitive_emulation_keys` and `zink_create_primitive_emulation_gs`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23316>

17 months agozink: compute correct location for line-smooth gs
Erik Faye-Lund [Fri, 26 May 2023 07:48:56 +0000 (09:48 +0200)]
zink: compute correct location for line-smooth gs

The GS and the FS needs to agree on the driver_location. But we just
used the num_outputs variable for the GS instead of matching the logic
from lower_aaline_instr in nir_draw_helpers.c.

This does that, but cleans up our copy slightly to avoid computing the
needless location, as well as using unsigned values.

This used to *mostly* work before, but only because we were lucky and
not too much crazy stuff went on with the inputs / outputs in
smooth-line cases.

Fixes: edecb66b018 ("nir: avoid generating conflicting output variables")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23316>

17 months agozink: keep gl46_optimal extensions/features sorted
Erik Faye-Lund [Tue, 30 May 2023 10:15:00 +0000 (12:15 +0200)]
zink: keep gl46_optimal extensions/features sorted

These are mostly sorted, which makes it easy to know where to insert new
stuff. Let's make them completely sorted.

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

17 months agozink: explicitly avoid ci errors due to unrecognized extensions in VVL
Mike Blumenkrantz [Tue, 30 May 2023 13:13:56 +0000 (09:13 -0400)]
zink: explicitly avoid ci errors due to unrecognized extensions in VVL

lavapipe still had this from shader object, but this should always be in
place for all drivers so that old VVL doesn't block merges

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

17 months agozink: update profiles schema
Erik Faye-Lund [Tue, 30 May 2023 09:43:25 +0000 (11:43 +0200)]
zink: update profiles schema

We technically need the 251 version, but the schema for that version
is not released yet, so this is the best we can do.

See https://github.com/KhronosGroup/Vulkan-Profiles/issues/437

This gets rid of some JSON schema-validation warnings.

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

17 months agonir/opt_if: use nir_alu_instr_is_comparison directly
Georg Lehmann [Sun, 28 May 2023 07:12:46 +0000 (09:12 +0200)]
nir/opt_if: use nir_alu_instr_is_comparison directly

Since 2d6233d0 ("nir: Check all sizes in nir_alu_instr_is_comparison"),
nir_alu_instr_is_comparison already returns true for comparisons with 32bit
result.

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