platform/upstream/mesa.git
13 months agobroadcom: Fix slice memory allocation logic for compressed textures
Lucas Fryzek [Fri, 19 May 2023 15:40:51 +0000 (11:40 -0400)]
broadcom: Fix slice memory allocation logic for compressed textures

Compressed textures require their width and height padding to be
calculated based on the number of blocks in the image. This change ensures
that the number of blocks in the texture is a POT for mip levels > 1.

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

13 months agobroadcom: Add support for VK_FORMAT_A2R10G10B10_UNORM_PACK32
Lucas Fryzek [Fri, 5 May 2023 18:44:50 +0000 (14:44 -0400)]
broadcom: Add support for VK_FORMAT_A2R10G10B10_UNORM_PACK32

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

13 months agodocs: update calendar for 23.1.0
Eric Engestrom [Tue, 23 May 2023 20:27:55 +0000 (21:27 +0100)]
docs: update calendar for 23.1.0

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

13 months agodocs: add release notes for 23.1.0
Eric Engestrom [Tue, 23 May 2023 20:22:03 +0000 (21:22 +0100)]
docs: add release notes for 23.1.0

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

13 months agodxil: Rely on scoped_barrier
Alyssa Rosenzweig [Tue, 23 May 2023 17:44:11 +0000 (13:44 -0400)]
dxil: Rely on scoped_barrier

We don't get non-scoped barriers. Don't handle them.

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

13 months agoac/nir: fix slots in clamping legacy colors
Filip Gawin [Tue, 23 May 2023 09:25:01 +0000 (11:25 +0200)]
ac/nir: fix slots in clamping legacy colors

fixes: 7c41cdb81f564ef52404e5f313ccfe2d723896e6

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23178>

13 months agolavapipe: VK_EXT_pageable_device_local_memory
Mike Blumenkrantz [Wed, 17 May 2023 12:37:49 +0000 (08:37 -0400)]
lavapipe: VK_EXT_pageable_device_local_memory

the memory guarantees of this extension should be implicit to linux systems

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

13 months agolavapipe: store memory allocation size onto lvp_device_memory
Mike Blumenkrantz [Wed, 17 May 2023 12:36:32 +0000 (08:36 -0400)]
lavapipe: store memory allocation size onto lvp_device_memory

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

13 months agolavapipe: EXT_memory_priority
Mike Blumenkrantz [Wed, 17 May 2023 12:26:24 +0000 (08:26 -0400)]
lavapipe: EXT_memory_priority

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

13 months agolavapipe: EXT_memory_budget
Mike Blumenkrantz [Wed, 17 May 2023 11:47:06 +0000 (07:47 -0400)]
lavapipe: EXT_memory_budget

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

13 months agolavapipe: report full memory in heap for 64bit processes
Mike Blumenkrantz [Wed, 17 May 2023 11:46:12 +0000 (07:46 -0400)]
lavapipe: report full memory in heap for 64bit processes

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

13 months agolavapipe: bump memory allocation heap to 3GiB
Mike Blumenkrantz [Wed, 17 May 2023 11:33:38 +0000 (07:33 -0400)]
lavapipe: bump memory allocation heap to 3GiB

this should still be a safe limit on all systems and archs

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

13 months agoutil: mark externally-unused functions as static
Erik Faye-Lund [Sun, 21 May 2023 15:08:54 +0000 (17:08 +0200)]
util: mark externally-unused functions as static

These functions aren't used outside of sha1.c, so let's remove the
prototypes from the header-file, and mark the definitions as static.

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

13 months agofrontends/va: remove private member and update target buffer
Ruijing Dong [Tue, 16 May 2023 15:47:09 +0000 (11:47 -0400)]
frontends/va: remove private member and update target buffer

use update_decoder_target to update the target buffer to
let decoder obtain correct reference frame.

remove the previous logic which failed to update reference
info in time.

fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8996
fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8387
Cc: mesa-stable
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23061>

13 months agoradeonsi/vcn: apply update_decoder_target logic
Ruijing Dong [Tue, 23 May 2023 13:52:40 +0000 (09:52 -0400)]
radeonsi/vcn: apply update_decoder_target logic

implement update_decoder_target and
remove corresponding obsolete logic.

Cc: mesa-stable
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23061>

13 months agogallium/pipe: add interface update_decoder_target
Ruijing Dong [Tue, 23 May 2023 13:47:59 +0000 (09:47 -0400)]
gallium/pipe: add interface update_decoder_target

reason:
decoder uses the target buffer address in record
to indentify the reference frames. When target
buffer has changed outside of decoding process,
it has to be updated back to decoder, otherwise
the outdated reference will cause image corruption.

Cc: mesa-stable
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23061>

13 months agoci: reenable lavapipe
Dave Airlie [Tue, 2 May 2023 20:42:36 +0000 (06:42 +1000)]
ci: reenable lavapipe

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

13 months agoutil: move check for AVX512
Ryan Houdek [Mon, 22 May 2023 20:58:56 +0000 (22:58 +0200)]
util: move check for AVX512

As a side effect solve:
```
[91/1401] Compiling C object src/util/libmesa_util.a.p/u_cpu_detect.c.o
../src/util/u_cpu_detect.c: In function '_util_cpu_detect_once':
../src/util/u_cpu_detect.c:889:11: warning: 'regs2[2]' may be used uninitialized [-Wmaybe-uninitialized]
  889 |       if (((regs2[2] >> 27) & 1) && // OSXSAVE
      |           ^~~~~~~~~~~~~~~~~~~~~~
../src/util/u_cpu_detect.c:823:16: note: 'regs2[2]' was declared here
  823 |       uint32_t regs2[4];
      |                ^~~~~
```

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

13 months agoutil/bitset: ensure the sets compared have the same size at compile time
Eric Engestrom [Mon, 22 May 2023 18:51:15 +0000 (19:51 +0100)]
util/bitset: ensure the sets compared have the same size at compile time

Instead of checking this at run time.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23171>

13 months agoci: only execute capture-devcoredump.sh when it's present
Eric Engestrom [Fri, 12 May 2023 15:46:34 +0000 (16:46 +0100)]
ci: only execute capture-devcoredump.sh when it's present

Avoids this error:

    ./install/common/init-stage2.sh: line 130: /capture-devcoredump.sh: No such file or directory

One step closer to an error-free CI and being able to `set -e`.

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

13 months agolvp: use stage iterator macros instead of explicit loops
Dave Airlie [Fri, 19 May 2023 00:29:23 +0000 (10:29 +1000)]
lvp: use stage iterator macros instead of explicit loops

This cleans up the compute checks

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agolvp: use stage mask
Dave Airlie [Fri, 19 May 2023 00:21:38 +0000 (10:21 +1000)]
lvp: use stage mask

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agogallivm/nir: refactor the local invocation index calc.
Dave Airlie [Wed, 17 May 2023 03:12:32 +0000 (13:12 +1000)]
gallivm/nir: refactor the local invocation index calc.

This is needed elsewhere for mesh shaders.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agogallivm: fix whitespace in get_deref_offset
Dave Airlie [Wed, 17 May 2023 01:26:53 +0000 (11:26 +1000)]
gallivm: fix whitespace in get_deref_offset

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agolvp: explictly skip compute shader stage.
Dave Airlie [Tue, 16 May 2023 21:09:44 +0000 (07:09 +1000)]
lvp: explictly skip compute shader stage.

To add mesh/task later we have to loop over more stages the other side
of compute. So explicitly skip compute for now.

This has a couple of subtle bits to it, and I think there might be a bug
in pre rast

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agolavapipe: add lavapipe specific shader stages define.
Dave Airlie [Tue, 16 May 2023 20:56:36 +0000 (06:56 +1000)]
lavapipe: add lavapipe specific shader stages define.

This currently does nothing, but we need to increase this to add
task/mesh later.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agollvmpipe/cs: support passing a csctx instead of using implicit one
Dave Airlie [Tue, 16 May 2023 20:50:30 +0000 (06:50 +1000)]
llvmpipe/cs: support passing a csctx instead of using implicit one

This is just some refactoring to make adding mesh shaders easier

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agollvmpipe/cs: start making variant generator less compute specific
Dave Airlie [Tue, 16 May 2023 20:48:04 +0000 (06:48 +1000)]
llvmpipe/cs: start making variant generator less compute specific

This is just some refactoring prior to task/mesh shaders

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agollvmpipe: convert a bunch of shader_type ifs to switches.
Dave Airlie [Tue, 16 May 2023 20:42:32 +0000 (06:42 +1000)]
llvmpipe: convert a bunch of shader_type ifs to switches.

This makes it easier to add mesh shader support later

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agogallivm/draw: refactor vertex header jit type out
Dave Airlie [Tue, 16 May 2023 20:23:50 +0000 (06:23 +1000)]
gallivm/draw: refactor vertex header jit type out

mesh shaders will want access to this as well so start moving it to
common code.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23065>

13 months agovirgl/ci: uprev virglrenderer
Gert Wollny [Tue, 23 May 2023 04:32:43 +0000 (06:32 +0200)]
virgl/ci: uprev virglrenderer

Update DEBIAN_BASE_TAG and KERNEL_ROOTFS_TAG

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23121>

13 months agovirgl: Add support for ARB_pipeline_statistics
Gert Wollny [Fri, 19 May 2023 05:44:31 +0000 (07:44 +0200)]
virgl: Add support for ARB_pipeline_statistics

v2: make sure the PIPE enums map corretly to the VIRGL enums (Tintou)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23121>

13 months agovirgl: Make query result resource as dirty before requesting result
Gert Wollny [Tue, 23 May 2023 07:52:13 +0000 (09:52 +0200)]
virgl: Make query result resource as dirty before requesting result

The query result resource will be written to by the host, so we have to
declare it as dirty if we want to see the change.

Fixes: 9279a28f0 (virgl: ARB_query_buffer_object support)

v2: Update expectations in CI

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23121>

13 months agorusticl/device: implement cl_khr_device_uuid
norablackcat [Sat, 20 May 2023 15:06:02 +0000 (09:06 -0600)]
rusticl/device: implement cl_khr_device_uuid

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Andrey Alekseenko <al42and@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23147>

13 months agorusticl/screen: implement uuid wrapper funcs
norablackcat [Sat, 20 May 2023 15:05:36 +0000 (09:05 -0600)]
rusticl/screen: implement uuid wrapper funcs

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Andrey Alekseenko <al42and@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23147>

13 months agorusticl/spirv: skip printing info messages
Karol Herbst [Wed, 17 May 2023 23:22:51 +0000 (01:22 +0200)]
rusticl/spirv: skip printing info messages

Those are quite spammy and add no value.

Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23091>

13 months agointel/fs: fix size_read() for LOAD_PAYLOAD
Lionel Landwerlin [Fri, 19 May 2023 08:10:01 +0000 (11:10 +0300)]
intel/fs: fix size_read() for LOAD_PAYLOAD

With Anv/Zink, the piglit test :

  arb_shader_storage_buffer_object-max-ssbo-size -auto -fbo fsexceed

is failing validation after copy propagation :

load_payload(8) vgrf15:F, vgrf1+0.12<0>:F, vgrf1+0.0<0>:F, vgrf1+0.4<0>:F, vgrf1+0.8<0>:F, vgrf1+0.12<0>:F
../src/intel/compiler/brw_fs_validate.cpp:191: A <= B failed
  A = inst->src[i].offset / REG_SIZE + regs_read(inst, i) = 2
  B = alloc.sizes[inst->src[i].nr] = 1

In most cases it works because src[0] would be at offset 0 and so
reading a full reg passes validation, but Anv/Zink started emitting
slightly different code adding an offset maybe the size read 2 GRFs.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23126>

13 months agonir: Fix serializing pointer initializers.
Tatsuyuki Ishi [Fri, 7 Apr 2023 09:34:17 +0000 (18:34 +0900)]
nir: Fix serializing pointer initializers.

Found by manual inspection.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 7acc81056f7 ("compiler/nir: Add support for variable initialization from a pointer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22355>

13 months agoci: disable anholt's farm
Eric Engestrom [Tue, 23 May 2023 11:35:18 +0000 (12:35 +0100)]
ci: disable anholt's farm

Its http cache proxy has been returning `curl: (52) Empty reply from
server` for a while and rebooting it didn't help, so turn it off for now.

Suggested-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Eric Engestrom <eric@igalia.com>
13 months agov3d: remove v3d_get_internal_type_bpp_for_output_format
Alejandro Piñeiro [Mon, 22 May 2023 22:20:11 +0000 (00:20 +0200)]
v3d: remove v3d_get_internal_type_bpp_for_output_format

This is a one-line wrapper, so let's just use the v3d_X or v3dX macros
instead.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23172>

13 months agov3d: remove v3d_tfu_supports_tex_format
Alejandro Piñeiro [Mon, 22 May 2023 22:11:58 +0000 (00:11 +0200)]
v3d: remove v3d_tfu_supports_tex_format

This is a one-line wrapper, so let's just use the v3d_X or v3dX macros
instead.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23172>

13 months agov3d: remove v3d_create_texture_shader_state_bo
Alejandro Piñeiro [Mon, 22 May 2023 22:06:45 +0000 (00:06 +0200)]
v3d: remove v3d_create_texture_shader_state_bo

This is a one-line wrapper, so let's just use the v3d_X or v3dX macros
instead.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23172>

13 months agov3d: use more an auxiliar devinfo
Alejandro Piñeiro [Mon, 22 May 2023 21:39:10 +0000 (23:39 +0200)]
v3d: use more an auxiliar devinfo

Improve readability by using an auxiliar
        struct v3d_device_info *devinfo = &screen->devinfo;

this was triggered by the use of the v3d_X macro, where just having a
devinfo makes is more friendly. As we are here, we used it on other
places of the code.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23172>

14 months agov3dv: simplify too small Z viewport scale workaround
Iago Toral Quiroga [Wed, 20 Oct 2021 09:25:23 +0000 (11:25 +0200)]
v3dv: simplify too small Z viewport scale workaround

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

14 months agov3dv/pipeline: don't prepack up early-z configuration
Alejandro Piñeiro [Wed, 23 Jun 2021 21:57:52 +0000 (23:57 +0200)]
v3dv/pipeline: don't prepack up early-z configuration

False (so zero) is already the default value, so those prepacks are
basically superfluous.

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

14 months agov3d/ci: make traces test mandatory
Juan A. Suarez Romero [Fri, 19 May 2023 09:53:54 +0000 (11:53 +0200)]
v3d/ci: make traces test mandatory

Similar to other drivers, let's run always the traces tests.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23135>

14 months agov3d/ci: run GPU piglit profile
Juan A. Suarez Romero [Fri, 19 May 2023 09:52:18 +0000 (11:52 +0200)]
v3d/ci: run GPU piglit profile

Instead of running all the tests, run only the GPU related ones, which
should make the CI faster.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23135>

14 months agoradv: apply a bug workaround for smoothing on GFX6
Samuel Pitoiset [Mon, 22 May 2023 10:51:45 +0000 (12:51 +0200)]
radv: apply a bug workaround for smoothing on GFX6

This fixes smooth lines on GFX6.

Fixes: 85cbdba3559 ("radv: add support for smooth lines")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23168>

14 months agozink: infer types from load_const instrs to avoid more bitcasts
Mike Blumenkrantz [Wed, 10 May 2023 12:51:10 +0000 (08:51 -0400)]
zink: infer types from load_const instrs to avoid more bitcasts

this walks to uses list for the ssa def to infer a type from one of the
uses to reduce the need to bitcast

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

14 months agozink: store and use alu types for ntv defs
Mike Blumenkrantz [Tue, 9 May 2023 15:26:04 +0000 (11:26 -0400)]
zink: store and use alu types for ntv defs

this adds indexing for ssa/reg defs with the accompanying current
type of a given def (inaccurate for objects but whatever), enabling
that type to be used directly in order to avoid bitcasts in some places

this upends the assumption that all stored srcs are uint type

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

14 months agozink: dynamically emit non-bool register values using local_vars spirv buffer
Mike Blumenkrantz [Tue, 9 May 2023 19:11:33 +0000 (15:11 -0400)]
zink: dynamically emit non-bool register values using local_vars spirv buffer

this will be useful in a future commit

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

14 months agozink: write out register variables to a separate spirv buffer
Mike Blumenkrantz [Tue, 9 May 2023 18:35:15 +0000 (14:35 -0400)]
zink: write out register variables to a separate spirv buffer

this will enable registers to be written more dynamically with correct
type values to cut down on bitcasts

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

14 months agozink: manually memcpy the spirv instruction buffer
Mike Blumenkrantz [Tue, 9 May 2023 18:29:02 +0000 (14:29 -0400)]
zink: manually memcpy the spirv instruction buffer

no functional changes

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

14 months agozink: move get_alu_type() up in file
Mike Blumenkrantz [Tue, 9 May 2023 15:24:30 +0000 (11:24 -0400)]
zink: move get_alu_type() up in file

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

14 months agozink: use void return for store_dest
Mike Blumenkrantz [Tue, 9 May 2023 15:20:11 +0000 (11:20 -0400)]
zink: use void return for store_dest

not sure why this had returns, but it doesn't seem necessary

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

14 months agozink: delete unnecessary bitcast in load_shared/scratch
Mike Blumenkrantz [Tue, 9 May 2023 14:37:28 +0000 (10:37 -0400)]
zink: delete unnecessary bitcast in load_shared/scratch

if the mem is loaded as uint and stored as uint, then
the loaded and stored value must be uint, so a bitcast to uint
is as pointless as this commit message

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

14 months agozink: also declare int size caps inline with signed int type usage
Mike Blumenkrantz [Thu, 11 May 2023 13:35:39 +0000 (09:35 -0400)]
zink: also declare int size caps inline with signed int type usage

Fixes: 854fd242faf ("zink: declare int/float size caps inline with type usage")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22934>

14 months agozink: promote flushed clears to unordered cmdbuf when possible
Mike Blumenkrantz [Tue, 16 May 2023 14:03:28 +0000 (10:03 -0400)]
zink: promote flushed clears to unordered cmdbuf when possible

this reuses the unordered_blitting codepath for fb clears

for #9016

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

14 months agovk/graphics_state: handle null pipeline state structs in creation
Mike Blumenkrantz [Tue, 18 Apr 2023 13:18:55 +0000 (09:18 -0400)]
vk/graphics_state: handle null pipeline state structs in creation

when these members are null, the corresponding graphics states should be
initialized with sensible default values

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

14 months agoanv: more correctly handle null pipeline states
Mike Blumenkrantz [Fri, 31 Mar 2023 12:39:04 +0000 (08:39 -0400)]
anv: more correctly handle null pipeline states

it's not necessary to check whether dynamic states are set before
the null checks since any issues there would be VU errors

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

14 months agolavapipe: more correctly handle null pipeline states
Mike Blumenkrantz [Fri, 31 Mar 2023 12:39:04 +0000 (08:39 -0400)]
lavapipe: more correctly handle null pipeline states

it's not necessary to check whether dynamic states are set before
the null checks since any issues there would be VU errors

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

14 months agozink: flag 'has_work' on batch when promoting a cmd
Mike Blumenkrantz [Mon, 15 May 2023 13:24:48 +0000 (09:24 -0400)]
zink: flag 'has_work' on batch when promoting a cmd

has_work controls whether a flush can be deferred, i.e., when unset
a flush may be deferred

since a promoted cmd must still be flushed to take effect, ensure this
is always set when promoted cmds are pending

cc: mesa-stable

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

14 months agozink: explicitly disable promotion on images that are both unflushed and non-reorderable
Mike Blumenkrantz [Mon, 15 May 2023 11:56:50 +0000 (07:56 -0400)]
zink: explicitly disable promotion on images that are both unflushed and non-reorderable

until #9016 is resolved, be more cautious and consider any image with unflushed
access as un-promotable to avoid layout desync

affects:
KHR-GLES3.packed_pixels.varied_rectangle.rgb

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

14 months agozink: explicitly disable reordering after restricted swapchain readback blits
Mike Blumenkrantz [Mon, 15 May 2023 11:26:01 +0000 (07:26 -0400)]
zink: explicitly disable reordering after restricted swapchain readback blits

when needs_present_readback is set, reordering is disabled without hitting
the path that would normally disable promotion for the resource, so this
needs to be changed manually to avoid layout desync on the swapchain

cc: mesa-stable

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

14 months agozink: disable unordered blits when swapchain images need aqcuire
Mike Blumenkrantz [Mon, 15 May 2023 11:24:02 +0000 (07:24 -0400)]
zink: disable unordered blits when swapchain images need aqcuire

this is consistent with other cmdbuf reordering for blits

Fixes: 3a9f7d70383 ("zink: implement unordered u_blitter calls")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23035>

14 months agozink: track/check submit info on resource batch usage
Mike Blumenkrantz [Fri, 12 May 2023 16:26:52 +0000 (12:26 -0400)]
zink: track/check submit info on resource batch usage

resources use a private refcount to avoid overhead from atomics on
descriptor binds, but this has the side effect of evading batch usage,
meaning that the usage may not be properly removed once the batch state
is reset, which will cause issues with detecting whether usage exists
for a given resource

to fix this, the mechanism for tc fence disambiguation can be reused,
namely adding the batch state's submit count to the usage info and
then using that to add a second set of comparisons such that it becomes
possible to check both whether the batch usage for a resource matches
a given batch AND whether the batch usage is the current state of the
batch

affects:
KHR-GLES3.copy_tex_image_conversions.required.cubemap_posy_cubemap_negz

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

14 months agozink: move batch usage to substruct on zink_bo objects
Mike Blumenkrantz [Fri, 12 May 2023 16:25:41 +0000 (12:25 -0400)]
zink: move batch usage to substruct on zink_bo objects

no functional changes

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

14 months agozink: move zink_batch_state::submit_count to zink_batch_usage
Mike Blumenkrantz [Fri, 12 May 2023 16:11:12 +0000 (12:11 -0400)]
zink: move zink_batch_state::submit_count to zink_batch_usage

no functional changes

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

14 months agozink: use batch usage function for a simple case
Mike Blumenkrantz [Fri, 12 May 2023 16:10:27 +0000 (12:10 -0400)]
zink: use batch usage function for a simple case

no functional changes

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

14 months agozink: add special-casing for (not) reordering certain image barriers
Mike Blumenkrantz [Fri, 12 May 2023 14:21:31 +0000 (10:21 -0400)]
zink: add special-casing for (not) reordering certain image barriers

in a scenario where an ordered read op occurs for an image,
successive read-only barriers SHOULD be able to be promoted

...but they can't, because there isn't yet a mechanism for handling layout
transitions between the unordered cmdbuf and the ordered cmdbuf,
meaning that promoting e.g., a SHADER_READ_ONLY barrier after a TRANSFER_SRC
barrier will leave the image with the wrong layout for the transfer op:

TRANSFER_SRC(unordered) -> COPY(ordered) -> SHADER_READ_ONLY(unordered)

becomes

TRANSFER_SRC(unordered) -> SHADER_READ_ONLY(unordered) -> COPY(ordered)

ideally I'll get around to figuring this out at some point

affects:
dEQP-GLES31.functional.copy_image.non_compressed.viewclass_32_bits.r32i_r32i.texture2d_array_to_renderbuffer

Fixes: bf0af0f8ede ("zink: move all barrier-related functions to c++")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23035>

14 months agoiris: Use known formats for tex_cache_flush_hack
Nanley Chery [Sat, 13 May 2023 00:04:40 +0000 (17:04 -0700)]
iris: Use known formats for tex_cache_flush_hack

Instead of using ISL_FORMAT_UNSUPPORTED, use the known format to avoid
extra cache flushes.

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

14 months agointel/blorp: Add and use blorp_copy_get_formats
Nanley Chery [Mon, 8 May 2023 23:33:54 +0000 (16:33 -0700)]
intel/blorp: Add and use blorp_copy_get_formats

This is useful for iris to know what formats will be used for copy
operations.

The new function introduces a couple refactors. It makes use of the
ISL_GFX_VER() macro and it also makes more use of the
isl_surf_usage_is_depth() function.

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

14 months agointel/blorp: Change condition for CCS_E copy formats
Nanley Chery [Mon, 8 May 2023 22:12:38 +0000 (15:12 -0700)]
intel/blorp: Change condition for CCS_E copy formats

In blorp_copy, instead of checking if the surface's aux-usage is CCS_E,
check if its format supports CCS_E.

ISL won't report that a surface supports CCS_E if its format doesn't, so
this should strictly widen the scope of surfaces included in this path.

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

14 months agointel/blorp: Add depth usage check for copy format
Nanley Chery [Mon, 8 May 2023 22:25:12 +0000 (15:25 -0700)]
intel/blorp: Add depth usage check for copy format

We will soon update the CCS_E aux-usage check to a CCS_E format check.
Since depth formats support CCS_E on gfx12+, add another check for the
depth usage to prevent depth surfaces from falling into the CCS_E copy
format case.

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

14 months agointel/blorp: Use the depth copy format more on BDW+
Nanley Chery [Mon, 8 May 2023 23:22:20 +0000 (16:22 -0700)]
intel/blorp: Use the depth copy format more on BDW+

Sampling with HiZ is introduced on BDW+. For BLORP copies, instead of
using the depth format when the source uses HiZ, use it for all depth
sampling on BDW+.

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

14 months agoradv: do not use a pipe offset for aliased images
Chia-I Wu [Fri, 19 May 2023 22:59:53 +0000 (15:59 -0700)]
radv: do not use a pipe offset for aliased images

Fixes dEQP-VK.ycbcr.plane_view.memory_alias.* on raven2.

Fixes: 1c065650260 ("radv: expose disjoint image support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23143>

14 months agoac/surface: print tile_swizzle as well
Chia-I Wu [Fri, 19 May 2023 22:30:33 +0000 (15:30 -0700)]
ac/surface: print tile_swizzle as well

swizzle modes that are *_X or *_T depend on tile_swizzle.

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

14 months agoamd/drm-shim: add raven2
Chia-I Wu [Fri, 19 May 2023 22:29:19 +0000 (15:29 -0700)]
amd/drm-shim: add raven2

It differs from raven in interesting ways (e.g., GB_ADDR_CONFIG).

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

14 months agopanfrost: expose PIPE_CAP_POLYGON_OFFSET_CLAMP
Erik Faye-Lund [Mon, 22 May 2023 11:43:18 +0000 (13:43 +0200)]
panfrost: expose PIPE_CAP_POLYGON_OFFSET_CLAMP

This gives us ARB_polygon_offset_clamp and EXT_polygon_offset_clamp, and
most of the actual state plumbing was already in place.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23169>

14 months agomesa/st: Set pipe_shader_image::single_layer_view
Alyssa Rosenzweig [Fri, 19 May 2023 21:52:17 +0000 (17:52 -0400)]
mesa/st: Set pipe_shader_image::single_layer_view

Pass it through from the API.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23142>

14 months agogallium: Add pipe_image_view::single_layer_view
Alyssa Rosenzweig [Fri, 19 May 2023 21:46:08 +0000 (17:46 -0400)]
gallium: Add pipe_image_view::single_layer_view

OpenGL has a goofy feature that allows creating an image view of a single layer
of an array texture... in which case that image is treated as non-arrayed in
shader. If you have a 16x16x16 3D texture and bind the third layer, you get a
16x16 2D texture instead of a 16x16x1 3D texture. That distinction matters to
the hardware on AGX, since the texture dimension needs to match between the
shader and the pipe_image_view. If the shader is going to use image2D, we need
to know that the pipe_image_view should be treated as 2D (even though the
underlying resource is 3D).

"But, Alyssa, we already have first_layer and last_layer. Surely you can just
check if first_layer == last_layer?" you ask. The problem is that doesn't
distinguish a 16x16x1 3D texture (accessed as image3D in the shader) from a
16x16 slice (accessed as image2D in the shader) of a 16x16x16 3D texture. To
solve, we add a boolean flag indicating we want to create a view (with a lower
dimension than the underlying resource). This provides an unambiguous way to
communicate this case to drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23142>

14 months agoradv/ci: switch to b2c v0.9.10
Martin Roukala (né Peres) [Mon, 22 May 2023 13:18:57 +0000 (16:18 +0300)]
radv/ci: switch to b2c v0.9.10

This brings a fix for the steam decks which may boot too fast sometimes,
and have the network adapter not being enumerated by the time it tries
to connect to the gateway...

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23170>

14 months agomesa/spirv: Provide more specific error message for glSpecializeShader()
Caio Oliveira [Thu, 11 May 2023 22:36:55 +0000 (15:36 -0700)]
mesa/spirv: Provide more specific error message for glSpecializeShader()

Distinguish between the "entry point not found" and "parsing error"
cases in the error text.  For consistency, identify the unhandled
specialization index case as part of the verification function.

The verification function was renamed to make clearer its scope and
what module it belongs.

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

14 months agopan/mdg: Use nir_lower_image_atomics_to_global
Alyssa Rosenzweig [Fri, 19 May 2023 02:59:53 +0000 (22:59 -0400)]
pan/mdg: Use nir_lower_image_atomics_to_global

We were already lowering image atomics to lea_image + global atomic. It's a lot
nicer to make that lowering explicit in the NIR. This is much bigger win than in
the Bifrost compiler since here lea_image is used only for atomics, and here it
wasn't well abstracted in the compiler.

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

14 months agopan/bi: Use nir_lower_image_atomics_to_global
Alyssa Rosenzweig [Fri, 19 May 2023 02:44:18 +0000 (22:44 -0400)]
pan/bi: Use nir_lower_image_atomics_to_global

We were already lowering image atomics to lea_attr_tex + global atomic, might as
well make that lowering explicit in the NIR.

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

14 months agopan/bi: Fix atomic exchange on Valhall
Alyssa Rosenzweig [Fri, 19 May 2023 02:56:11 +0000 (22:56 -0400)]
pan/bi: Fix atomic exchange on Valhall

Copypaste fail when switching to unified atomics, missed becuase I don't have
any Valhall hardware and Valhall isn't in CI. (Good news, that means it probably
didn't affect anyone in the mean time :-p)

Fixes crashes with lots of dEQP-GLES31 tests observed under drm-shim.

Fixes: e258083e072 ("pan/bi: Use unified atomics")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23120>

14 months agonir: Add pass to lower image atomics
Alyssa Rosenzweig [Fri, 19 May 2023 03:20:15 +0000 (23:20 -0400)]
nir: Add pass to lower image atomics

Hardware that lacks dedicated image atomics can still implement image atomics
with regular atomics on global memory, as long as there is a way to get the
address of a texel in memory. I've open-coded this lowering in my first 2
compilers, so before I add another crappy vendored version in my 3rd, let's add
a common NIR pass to do the lowering.

Thanks to unified atomics, the pass itself is fairly concise.

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

14 months agonir: Add image_texel_address intrinsics
Alyssa Rosenzweig [Fri, 19 May 2023 03:16:55 +0000 (23:16 -0400)]
nir: Add image_texel_address intrinsics

Some hardware has an instruction to load the address of a texel in a writeable
image, given the coordinates ("LEA_IMAGE"). This operation is defined only for
uncompressed images, but it is well-defined regardless of the underlying
twiddling. As such, it is not expected to be produced by APIs but is useful for
internal lowering when it is known that images will be uncompressed (e.g.
because image_store does not support compression on the hardware).

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

14 months agonir: Document extra image source
Alyssa Rosenzweig [Fri, 19 May 2023 01:45:45 +0000 (21:45 -0400)]
nir: Document extra image source

I was scratching my head about this for a few minutes until I found the answer
in spirv_to_nir. Hopefully this saves someone else some head scratching in turn.

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

14 months agodocs: use meson instead invoking ninja directly
David Heidelberg [Fri, 19 May 2023 10:20:56 +0000 (12:20 +0200)]
docs: use meson instead invoking ninja directly

This approach is available since meson 0.47.0 which we depend on.

Reviewed-by: Sergi Blanch-Torné <sergi.blanch.torne@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23127>

14 months agozink: try update fb resource refs when starting new renderpass
Mike Blumenkrantz [Fri, 19 May 2023 14:27:25 +0000 (10:27 -0400)]
zink: try update fb resource refs when starting new renderpass

in the case where a draw is triggered after a flush, zink_update_descriptor_refs
will be called to set batch tracking for descriptors. this function also
handles refs for fb attachments, and everything is usually fine there

the problem with this approach is that tracking is no longer set on view
objects at renderpass begin, which makes them susceptible to early deletion
if a rp isn't started from a draw call

instead, apply batch tracking to fb attachment resources on renderpass
begin if the BATCH_CHANGED flag is set (need to rename this at some point)
in order to guarantee that the resource (object) lifetime will match the
cmdbuf runtime [since imageviews are now only freed upon batch completion]

fixes #9059

Fixes: f6bbd7875a8 ("zink: remove batch tracking/usage from view types"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23132>

14 months agoanv: fix push descriptor deferred surface state packing
Lionel Landwerlin [Sun, 21 May 2023 12:19:56 +0000 (15:19 +0300)]
anv: fix push descriptor deferred surface state packing

Yuzu is running into a segfault because it writes the push descriptor
twice with 2 different layouts, but without a draw/dispatch in
between.

First vkCmdPushDescriptorSetKHR() writes descriptor 0 & 1 with a
uniform buffer. We toggle the 2 first bits of
anv_descriptor_set::generate_surface_states.

Second vkCmdPushDescriptorSetKHR() writes descriptor 0 with uniform
buffer and descriptor 1 with an image view. The first bit of
anv_descriptor_set::generate_surface_states stays, but the second bit
was already set before and it should now be off.

When we finally flush the push descriptor, we try to generate a
surface state for descriptor 1, but there is no valid buffer view for
it, we access an invalid pointer and segfault.

This fix resets the anv_descriptor_set::generate_surface_states when
the descriptor layout changes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b49b18f0b7 ("anv: reduce BT emissions & surface state writes with push descriptors")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23156>

14 months agor300: workaround GCC 12+ warning, declare NULL value as unreachable
David Heidelberg [Fri, 5 May 2023 19:55:55 +0000 (21:55 +0200)]
r300: workaround GCC 12+ warning, declare NULL value as unreachable

Solution recommended in the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109716#c3

Suggested-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23148>

14 months agobroadcom/compiler: skip jumps in non-uniform if/then when block cost is small
Iago Toral Quiroga [Tue, 16 May 2023 09:34:51 +0000 (11:34 +0200)]
broadcom/compiler: skip jumps in non-uniform if/then when block cost is small

We have an optimization for non-uniform if/else where if all channels meet the
jump condition we emit a branch to jump straight to the ELSE block. Similarly,
if at the end of the THEN block we don't have any channels that would execute
the ELSE block, we emit a branch to jump straight to the AFTER block.

This optimization has a cost though: we need to emit the condition for the
branch and a branch instruction (which also comes with a 3 delay slot), so for
very small blocks (just a couple of ALU for example) emitting the branch
instruction is typically worse. Futher, if the condition for the branch is not
met, we still pay the cost for no benefit at all.

Here is an example:

nop                           ; fmul.ifa rf26, 0x3e800000, rf54
xor.pushz -, rf52, 2          ; nop
bu.alla  32, r:unif (0x00000000 / 0.000000)
nop                           ; nop
nop                           ; nop
nop                           ; nop
xor.pushz -, rf52, 3          ; nop
nop                           ; mov.ifa rf52, 0
nop                           ; mov.pushz -, rf52
nop                           ; mov.ifa rf26, 0x3f800000

The bu instruction here is setup to jump over the following 4 instructions
(the last 4 instructions in there). To do this, we pay the price of the xor
to generate the condition, the bu instruction, and the 3 delay slots right
after it, so we end up paying 6 instructions to skip over 4 which we pay
always, even if the branch is not taken and we still have to execute those
4 instructions. With this change, we produce:

nop                           ; fmul.ifa rf56, 0x3e800000, rf28
xor.pushz -, rf9, 3           ; nop
nop                           ; mov.ifa rf9, 0
nop                           ; mov.pushz -, rf9
nop                           ; mov.ifa rf56, 0x3f800000

Now we don't try to skip the small block, ever. At worse, if all channels
would have met the branch condition, we only pay the cost of the 4
instructions instead of 6, at best, if any channel wouldn't take the
branch, we save ourselves 5 cycles for the branch condition, the branch
instruction and its 3 delay slots.

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

14 months agoradv: fix radv_emit_userdata_vertex for vertex offset -1
Yiwei Zhang [Mon, 22 May 2023 00:54:32 +0000 (00:54 +0000)]
radv: fix radv_emit_userdata_vertex for vertex offset -1

-1 is a legit vertex offset upon vkCmdDrawIndexed and other cmds. This
change fixes to track last_vertex_offset with an additional valid bit.

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

14 months agoradv: enable smoothLines
Samuel Pitoiset [Tue, 28 Feb 2023 08:10:30 +0000 (09:10 +0100)]
radv: enable smoothLines

For Zink.

This marks one piglit test as expected failure because polygon
smoothing can't be implemented properly in Vulkan.

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

14 months agoradv: add support for smooth lines
Samuel Pitoiset [Tue, 28 Feb 2023 08:48:56 +0000 (09:48 +0100)]
radv: add support for smooth lines

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

14 months agoradv: lower nir_intrinsic_load_poly_line_smooth_enabled_amd
Samuel Pitoiset [Tue, 16 May 2023 08:09:26 +0000 (10:09 +0200)]
radv: lower nir_intrinsic_load_poly_line_smooth_enabled_amd

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

14 months agoradv: declare a new user SGPR for the dynamic line rasterization mode
Samuel Pitoiset [Tue, 28 Feb 2023 08:24:51 +0000 (09:24 +0100)]
radv: declare a new user SGPR for the dynamic line rasterization mode

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

14 months agoradv: determine if smooth lines can be used in the pipeline key
Samuel Pitoiset [Tue, 28 Feb 2023 08:42:17 +0000 (09:42 +0100)]
radv: determine if smooth lines can be used in the pipeline key

Really complicated to reduce the scope because everything can be
dynamic and with GPL you can't even know if the pipeline draws lines
when compiling the fragment shader.

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