platform/upstream/mesa.git
21 months agodocs/gallium: use math-role for zero and one also
Erik Faye-Lund [Wed, 19 Oct 2022 12:20:04 +0000 (14:20 +0200)]
docs/gallium: use math-role for zero and one also

Without this, the zero and one renders with a different font than the
other equations. There's no good reason for this, so let's just use the
math-role for these too.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>

21 months agodocs/gallium: use table instead of list
Erik Faye-Lund [Wed, 19 Oct 2022 12:18:49 +0000 (14:18 +0200)]
docs/gallium: use table instead of list

This makes this a bit easer to read, as the equations line up properly.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>

21 months agodocs/gallium: use definition-lists for member-lists
Erik Faye-Lund [Wed, 19 Oct 2022 12:13:56 +0000 (14:13 +0200)]
docs/gallium: use definition-lists for member-lists

For some reason, we started with headings for some of these, and then
switched to definition lists midway though.

Let's stick with the definition lists, as that looks a bit more tidy.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19460>

21 months agoac/nir: create gs copy shader with scalar outputs
Qiang Yu [Wed, 2 Nov 2022 02:45:42 +0000 (10:45 +0800)]
ac/nir: create gs copy shader with scalar outputs

radeonsi assume IO has been scalarized, this simplify the code
and radeonsi implementation.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19455>

21 months agorusticl: remove Option from set_global_binding
Karol Herbst [Thu, 22 Sep 2022 11:14:42 +0000 (13:14 +0200)]
rusticl: remove Option from set_global_binding

We never bind NULL resources through set_global_binding and drivers depend
on this behaviour already.

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

21 months agopanfrost: Don't merge workgroups with variable shared mem
Alyssa Rosenzweig [Mon, 19 Sep 2022 15:06:12 +0000 (11:06 -0400)]
panfrost: Don't merge workgroups with variable shared mem

If nir->info.shared_size = 0 but grid->variable_shared_mem > 0, the shader uses
shared memory but the compiler may not realize that. We need to disable
workgroup merging even in this case. The alternate approach is to statically
check for shared intrinsics in the compiler, but this is a bit easier all things
considered.

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

21 months agorusticl: create the constant buffer ahead of launches
Karol Herbst [Wed, 14 Sep 2022 23:53:26 +0000 (01:53 +0200)]
rusticl: create the constant buffer ahead of launches

v2: don't bind a const buffer if there is none

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

21 months agorusticl: create the CSO ahead of launches
Karol Herbst [Wed, 14 Sep 2022 23:30:32 +0000 (01:30 +0200)]
rusticl: create the CSO ahead of launches

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

21 months agorusticl: unbind compute state before deleting
Karol Herbst [Sat, 17 Sep 2022 15:54:55 +0000 (17:54 +0200)]
rusticl: unbind compute state before deleting

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

21 months agoiris: invalidate sysvals if grid dimension changes
Karol Herbst [Sat, 17 Sep 2022 17:59:56 +0000 (19:59 +0200)]
iris: invalidate sysvals if grid dimension changes

Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agogallium: split up req_local_mem
Karol Herbst [Wed, 14 Sep 2022 18:37:55 +0000 (20:37 +0200)]
gallium: split up req_local_mem

This will be required if a frontend has to request additional shared mem
on top of the shader declared one, but wants to create the CSO before
knowing the total amount.

In OpenCL applications can bind additional shared mem through kernel
arguments and this happens quite late.

Note: Clover sets the req_local_mem incorrectly before so we can leave it
as broken.

v2: fix panfrost code (Alyssa)

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agorusticl: use real constant buffer for cb0
Karol Herbst [Wed, 14 Sep 2022 15:53:18 +0000 (17:53 +0200)]
rusticl: use real constant buffer for cb0

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agorusticl/nir: add load_kernel_input lowering pass
Karol Herbst [Thu, 20 Oct 2022 00:54:55 +0000 (02:54 +0200)]
rusticl/nir: add load_kernel_input lowering pass

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agonir: set range and base for load_kernel_input
Karol Herbst [Thu, 20 Oct 2022 00:54:39 +0000 (02:54 +0200)]
nir: set range and base for load_kernel_input

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agogallium: drop pipe_compute_state.req_private_mem
Karol Herbst [Tue, 13 Sep 2022 16:58:07 +0000 (18:58 +0200)]
gallium: drop pipe_compute_state.req_private_mem

nothing used it and nothing will use it, so just drop it and clean up some
dead struct fields in drivers.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agogallium/tests: drop compute test
Karol Herbst [Sat, 1 Oct 2022 13:22:41 +0000 (15:22 +0200)]
gallium/tests: drop compute test

The TGSIs don't compile and are rather an annoyence when touching gallium
APIs.

Originally they were written with adding CL support to TGSI, but that
never panned out.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>

21 months agonouveau/nvc0: Remove unused validate_zcull function
António Monteiro [Mon, 24 Oct 2022 11:25:34 +0000 (12:25 +0100)]
nouveau/nvc0: Remove unused validate_zcull function

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>

21 months agonouveau/nv50: Remove unused alternative sample position ms8
António Monteiro [Mon, 24 Oct 2022 14:50:40 +0000 (15:50 +0100)]
nouveau/nv50: Remove unused alternative sample position ms8

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>

21 months agonouveau/nvc0: Remove unused alternative sample position ms8
António Monteiro [Mon, 24 Oct 2022 14:50:00 +0000 (15:50 +0100)]
nouveau/nvc0: Remove unused alternative sample position ms8

Signed-off-by: António Monteiro <antonio.fmr.monteiro@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19271>

21 months agoglx: Fixes apple/apple_visual.c that include non-exist util/debug.h
Yonggang Luo [Wed, 2 Nov 2022 21:19:29 +0000 (05:19 +0800)]
glx: Fixes apple/apple_visual.c that include non-exist util/debug.h

Fixes: aa4ac5ff8bb ("utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*")

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

21 months agopanfrost: Replace resource shadowing flush
Alyssa Rosenzweig [Sat, 29 Oct 2022 18:42:36 +0000 (14:42 -0400)]
panfrost: Replace resource shadowing flush

The entire point of resource shadowing is to avoid unnecessary flushing.
Flushing readers after shadowing is counterproductive. A refresher on
how resource shadowing is supposed to work:

First, we determine if it's beneficial to shadow resources. If so, we
create a new backing buffer object. We flush the current writer of the
resource, if there is one, so the current contents become known to the
CPU. If we are not discarding the original resource, we then copy the
existing contents of the buffer to the new shadow buffer on the CPU.
Finally, we swap the resource's backing buffer for our shadow. Any batch
that reads the resource will continue to read the old copy of the
resource, and any future draw calls will see the new copy with the
change implemented.

Where did we go wrong?

In 988d5aae74d ("panfrost: Flush resources when shadowing"), we started
flushing all readers. We didn't actually need to flush, we just needed
to avoid dangling references on the batches reading the old copy of the
resource. But that's easily enough avoided: just remove the references.
The batches still hold a reference to the underlying BO, which will be
freed at the right time regardless.

Originally motivated by glmark2 -bbuffer:update-method=subdata, which
has some pathological access paterns.

Firefox is a lot faster anecdotally (now scrolling at 60fps in firefox).

But what actually motivated this is an apitrace from Duckstation's GLES
renderer. With this patch, the in-game portion is improved 3fps to 21fps.

Closes: #4028
Fixes: 988d5aae74d ("panfrost: Flush resources when shadowing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>

21 months agopanfrost: Don't copy resources if replaced
Alyssa Rosenzweig [Wed, 2 Nov 2022 17:43:11 +0000 (13:43 -0400)]
panfrost: Don't copy resources if replaced

If a synchronized transfer_map is going to overwrite an entire resource,
there's no need to memcpy in the original contents ahead-of-time. This
memcpy is particularly bad for large buffers where it's copying WC->WC,
although that could be mitigated with threaded_context's cpu_storage in
the future if needed.

Prevents a performance regression in glmark2's buffer scenes from the
next patch, hence the Cc.

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

21 months agozink: add missing build_id linker args
Eric Engestrom [Wed, 2 Nov 2022 21:38:53 +0000 (21:38 +0000)]
zink: add missing build_id linker args

Fixes: 4e14da056d623ababf7c ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19485>

21 months agodocs: update calendar for 22.3.0-rc1
Eric Engestrom [Wed, 2 Nov 2022 21:18:02 +0000 (21:18 +0000)]
docs: update calendar for 22.3.0-rc1

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

21 months agointel/dev: Set has_lsc in XEHP_FEATURES rather than DG2_FEATURES
Jordan Justen [Tue, 24 May 2022 00:02:31 +0000 (17:02 -0700)]
intel/dev: Set has_lsc in XEHP_FEATURES rather than DG2_FEATURES

MTL will want this set as well.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19447>

21 months agodocs: reset new_features.txt
Eric Engestrom [Wed, 2 Nov 2022 19:19:44 +0000 (19:19 +0000)]
docs: reset new_features.txt

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
21 months agoVERSION: bump to 22.4
Eric Engestrom [Wed, 2 Nov 2022 19:19:35 +0000 (19:19 +0000)]
VERSION: bump to 22.4

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
21 months agoRevert "etnaviv: completely turn off MSAA"
Christian Gmeiner [Sat, 2 Jul 2022 11:59:18 +0000 (13:59 +0200)]
Revert "etnaviv: completely turn off MSAA"

This reverts commit 044b238507bb54ff8b6129c9754f1efc0f0834b9 and extends it with
 - putting the comments directly in front of the if's
 - do not support 2x MSAA on SMALL_MSAA hardware
 - checking if blt/rs supports the format

MSAA should work as expected now. Tested with kmscube and qt5.

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

21 months agoetnaviv: blt: Directly call etna_try_blt_blit(..)
Christian Gmeiner [Sat, 13 Aug 2022 18:03:23 +0000 (20:03 +0200)]
etnaviv: blt: Directly call etna_try_blt_blit(..)

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

21 months agoetnaviv: blt: Add color resolve support
Christian Gmeiner [Sat, 13 Aug 2022 17:55:03 +0000 (19:55 +0200)]
etnaviv: blt: Add color resolve support

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

21 months agoetnaviv: Update headers from rnndb
Christian Gmeiner [Fri, 7 Oct 2022 06:19:27 +0000 (08:19 +0200)]
etnaviv: Update headers from rnndb

Update to rnndb commit fff078b61ceb.

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

21 months agoetnaviv: rs: msaa: Set cache mode for SMALL_MSAA
Christian Gmeiner [Thu, 11 Aug 2022 14:27:30 +0000 (16:27 +0200)]
etnaviv: rs: msaa: Set cache mode for SMALL_MSAA

If the GPU supports SMALL_MSAA and does not support CACHE128B256BPERLINE we
need to set the cache mode to CACHE_MODE_256B.

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

21 months agoetnaviv: rs: Directly call etna_try_rs_blit(..)
Christian Gmeiner [Thu, 14 Jul 2022 19:45:44 +0000 (21:45 +0200)]
etnaviv: rs: Directly call etna_try_rs_blit(..)

Also remove some old comments.

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

21 months agoetnaviv: rs: Color resolve works
Christian Gmeiner [Sun, 17 Nov 2019 19:37:40 +0000 (20:37 +0100)]
etnaviv: rs: Color resolve works

No special treatment is needed and is helps MSAA.

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

21 months agoetnaviv: Create MSAA surfaces with PE compatible tiling
Gert Wollny [Sun, 3 Jul 2022 05:37:06 +0000 (07:37 +0200)]
etnaviv: Create MSAA surfaces with PE compatible tiling

MSAA surfaces are always used for rendering, and only as blit sources,
so the need to be allocated with PE compatible tiling.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-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/19013>

21 months agoetnaviv: Remove possibility to force MSAA
Christian Gmeiner [Tue, 5 Jul 2022 12:12:57 +0000 (14:12 +0200)]
etnaviv: Remove possibility to force MSAA

st/mesa does not know anything about the forced MSAA and we end with
the following assert:
etna_try_rs_blit: Assertion `(blit_info->src.box.x + blit_info->src.box.width) * msaa_xscale <= src_lev->padded_width' failed

Let the application do its thing regarding MSAA and remove this 'debug'
feature.

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

21 months agod3d12: Hook up driver-private interop data
Jesse Natalie [Fri, 21 Oct 2022 22:57:49 +0000 (15:57 -0700)]
d3d12: Hook up driver-private interop data

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agomesa/st: Query driver for interop data
Jesse Natalie [Fri, 21 Oct 2022 22:30:54 +0000 (15:30 -0700)]
mesa/st: Query driver for interop data

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agogallium: Add screen methods for driver-private data on interop interface
Jesse Natalie [Fri, 21 Oct 2022 22:30:25 +0000 (15:30 -0700)]
gallium: Add screen methods for driver-private data on interop interface

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agoinclude: Add driver data to v2 of mesa_glinterop_device_info
Jesse Natalie [Fri, 21 Oct 2022 22:15:30 +0000 (15:15 -0700)]
include: Add driver data to v2 of mesa_glinterop_device_info

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agoegl/wgl: Implement interop methods
Jesse Natalie [Fri, 21 Oct 2022 21:52:41 +0000 (14:52 -0700)]
egl/wgl: Implement interop methods

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agowgl: Implement interop methods
Jesse Natalie [Fri, 21 Oct 2022 21:48:27 +0000 (14:48 -0700)]
wgl: Implement interop methods

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agoegl/dri2: Implement the new flush method
Jesse Natalie [Fri, 21 Oct 2022 21:09:39 +0000 (14:09 -0700)]
egl/dri2: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agoglx: Implement the new flush method
Jesse Natalie [Fri, 21 Oct 2022 21:04:47 +0000 (14:04 -0700)]
glx: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agodri: Implement the new flush method
Jesse Natalie [Fri, 21 Oct 2022 21:28:44 +0000 (14:28 -0700)]
dri: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agomesa/st: Implement the new flush method
Jesse Natalie [Thu, 27 Oct 2022 23:46:26 +0000 (16:46 -0700)]
mesa/st: Implement the new flush method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agomesa/st: Split interop object lookup from export
Jesse Natalie [Thu, 27 Oct 2022 23:46:10 +0000 (16:46 -0700)]
mesa/st: Split interop object lookup from export

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agomesa: Make fence_sync not static
Jesse Natalie [Fri, 21 Oct 2022 21:25:51 +0000 (14:25 -0700)]
mesa: Make fence_sync not static

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agoinclude: Add a flush interop method
Jesse Natalie [Fri, 21 Oct 2022 22:14:30 +0000 (15:14 -0700)]
include: Add a flush interop method

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agomesa, dri2: Move interop helpers from dri2 to state tracker
Jesse Natalie [Fri, 21 Oct 2022 19:02:04 +0000 (12:02 -0700)]
mesa, dri2: Move interop helpers from dri2 to state tracker

They're not at all dri2 specific and we'll want to use them from wgl.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agoinclude: Add WGL version of GL interop extensions
Jesse Natalie [Fri, 21 Oct 2022 19:03:36 +0000 (12:03 -0700)]
include: Add WGL version of GL interop extensions

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19242>

21 months agodocs/new_features: Add Panfrost disk cache
Alyssa Rosenzweig [Wed, 2 Nov 2022 17:10:25 +0000 (13:10 -0400)]
docs/new_features: Add Panfrost disk cache

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19474>

21 months agoradeonsi: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Thu, 13 Oct 2022 17:40:15 +0000 (18:40 +0100)]
radeonsi: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

21 months agoaco/gfx11: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Mon, 26 Sep 2022 16:18:48 +0000 (17:18 +0100)]
aco/gfx11: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

21 months agoac/gpu_info: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Mon, 26 Sep 2022 18:12:41 +0000 (19:12 +0100)]
ac/gpu_info: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

21 months agoradv: increase gfx1100/gfx1101 physical vgprs
Rhys Perry [Mon, 26 Sep 2022 18:12:19 +0000 (19:12 +0100)]
radv: increase gfx1100/gfx1101 physical vgprs

https://reviews.llvm.org/D134522

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18825>

21 months agopanfrost: Implement a disk cache
Alyssa Rosenzweig [Fri, 14 Oct 2022 16:32:26 +0000 (12:32 -0400)]
panfrost: Implement a disk cache

Wire up the Mesa shader disk cache into Panfrost. Coupled with the
precompiles from the previous patch, this should greatly reduce shader
recompile jank.

This is a bare bones implementation. Obvious future work includes:

- Caching internal (outside of Gallium) shaders
- Implement finalize_nir to reduce on disk size of shaders

That doesn't need to come in this patch.

This patch does shuffle some allocation patterns around to avoid extra
nir_shader_clones, but the result should be pretty clean.

---

Consider dEQP-GLES31.functional.ssbo.layout.basic_unsized_array.* in the CTS.
With a cold cache:

   44.11user 0.66system 0:45.44elapsed 98%CPU (0avgtext+0avgdata 267804maxresident)
   k 0inputs+0outputs (130major+74725minor)pagefaults 0swaps

But with this commit and a warm cache:

   4.07user 0.35system 0:04.56elapsed 96%CPU (0avgtext+0avgdata 211012maxresident)
   k0inputs+0outputs (1major+49489minor)pagefaults 0swaps

That's an 11x improvement!

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

21 months agopanfrost: Precompile shaders
Alyssa Rosenzweig [Fri, 14 Oct 2022 21:14:46 +0000 (17:14 -0400)]
panfrost: Precompile shaders

We have no vertex shader key, and unless legacy GL features are used, the
fragment shader key is known ahead-of-time. That means we can precompile shaders
at CSO create time, hopefully avoiding some draw-time jank.

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

21 months agopanfrost: Precompile transform feedback program
Alyssa Rosenzweig [Fri, 14 Oct 2022 21:03:36 +0000 (17:03 -0400)]
panfrost: Precompile transform feedback program

This avoids the weird compiled_shader pointer inside of compiled_shader. Because
we don't have a nonempty vertex shader key, there will only ever be a single
transform feedback program per CSO.

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

21 months agopanfrost: Make fixed_varying_mask a fragment-only key
Alyssa Rosenzweig [Fri, 14 Oct 2022 20:53:52 +0000 (16:53 -0400)]
panfrost: Make fixed_varying_mask a fragment-only key

This makes it clear that there are no VS variants.

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

21 months agopanfrost: Use u_dynarray for variants
Alyssa Rosenzweig [Fri, 14 Oct 2022 20:10:26 +0000 (16:10 -0400)]
panfrost: Use u_dynarray for variants

No need to open code our own "special" dynarray. Unify the graphics/compute CSO
creation to make this work without duplicating more code.

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

21 months agopanfrost: Remove uncompiled_shader->active_variant
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:44:48 +0000 (15:44 -0400)]
panfrost: Remove uncompiled_shader->active_variant

The active compiled shader (variant) is context state, it is inappropriate to
stash it on the uncompiled shader. Add compiled shader pointers to the context
and get rid of the active_variant mutation. Names from iris.

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

21 months agopanfrost: Rename structs to panfrost_(un)compiled_shader
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:34:37 +0000 (15:34 -0400)]
panfrost: Rename structs to panfrost_(un)compiled_shader

Consistency with other drivers, this makes the language less variant-centric.

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

21 months agopanfrost: Remove unused req_input_mem copy
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:30:49 +0000 (15:30 -0400)]
panfrost: Remove unused req_input_mem copy

Cloverism.

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

21 months agopanfrost: Merge pan_assemble.c into pan_shader.c
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:20:46 +0000 (15:20 -0400)]
panfrost: Merge pan_assemble.c into pan_shader.c

We now have a common place for the driver side of shader compilation. As a bonus
this gets rid of the old "assemble" name which hasn't been accurate since 2018
or so.

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

21 months agopanfrost: Consolidate all shader compiling code
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:13:52 +0000 (15:13 -0400)]
panfrost: Consolidate all shader compiling code

Compute and graphics shaders will need similar paths for the disk cache. Let's
consolidate the code to make it easier to work with.

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

21 months agopanfrost: Remove bogus assert
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:13:24 +0000 (15:13 -0400)]
panfrost: Remove bogus assert

Nothing enforces this except perhaps the implicit structure of shader keys.

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

21 months agopanfrost: Move small compute functions to pan_context.c
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:11:30 +0000 (15:11 -0400)]
panfrost: Move small compute functions to pan_context.c

So we can use pan_compute.c for just programs.

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

21 months agopanfrost: Delete set_global_resources
Alyssa Rosenzweig [Fri, 14 Oct 2022 19:03:52 +0000 (15:03 -0400)]
panfrost: Delete set_global_resources

Cloverism.

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

21 months agopanfrost: Don't use nir_variable to link varyings
Alyssa Rosenzweig [Fri, 14 Oct 2022 21:49:10 +0000 (17:49 -0400)]
panfrost: Don't use nir_variable to link varyings

NIR deemphasizes nir_variable. We want to transition off it. Instead of walking
the list of variables and playing games with the GLSL types to collect varying
information, walk the list of instructions and use the I/O semantics to collect
similar information.

In addition to avoiding the reliance on nir_variable, this fixes handling of
struct varyings under certain circumstances. Such programs are compiled by the
GLES3.1 CTS but not used, so without this fix, the affected tests would regress
when precompiling.

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

21 months agopanfrost: Don't allocate space for empty varyings
Alyssa Rosenzweig [Wed, 2 Nov 2022 14:49:22 +0000 (10:49 -0400)]
panfrost: Don't allocate space for empty varyings

PIPE_FORMAT_NONE has a block size of 1, oddly, but we don't actually
need to allocate any space for it. This acts as a small optimization for
a few shaders with the new varying linker.

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

21 months agopan/mdg: Use bifrost_nir_lower_store_component
Alyssa Rosenzweig [Sun, 16 Oct 2022 00:09:25 +0000 (20:09 -0400)]
pan/mdg: Use bifrost_nir_lower_store_component

Move the pass from the Bifrost compiler to the Midgard/Bifrost common code
directory, and take advantage of it on Midgard, where it fixes the same
tests as it fixed originally on Bifrost.

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

21 months agopan/mdg: Use .u32 for flat shading
Alyssa Rosenzweig [Sat, 15 Oct 2022 19:08:05 +0000 (15:08 -0400)]
pan/mdg: Use .u32 for flat shading

This is simple and matches what we do on Bifrost.

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

21 months agopan/mdg: Don't pair ST_VARY.a32 with other instrs
Alyssa Rosenzweig [Sat, 15 Oct 2022 19:54:18 +0000 (15:54 -0400)]
pan/mdg: Don't pair ST_VARY.a32 with other instrs

For some reason, LD_ATTR/ST_VARY.a32 bundles raise INSTR_INVALID_ENC, at
least on Mali-T860. Don't construct such pairs. This is a blunt hack but
I don't know where this curveball requirement is coming from and this
unblocks the rest of this series.

total instructions in shared programs: 99879 -> 99788 (-0.09%)
instructions in affected programs: 3179 -> 3088 (-2.86%)
helped: 49
HURT: 9
helped stats (abs) min: 1.0 max: 6.0 x̄: 2.04 x̃: 2
helped stats (rel) min: 0.93% max: 10.53% x̄: 5.46% x̃: 4.88%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.61% max: 2.13% x̄: 1.41% x̃: 1.14%
95% mean confidence interval for instructions value: -1.93 -1.20
95% mean confidence interval for instructions %-change: -5.37% -3.41%
Instructions are helped.

total bundles in shared programs: 43778 -> 45102 (3.02%)
bundles in affected programs: 10737 -> 12061 (12.33%)
helped: 10
HURT: 369
helped stats (abs) min: 1.0 max: 3.0 x̄: 1.50 x̃: 1
helped stats (rel) min: 2.90% max: 18.75% x̄: 6.93% x̃: 5.21%
HURT stats (abs)   min: 1.0 max: 10.0 x̄: 3.63 x̃: 4
HURT stats (rel)   min: 0.82% max: 44.44% x̄: 15.27% x̃: 13.33%
95% mean confidence interval for bundles value: 3.29 3.69
95% mean confidence interval for bundles %-change: 13.68% 15.69%
Bundles are HURT.

total quadwords in shared programs: 76783 -> 77914 (1.47%)
quadwords in affected programs: 18633 -> 19764 (6.07%)
helped: 9
HURT: 370
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.22 x̃: 1
helped stats (rel) min: 0.87% max: 8.33% x̄: 3.71% x̃: 3.85%
HURT stats (abs)   min: 1.0 max: 7.0 x̄: 3.09 x̃: 3
HURT stats (rel)   min: 0.82% max: 35.00% x̄: 7.82% x̃: 6.11%
95% mean confidence interval for quadwords value: 2.82 3.15
95% mean confidence interval for quadwords %-change: 7.02% 8.06%
Quadwords are HURT.

total registers in shared programs: 7266 -> 7076 (-2.61%)
registers in affected programs: 1224 -> 1034 (-15.52%)
helped: 171
HURT: 25
helped stats (abs) min: 1.0 max: 3.0 x̄: 1.27 x̃: 1
helped stats (rel) min: 8.33% max: 50.00% x̄: 21.85% x̃: 20.00%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.12 x̃: 1
HURT stats (rel)   min: 10.00% max: 100.00% x̄: 35.73% x̃: 33.33%
95% mean confidence interval for registers value: -1.10 -0.84
95% mean confidence interval for registers %-change: -17.69% -11.32%
Registers are helped.

total threads in shared programs: 4956 -> 5019 (1.27%)
threads in affected programs: 99 -> 162 (63.64%)
helped: 43
HURT: 6
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.74 x̃: 2
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: 0.91 1.66
95% mean confidence interval for threads %-change: 67.36% 95.90%
Threads are helped.

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

21 months agopan/mdg: Disassemble the .a32 bit
Alyssa Rosenzweig [Sat, 15 Oct 2022 19:18:04 +0000 (15:18 -0400)]
pan/mdg: Disassemble the .a32 bit

Corresponds to .auto32 on Bifrost. This is helpful for a conformant
implementation of flat shading.

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

21 months agofreedreno/a6xx: Mark gl45 supported
Rob Clark [Sun, 30 Oct 2022 18:58:47 +0000 (11:58 -0700)]
freedreno/a6xx: Mark gl45 supported

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

21 months agofreedreno/a6xx: ARB_query_buffer_object support
Rob Clark [Sun, 30 Oct 2022 18:19:48 +0000 (11:19 -0700)]
freedreno/a6xx: ARB_query_buffer_object support

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

21 months agofreedreno: Core ARB_query_buffer_object support
Rob Clark [Sun, 30 Oct 2022 17:24:20 +0000 (10:24 -0700)]
freedreno: Core ARB_query_buffer_object support

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

21 months agofreedreno/batch: Add a global epilogue
Rob Clark [Tue, 1 Nov 2022 00:25:04 +0000 (17:25 -0700)]
freedreno/batch: Add a global epilogue

Rename the existing one to make it clear that it is per-tile, and add a
new one that runs after all the tile passes.  Will be needed in the next
commit.

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

21 months agofreedreno/a5xx+a6xx: Add base class for query samples
Rob Clark [Sun, 30 Oct 2022 16:23:52 +0000 (09:23 -0700)]
freedreno/a5xx+a6xx: Add base class for query samples

For PIPE_CAP_QUERY_BUFFER_OBJECT we'll need to write on the GPU a flag
when the query result is available, which means the buffers used for
query results should have a header with availability flag.

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

21 months agofreedreno/a6xx: Remove unused field
Rob Clark [Mon, 31 Oct 2022 18:39:58 +0000 (11:39 -0700)]
freedreno/a6xx: Remove unused field

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

21 months agofreedreno/a6xx: Fix occlusion queries
Rob Clark [Mon, 31 Oct 2022 18:35:57 +0000 (11:35 -0700)]
freedreno/a6xx: Fix occlusion queries

WFI is not a strong enough barrier, which shows up in piglit qbo tests
which do a single draw.

Fixes: 13fc03f4c0e ("freedreno/a6xx: Avoid stalling for occlusion queries")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19400>

21 months agofreedreno/a6xx: Enable ARB_shader_group_vote
Rob Clark [Sat, 29 Oct 2022 20:28:33 +0000 (13:28 -0700)]
freedreno/a6xx: Enable ARB_shader_group_vote

Already supported for at least a6xx.

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

21 months agofreedreno/ir3: Unconditionally lower subgroup ops
Rob Clark [Sat, 29 Oct 2022 21:45:51 +0000 (14:45 -0700)]
freedreno/ir3: Unconditionally lower subgroup ops

For devices that don't support getfiberid, we force the subgroup size
to 1 for things other than compute stage.  This matches what zink does.
And fixes spec@arb_shader_group_vote@vs-eq-uniform once we expose
ARB_shader_group_vote.

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

21 months agofreedreno/a3xx+: Enable ARB_derivative_control
Rob Clark [Sat, 29 Oct 2022 20:23:16 +0000 (13:23 -0700)]
freedreno/a3xx+: Enable ARB_derivative_control

Also already supported by ir3.

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

21 months agofreedreno/a3xx+: Enable ARB_shader_texture_image_samples
Rob Clark [Sat, 29 Oct 2022 20:19:41 +0000 (13:19 -0700)]
freedreno/a3xx+: Enable ARB_shader_texture_image_samples

This is already supported for ir3

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

21 months agofreedreno/a6xx: Implement ARB_clear_texture
Rob Clark [Sat, 29 Oct 2022 19:41:01 +0000 (12:41 -0700)]
freedreno/a6xx: Implement ARB_clear_texture

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

21 months agofreedreno/a6xx: Use box to pass 2d clear params
Rob Clark [Sat, 29 Oct 2022 19:17:07 +0000 (12:17 -0700)]
freedreno/a6xx: Use box to pass 2d clear params

Simplifies the interface slightly and makes it possible to re-use the
path for pctx->clear_texture() in the next commit.  The z dimensions
still come from the surface.

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

21 months agofreedreno: Add ARB_gl_spirv support
Rob Clark [Sat, 29 Oct 2022 17:59:18 +0000 (10:59 -0700)]
freedreno: Add ARB_gl_spirv support

All the heavy lifting is done in nir.

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

21 months agodocs: update new_features.txt for non-extension additions to RADV
Rhys Perry [Wed, 2 Nov 2022 15:09:38 +0000 (15:09 +0000)]
docs: update new_features.txt for non-extension additions to RADV

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

21 months agozink: put union fields into structs named by the shader-stages
Erik Faye-Lund [Wed, 2 Nov 2022 09:29:10 +0000 (10:29 +0100)]
zink: put union fields into structs named by the shader-stages

This makes it easier to see that a field is only valid in a given stage,
to avoid undefined behavior.

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

21 months agozink: do not read is_generated unless in tcs shader
Erik Faye-Lund [Wed, 2 Nov 2022 09:21:43 +0000 (10:21 +0100)]
zink: do not read is_generated unless in tcs shader

It's undefined behavior in C to read a union member if another member
has been written to more recently. Let's be more careful here!

Fixes: a9d2b86c2c8 ("zink: store the spirv_shader to the zink_shader struct for generated tcs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19457>

21 months agozink: consider polygon-mode for rast_prim
Erik Faye-Lund [Tue, 1 Nov 2022 13:08:09 +0000 (14:08 +0100)]
zink: consider polygon-mode for rast_prim

But because polygon-offset needs to consider the primitive-type *before*
overriding the type, add a zink_prim_type()-helper for the partially
resolved state.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19438>

21 months agozink: only set line-width if drawing lines
Erik Faye-Lund [Wed, 2 Nov 2022 12:40:32 +0000 (13:40 +0100)]
zink: only set line-width if drawing lines

This might seem like a premature optimization, but it's going to make a
bit more sense with the next commit, to prevent needlessly regressing
performance.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19438>

21 months agozink: correct depth-bias enable condition
Erik Faye-Lund [Tue, 1 Nov 2022 12:30:27 +0000 (13:30 +0100)]
zink: correct depth-bias enable condition

This should be based on the fill_mode, not on the primitive type. We
*also* need to check if we'll rasterize triangles in the end, though.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19438>

21 months agorusticl: meson devenv support
Adam Jackson [Fri, 28 Oct 2022 16:28:09 +0000 (12:28 -0400)]
rusticl: meson devenv support

This gets 'meson devenv -C build clinfo' working on iris for me.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19451>

21 months agoradv/llvm: fix GS shaders on GFX8/9
Rhys Perry [Thu, 29 Sep 2022 13:22:16 +0000 (14:22 +0100)]
radv/llvm: fix GS shaders on GFX8/9

6698753cdb6 switched our GS output stores to use MUBUF.

The stride doesn't matter for the ESGS descriptor (because idxen=false and
the index stride is 64), but this fixes it anyway.

This also changes ACO to use MUBUF store too, since MTBUF doesn't seem to
work correctly with an invalid data format in the descriptor.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 6698753cdb6 ("ac/llvm: don't use tbuffer_store as a fallback for swizzled stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18885>

21 months agonv50/ir/nir: ignore sampler for TXF/TXQ ops.
Joan Bruguera [Tue, 1 Nov 2022 22:01:50 +0000 (23:01 +0100)]
nv50/ir/nir: ignore sampler for TXF/TXQ ops.

Recently, a regression was reported where videos in Firefox had shifted/
glitched colors on certain Kepler hardware. This was bisected to
bf02bffe156214dad942f56ee68c380d1968704f, however, the issue already
existed but didn't hit users until TGSI was switched to NIR as default.

The issue was traced to a YUV-to-RGB fragment shader used by Firefox,
which uses three samplers for the Y/U/V components. The Y component was
handled correctly, but the U/V components were bogus, causing the issue.

After analysis, it appears the TXF/TXQ ops. should only handle the texture
(r) but not the sampler (s), see 63b850403c90f33c295d3ad6be4ad749d4ea6274
and 346ce0b98832e33d5411200002571b3edea9e2bb.
Similarly, handleTXQ/handleTXF on nv50_ir_from_tgsi always sets s=0.
Only Kepler was affected because other hardware ignores s at codegen.

Always set s=0 on NIR for TXF/TXQ, to keep TGSI behavior and fix the
regression.

Thanks: Karol Herbst and M Henning for help diagnosing the issue.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7416
Cc: mesa-stable
Suggested-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19453>

21 months agoandroid: -Ddri-drivers= is not needed anymore
Yonggang Luo [Wed, 2 Nov 2022 10:10:08 +0000 (18:10 +0800)]
android: -Ddri-drivers= is not needed anymore

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

21 months agodocs: There is no more swrast driver
Yonggang Luo [Wed, 2 Nov 2022 10:09:07 +0000 (18:09 +0800)]
docs: There is no more swrast driver

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19459>