platform/upstream/mesa.git
20 months agoasahi: Set flatshading controls appropriately
Alyssa Rosenzweig [Fri, 2 Dec 2022 17:54:42 +0000 (12:54 -0500)]
asahi: Set flatshading controls appropriately

Fixes dEQP-GLES3.functional.rasterization.flatshading.*

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

20 months agoasahi: Identify XML for more flatshading controls
Alyssa Rosenzweig [Fri, 2 Dec 2022 17:53:02 +0000 (12:53 -0500)]
asahi: Identify XML for more flatshading controls

Names from PowerVR <3

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

20 months agoasahi: Enable VS_INSTANCEID and VERTEX_ELEMENT_INSTANCE_DIVISOR caps
Asahi Lina [Wed, 14 Dec 2022 09:46:37 +0000 (18:46 +0900)]
asahi: Enable VS_INSTANCEID and VERTEX_ELEMENT_INSTANCE_DIVISOR caps

These two should be functional at this point. The latter is required
(and quite well tested) by Darwinia.

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

20 months agoasahi: Implement depth and stencil export
Alyssa Rosenzweig [Sat, 17 Dec 2022 04:39:01 +0000 (23:39 -0500)]
asahi: Implement depth and stencil export

For gl_FragDepth, passes dEQP-GLES3.functional.shaders.fragdepth.* and piglit
fragdepth_gles2.

For stencil export, passes piglit glsl-fs-shader-stencil-export.

For gl_FragDepth together with stencil export, passes
dEQP-GLES3.functional.fbo.blit.*

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

20 months agoagx: Implement depth and stencil export
Alyssa Rosenzweig [Sat, 17 Dec 2022 04:38:07 +0000 (23:38 -0500)]
agx: Implement depth and stencil export

Lower FRAG_RESULT_DEPTH and FRAG_RESULT_STENCIL writes to a combnied zs_emit
instruction with a multisampling index. To be used in the following commit.

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

20 months agoasahi: Allow texturing S8 portion of combined Z/S
Alyssa Rosenzweig [Sat, 17 Dec 2022 04:24:48 +0000 (23:24 -0500)]
asahi: Allow texturing S8 portion of combined Z/S

Comes up in gles3.

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

20 months agoasahi: Put meta shader keys into the meta shader itself
Asahi Lina [Wed, 14 Dec 2022 04:28:26 +0000 (13:28 +0900)]
asahi: Put meta shader keys into the meta shader itself

The hash table needs a key pointer with at least the lifetime of the
hash entry, which the key pointer we get does not have (since it is
stack-allocated by agx_build_meta). Copy it into the shader struct
itself and use that for the hash table.

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

20 months agoasahi: Identify & disable triangle merging for shaders using derivatives
Asahi Lina [Fri, 9 Dec 2022 12:47:29 +0000 (21:47 +0900)]
asahi: Identify & disable triangle merging for shaders using derivatives

It seems triangle merging is incompatible with calculating derivatives
along primitive edges correctly. Take the appropriate NIR shader info
flags in the compiler and pass them down as a flag to the driver, so it
can set the disable triangle merging flag (formerly called "lines or
points").

TODO: Is this what macOS does when you set a sample mask there (which
apparently fixes the same bug on the Darwinia Metal backend)? Do we
also need to set this when sample masks are used?

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes Darwinia and dEQP2 projected tests.

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

20 months agoasahi: Fix include guard comment on decode.h
Asahi Lina [Fri, 9 Dec 2022 10:30:21 +0000 (19:30 +0900)]
asahi: Fix include guard comment on decode.h

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

20 months agoasahi: Allocate enough push ranges for the worst possible case
Asahi Lina [Fri, 9 Dec 2022 09:08:04 +0000 (18:08 +0900)]
asahi: Allocate enough push ranges for the worst possible case

We need one for every possible sysval, plus up to 16 VBOs.

Fixes plasma-systemmonitor.

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

20 months agoasahi: Fix off-by-one assert in agx_create_vertex_elements
Asahi Lina [Fri, 9 Dec 2022 09:07:49 +0000 (18:07 +0900)]
asahi: Fix off-by-one assert in agx_create_vertex_elements

Needed to fix plasma-systemmonitor.

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

20 months agoasahi: Consider shared resources always valid
Asahi Lina [Wed, 7 Dec 2022 07:00:59 +0000 (16:00 +0900)]
asahi: Consider shared resources always valid

Shared resources are in an unknown state, so we have to assume they
may contain valid data.

Fixes Xorg+Kwin random full-screen garbage on mouse cursor present.

However, we still get black flashing in some circumstances (that was
garbage flashing before this commit), which indicates that something
is reading an uninitialized/fresh shared framebuffer and expecting
valid data (prior screen contents?) TBD.

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

20 months agoasahi: Ensure we always have space for stream links + padding
Asahi Lina [Fri, 9 Dec 2022 06:56:26 +0000 (15:56 +0900)]
asahi: Ensure we always have space for stream links + padding

It seems VDM can overread (maybe it does blockwise transfers?), so we
always need to leave space at the end of encoder buffers to avoid
faults.

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

20 months agoasahi: Don't crash on VBOs without resources
Asahi Lina [Wed, 7 Dec 2022 12:43:43 +0000 (21:43 +0900)]
asahi: Don't crash on VBOs without resources

There's a Firefox QuakeJS heisenbug that triggers this sometimes, by
binding vertex attributes with no buffer...

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>

20 months agoasahi: Do not leak staging resources for PIPE_MAP_READ
Asahi Lina [Wed, 7 Dec 2022 09:33:46 +0000 (18:33 +0900)]
asahi: Do not leak staging resources for PIPE_MAP_READ

We were only dereferencing the resource in the PIPE_MAP_WRITE path of
agx_transfer_unmap, which means that read-only transfers leaked the
staging resource/BO. Always free the staging resource unconditionally.

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

20 months agoagx: Fix packing of extension for block image stores
Alyssa Rosenzweig [Sun, 4 Dec 2022 02:19:22 +0000 (21:19 -0500)]
agx: Fix packing of extension for block image stores

Probably impossible to hit in practice but let's get it right. Found when
forcing RA to use the upper half of the reg file.

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

20 months agoagx: Coalesce i2i16 and u2u16
Alyssa Rosenzweig [Fri, 2 Dec 2022 16:36:42 +0000 (11:36 -0500)]
agx: Coalesce i2i16 and u2u16

Extract out the code for unpack_64_2x32_split_x and use it for other integer
downcasts too to coalesce out a move. Pointless, but I wanted to have a little
RA fun after getting stencil export working.

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

20 months agoail: Assert that the mip level is in bounds
Asahi Lina [Fri, 9 Dec 2022 11:15:42 +0000 (20:15 +0900)]
ail: Assert that the mip level is in bounds

This preempts possible out-of-bounds accesses and later asserts when
trying to get the tile size.

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

20 months agoail: Fix tile sizes
Alyssa Rosenzweig [Tue, 29 Nov 2022 03:00:52 +0000 (22:00 -0500)]
ail: Fix tile sizes

Fixes dEQP-GLES3.functional.texture.filtering.2d.sizes.3x7_nearest_mipmap_linear.

Tested for all sizes 1..256x1..256.

Tested-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>

20 months agoail: Fix typo
Asahi Lina [Wed, 7 Dec 2022 08:00:14 +0000 (17:00 +0900)]
ail: Fix typo

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>

20 months agoail: Always allocate the full miptree
Asahi Lina [Wed, 7 Dec 2022 07:55:19 +0000 (16:55 +0900)]
ail: Always allocate the full miptree

Layer strides are based on the full miptree, and even for single-layer
images macOS always allocates a full one (possibly relevant for
compression). Make sure we do the same, regardless of how many mip
levels the user asked for.

Fixes Darwinia.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20365>

20 months agodocs/features: Mark ARB_occlusion_query2 as done on asahi
Alyssa Rosenzweig [Sun, 4 Dec 2022 01:47:34 +0000 (20:47 -0500)]
docs/features: Mark ARB_occlusion_query2 as done on asahi

Part of GLES.

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

20 months agodocs/features: Mark panfrost supporting aniso
Alyssa Rosenzweig [Sun, 4 Dec 2022 01:38:37 +0000 (20:38 -0500)]
docs/features: Mark panfrost supporting aniso

On Mali-G72+ (except for some buggy early G72 models).

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

20 months agonir: Add store_zs_agx intrinsic
Alyssa Rosenzweig [Sat, 17 Dec 2022 04:23:58 +0000 (23:23 -0500)]
nir: Add store_zs_agx intrinsic

Will be used for frag depth/stencil export with multisampling.

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

20 months agoci: Lima farm maintenance
Erico Nunes [Thu, 15 Dec 2022 19:04:36 +0000 (20:04 +0100)]
ci: Lima farm maintenance

General lab maintenance and addressing
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20343>

20 months agor600/sfn: Fix test compilation with -fno-rtti
Michał Górny [Thu, 8 Dec 2022 19:07:51 +0000 (20:07 +0100)]
r600/sfn: Fix test compilation with -fno-rtti

79ca456b4837b3bc21cf9ef3c03c505c4b4909f6 reintroduced the use
of dynamic_cast<> in r600/sfn tests.  This breaks compilation with
-fno-rtti, as required to build against the LLVM configuration
recommended upstream.  Use static_cast<> instead to fix this.

Fixes: #7820
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20239>

20 months agor600/sfn: Fix test for possible dest slot
Gert Wollny [Sat, 17 Dec 2022 10:15:17 +0000 (11:15 +0100)]
r600/sfn: Fix test for possible dest slot

Fixes Coverity CID 1517721

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

20 months agor600/sfn: don't use a return register when shader doesn't read it
Gert Wollny [Wed, 14 Dec 2022 16:16:09 +0000 (17:16 +0100)]
r600/sfn: don't use a return register when shader doesn't read it

This reduces register pressure.

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

20 months agoiris: Limit DG2 modifiers to DG2
Jianxun Zhang [Fri, 16 Dec 2022 19:25:35 +0000 (11:25 -0800)]
iris: Limit DG2 modifiers to DG2

These DG2 modifiers should be disabled on other devices.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20363>

20 months agovenus: rename sync_queue -> timeline
Ryan Neph [Wed, 14 Dec 2022 21:34:47 +0000 (13:34 -0800)]
venus: rename sync_queue -> timeline

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

20 months agovenus: support vtest+multiple_timelines and enable
Ryan Neph [Tue, 13 Dec 2022 23:13:02 +0000 (15:13 -0800)]
venus: support vtest+multiple_timelines and enable

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

20 months agovenus: add supports_multiple_timelines capset and enable
Ryan Neph [Tue, 8 Nov 2022 01:14:23 +0000 (17:14 -0800)]
venus: add supports_multiple_timelines capset and enable

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

20 months agovenus: support external fencing with multiple timelines
Ryan Neph [Wed, 24 Aug 2022 17:38:51 +0000 (10:38 -0700)]
venus: support external fencing with multiple timelines

Without globalFencing, exportable fences and semaphores must instead
have their proxy vn_renderer_sync installed in the same renderer
ring_idx as ther last queue submissions to ensure they signal after
all work previously submitted to the same ring_idx. Exportable
fences/semaphores with a temporary (imported) payload don't need a proxy
vn_renderer_sync, since they already have a `poll()`able fd available.

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

20 months agovenus: place wsi submissions on corresponding ring_idx
Ryan Neph [Mon, 22 Aug 2022 23:32:14 +0000 (16:32 -0700)]
venus: place wsi submissions on corresponding ring_idx

With implicit fencing, the image has a fence that blocks scanout until
rendering is complete. virtgpu doesn't support implicit fencing yet, but
Sommelier (a VM Wayland compositor) does the wait by exposing the bo as
a GEM handle and waiting on all fences in userspace with a
DRM_IOCTL_VIRTGPU_WAIT before issuing the wl_surface commit.
During vkQueueSubmit involving wsi images, we follow with an empty
renderer submission on the corresonding ring_idx to install a fence
on the appropriate virtgpu fence context after the last rendering
submission.

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

20 months agovenus: remove workaround for empty renderer submissions
Ryan Neph [Thu, 15 Dec 2022 23:33:37 +0000 (15:33 -0800)]
venus: remove workaround for empty renderer submissions

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

20 months agovenus: allow renderer submissions on per-context virtgpu rings
Ryan Neph [Wed, 10 Aug 2022 00:12:07 +0000 (17:12 -0700)]
venus: allow renderer submissions on per-context virtgpu rings

For submissions to renderers that support multiple timelines, put
them on the virtgpu fencing timeline (dma fence context) specified by
the VkQueue's bound ring_idx. CPU-sync'd renderer submissions
can be sent in the same manner by using ring_idx = 0.

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

20 months agovenus: bind VkQueue to available ring_idx at creation
Ryan Neph [Wed, 9 Nov 2022 22:37:10 +0000 (14:37 -0800)]
venus: bind VkQueue to available ring_idx at creation

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

20 months agovenus: use upstream DRM_IOCTL_VIRTGPU_CONTEXT_INIT
Ryan Neph [Wed, 15 Dec 2021 01:10:36 +0000 (17:10 -0800)]
venus: use upstream DRM_IOCTL_VIRTGPU_CONTEXT_INIT

And remove SIMULATE_CONTEXT_INIT and PARAM_MAX_SYNC_QUEUE_COUNT now that
we expect guest kernel support for CONTEXT_INIT with standard support
for up to 64 rings.

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

20 months agovenus: update venus-protocol for multiple timelines
Ryan Neph [Wed, 9 Nov 2022 22:05:18 +0000 (14:05 -0800)]
venus: update venus-protocol for multiple timelines

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

20 months agovenus: formatting fixes
Ryan Neph [Wed, 7 Dec 2022 21:45:40 +0000 (13:45 -0800)]
venus: formatting fixes

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

20 months agoCI: Overwrite valve infra's registry
Benjamin Tissoires [Fri, 16 Dec 2022 18:44:05 +0000 (19:44 +0100)]
CI: Overwrite valve infra's registry

This is a temporary workaround wihle we wait for valve-infra to sort
out this issue.

It is safe to do because registry.freedesktop.org is a mirror of
harbor.freedesktop.org.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7913
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20362>

20 months agoutil: Fixes thread safety of DEBUG_GET_ONCE_*_OPTION macros
Yonggang Luo [Sat, 5 Nov 2022 20:32:05 +0000 (04:32 +0800)]
util: Fixes thread safety of DEBUG_GET_ONCE_*_OPTION macros

Pick DEBUG_GET_ONCE_BOOL_OPTION as a example:
The intention of DEBUG_GET_ONCE_BOOL_OPTION are returned the same value across
thread, before this commit, on different thread call the function generated by
DEBUG_GET_ONCE_BOOL_OPTION may return different value if called setenv in the
middle of debug_get_bool_option, so use debug_get_option_cached along with
new exposed function debug_parse_bool_option to solve this issue

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>

20 months agoutil: Add function debug_get_option_cached os_get_option_cached
Yonggang Luo [Sat, 5 Nov 2022 20:26:38 +0000 (04:26 +0800)]
util: Add function debug_get_option_cached os_get_option_cached

This is used to fixes DEBUG_GET_ONCE_*_OPTION macros latter

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>

20 months agoutil: Improve os_get_android_option to be thread-safe
Yonggang Luo [Sun, 23 Oct 2022 16:30:38 +0000 (00:30 +0800)]
util: Improve os_get_android_option to be thread-safe

struct hash_table is not thread-safety, need guard by mutex,
but with thread local storage, we can simplify the code and also
got the thread safety without the need of mutex.
Another advantage is by using thread local storage, os_get_android_option
will have the same actions like getenv does, that it's not cached the
value, each call will access the property_get, like getenv will be affected
by putenv

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>

20 months agoutil: Improve prototype of debug_get_num_option and debug_get_flags_option
Yonggang Luo [Wed, 2 Nov 2022 06:46:16 +0000 (14:46 +0800)]
util: Improve prototype of debug_get_num_option and debug_get_flags_option

Getting debug_get_num_option to return int64_t, as long under 64 bit Linux are 64 bit size,
 so using fixed int64_t for cross platform consistence, as long under win32 is 32 bit size.

Getting DEBUG_GET_ONCE_FLAGS_OPTION to return uint64_t to getting it to be
consistence with debug_get_flags_option.

DEBUG_GET_ONCE_NUM_OPTION is not accessed in codebase, so add unittest for it, it maybe
used in future, remove it is not consistence

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>

20 months agoutil: Indent u_debug.c with 3 space instead of tab
Yonggang Luo [Wed, 2 Nov 2022 09:58:36 +0000 (17:58 +0800)]
util: Indent u_debug.c with 3 space instead of tab

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19554>

20 months agoglsl: fixes -Werror,-Wunused-but-set-variable for clang-15 in glcpp-parse.y and glsl_...
Yonggang Luo [Fri, 4 Nov 2022 12:48:02 +0000 (20:48 +0800)]
glsl: fixes -Werror,-Wunused-but-set-variable for clang-15 in glcpp-parse.y and glsl_parser.yy

error messages:
src/compiler/glsl/glcpp/glcpp-parse.c:1691:9: error: variable 'glcpp_parser_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

src/compiler/glsl/glsl_parser.cpp:2370:9: error: variable '_mesa_glsl_nerrs' set but not used [-Werror,-Wunused-but-set-variable]
    int yynerrs = 0;
        ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

20 months agoglsl: Fixes indent issue after replace tab with 3 space by tools in glcpp-parse.y
Yonggang Luo [Tue, 22 Nov 2022 16:47:53 +0000 (00:47 +0800)]
glsl: Fixes indent issue after replace tab with 3 space by tools in glcpp-parse.y

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

20 months agoglsl: replace tab with 3 space in glcpp-parse.y
Yonggang Luo [Tue, 22 Nov 2022 16:37:28 +0000 (00:37 +0800)]
glsl: replace tab with 3 space in glcpp-parse.y

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

20 months agoglsl: Fixes ident issue in glsl_parser.yy and update editorconfig for it
Yonggang Luo [Tue, 22 Nov 2022 16:34:35 +0000 (00:34 +0800)]
glsl: Fixes ident issue in glsl_parser.yy and update editorconfig for it

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

20 months agopanvk: Fixes -Werror,-Wunused-but-set-variable for clang-15 in panvk_descriptor_set.c
Yonggang Luo [Fri, 4 Nov 2022 11:31:47 +0000 (19:31 +0800)]
panvk: Fixes -Werror,-Wunused-but-set-variable for clang-15 in panvk_descriptor_set.c

../../src/panfrost/vulkan/panvk_descriptor_set.c:67:13: error: variable 'dynoffset_idx' set but not used [-Werror,-Wunused-but-set-variable]
   unsigned dynoffset_idx = 0, img_idx = 0;
            ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

20 months agoloader: fixes -Werror,-Wdeprecated-non-prototype for clang-15 in pipe-loader
Yonggang Luo [Fri, 4 Nov 2022 13:03:08 +0000 (21:03 +0800)]
loader: fixes -Werror,-Wdeprecated-non-prototype for clang-15 in pipe-loader

There are multiple error messages, show one of them:
../../src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c:219:54: error: passing arguments to a function without a prototype is deprecated in
all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
         sdev->ws = sdev->dd->winsys[i].create_winsys(drisw_lf);
                                                     ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19875>

20 months agod3d12/ci: Update expectations
Jesse Natalie [Thu, 15 Dec 2022 22:59:11 +0000 (14:59 -0800)]
d3d12/ci: Update expectations

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

20 months agodzn: Swizzle SRV access to stencil
Jesse Natalie [Thu, 15 Dec 2022 22:05:13 +0000 (14:05 -0800)]
dzn: Swizzle SRV access to stencil

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

20 months agodzn: Pass input clip size to shader compilation
Jesse Natalie [Thu, 15 Dec 2022 18:59:57 +0000 (10:59 -0800)]
dzn: Pass input clip size to shader compilation

For cases where both clip and cull are used, and a shader has both
inputs and outputs that can contain them, we need metadata to tell
us where the clip array ends and the cull array begins, since they
get combined into CLIP location registers. For outputs, this is in
the nir info, but for input we pass it in a sideband channel.

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

20 months agodzn: Don't add UAV flag to DSV textures
Jesse Natalie [Fri, 4 Nov 2022 22:27:43 +0000 (15:27 -0700)]
dzn: Don't add UAV flag to DSV textures

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

20 months agodzn: Use ResolveSubresourceRegion to support non-averaging resolve modes
Jesse Natalie [Fri, 4 Nov 2022 22:27:24 +0000 (15:27 -0700)]
dzn: Use ResolveSubresourceRegion to support non-averaging resolve modes

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

20 months agodzn: Use driver-implemented triangle fans if available
Jesse Natalie [Fri, 4 Nov 2022 21:23:29 +0000 (14:23 -0700)]
dzn: Use driver-implemented triangle fans if available

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

20 months agodzn: Get options15
Jesse Natalie [Fri, 4 Nov 2022 21:21:22 +0000 (14:21 -0700)]
dzn: Get options15

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

20 months agomicrosoft/compiler: Handle cull distance starting fractional with no previous clip
Jesse Natalie [Thu, 15 Dec 2022 21:06:16 +0000 (13:06 -0800)]
microsoft/compiler: Handle cull distance starting fractional with no previous clip

This can happen if the clip distance was declared, but was discarded as an
unused variable.

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

20 months agomicrosoft/compiler: Sort all user varyings before any sysvals
Jesse Natalie [Thu, 15 Dec 2022 20:43:59 +0000 (12:43 -0800)]
microsoft/compiler: Sort all user varyings before any sysvals

User varyings are linked by both name and register. The name is based
on how many *variables* are before it in final driver_location sort
order, not necessarily how many registers are before it.

In some cases where clip/cull distance are involved, it's possible
for one shader to write into a part of the cull distance that's
ignored by a downstream shader, but because linking is done by
*whole* register locations, and clip/cull can be combined using
*fractional* register locations, this is hard to detect. Since no
non-sysvals end up using fractional locations, just put all non-sysvals
first so they always generate the same semantic names for the same
register locations.

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

20 months agomicrosoft/compiler: Make nir_var_to_dxil_sysvalue_type static
Jesse Natalie [Thu, 15 Dec 2022 19:02:57 +0000 (11:02 -0800)]
microsoft/compiler: Make nir_var_to_dxil_sysvalue_type static

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

20 months agomicrosoft/compiler: Handle both input and output clip/cull distances
Jesse Natalie [Thu, 15 Dec 2022 18:57:42 +0000 (10:57 -0800)]
microsoft/compiler: Handle both input and output clip/cull distances

For clip/cull coming into a GS and being written, this pass was wrong
and would modify variable types incorrectly. Track both inputs and
outputs separately.

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

20 months agopanfrost: Don't use texture format swizzles on v7
Alyssa Rosenzweig [Wed, 14 Dec 2022 02:20:42 +0000 (21:20 -0500)]
panfrost: Don't use texture format swizzles on v7

They're too restricted for AFBC. Fix up instead. There are two problems at play:

1. We can't just map the format swizzle to the pixel format ordering on v7,
   because the "reordered" values aren't allowed with compression.
2. We can't just compose the format swizzle with the API swizzle, because the
   composed swizzle is applied to the border colour, so we need to be able to
   apply an inverted swizzle to the border colour. That only works for bijective
   format swizzles.

Fortunately, there's a neat solution: decompose the format's swizzle into two
swizzles, the first mapping to a reordering that IS allowed for compression, and
the second a bijection. Then we use the allowed reordering when texturing, apply
the bijective swizzle to the API swizzle, and apply the inverse of the bijective
swizzle to the border colour. When we're sampling a border colour, what's now
happening mathematically is:

   (API swizzle o bijective swizzle)((bijective swizzle^-1)(border colour)) =
   (API swizzle o (bijective swizzle o bijective swizzle^-1))(border colour) =
   API swizzle(border colour)

which is exactly what we wanted.

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

20 months agopanfrost: Allow swizzled AFBC on v9+
Alyssa Rosenzweig [Wed, 14 Dec 2022 01:12:58 +0000 (20:12 -0500)]
panfrost: Allow swizzled AFBC on v9+

On v6 and earlier, the hardware supports arbitrary format swizzles for AFBC, so
there's no restriction on AFBC. On v8 and newer, the format swizzle gets applied
to the *decompressed* interchange format, so we can effectively support BGRA of
AFBC images without any special handling. (Confirmed working on v9. Obviously I
can't test on v8 but the expression is cleaner if we assume optimistically it's
like v9. Without hardware, we get to make that assumption :-p)

That just leaves v7 as the only architecture where format swizzles are
restricted for compression but there are no plane descriptor. Don't apply the
restriction to the newer parts.

This gets us AFBC of window surfaces on v9+. As the limiting case, fullscreen
glmark2-es2-wayland -btexture (1080p) in sway on Mali-G57 from 1300fps to
2353fps.

45% reduction in frame time is nothing to sneeze at.

Achoo.

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

20 months agopanfrost: Introduce pan_afbc_mode
Alyssa Rosenzweig [Wed, 14 Dec 2022 02:52:26 +0000 (21:52 -0500)]
panfrost: Introduce pan_afbc_mode

Introduce an enum to represent an AFBC compression mode. These modes are not
formats, on Valhall they are decoupled from the format. As such, it does not
make sense to use a pipe_format to represent them. Add an enum that we can use
in a straightforward way on Midgard and Bifrost to fallback for texture views,
and can map 1:1 to the Valhall hardware enum.

In addition to being less overloaded semantically, this lets -Wswitch kick in to
ensure that we handle all enums when translating. The straightforward
translation raises the following warnings:

../src/panfrost/lib/pan_cs.c:437:9: warning: enumeration value ‘PAN_AFBC_MODE_R5G5B5A1’ not handled in switch [-Wswitch]
  437 |         switch (panfrost_afbc_format(PAN_ARCH, format)) {
      |         ^~~~~~

...indicating that some formats were missed, leading to assertion fails "unknown
canonical AFBC format" when rendering RGB5A1, which dEQP-GLES31 does. Fixes
regressions in
dEQP-GLES31.functional.draw_buffers_indexed.random.max_required_draw_buffers.*
on Valhall.

Given how scarce v9 hardware is, that v10 isn't upstream yet, and the offending
code was merged a week ago, this should not have actually affected anyone. At
any rate, it's a good reminder we really do need CI for v9...

Fixes: 8e125b6c15b ("panfrost: Enable AFBC of more formats")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>

20 months agopanfrost: Luminance-alpha AFBC unsupported on v7+
Alyssa Rosenzweig [Wed, 14 Dec 2022 05:11:43 +0000 (00:11 -0500)]
panfrost: Luminance-alpha AFBC unsupported on v7+

The L8_UNORM, A8_UNORM, and L8A8_UNORM v7 formats do not support AFBC,
regardless of swizzling. We're about to lift the restrictions on swizzling with
AFBC on v7, so we'll need to handle these cases explicitly to avoid using AFBC
in these cases.

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

20 months agopanfrost: Align WSI strides for tiled AFBC
Alyssa Rosenzweig [Wed, 14 Dec 2022 01:31:38 +0000 (20:31 -0500)]
panfrost: Align WSI strides for tiled AFBC

When calculating legacy WSI strides for tiled AFBC, we need to account for the
greater alignment requirement of tiled AFBC, or importing resources will fail
later.

Since tiled AFBC is only supported on v7 and later, and AFBC of window surfaces
isn't being used on Linux on v7 and later, this probably hasn't been hit in
practice. Probably.

We're about to fix AFBC of window surfaces so we need to fix this side first.

Fixes: 0255f554f39 ("panfrost: Advertise 16x16 tiled AFBC")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>

20 months agopanfrost: Remove panfrost_blit_format
Alyssa Rosenzweig [Wed, 14 Dec 2022 01:08:50 +0000 (20:08 -0500)]
panfrost: Remove panfrost_blit_format

Trivial.

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

20 months agopanfrost: Remove RGTC emulation relic
Alyssa Rosenzweig [Wed, 14 Dec 2022 01:06:50 +0000 (20:06 -0500)]
panfrost: Remove RGTC emulation relic

u_transfer_helper no longer emulates RGTC, so this code path is dead. RGTC
emulation now happens in the state tracker so the formats will work out
properly. (Similar to how other BCn formats are emulated in mesa/st.)

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

20 months agoasahi: Remove agx_blit_format
Alyssa Rosenzweig [Wed, 14 Dec 2022 01:06:24 +0000 (20:06 -0500)]
asahi: Remove agx_blit_format

Copied from panfrost, decopy the useless.

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

20 months agoradv/ci: add yet another pipeline barrier test as flake
Rhys Perry [Fri, 16 Dec 2022 15:13:54 +0000 (15:13 +0000)]
radv/ci: add yet another pipeline barrier test as flake

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/33638274

Also add a few similar tests.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20359>

20 months agoradv/gfx11: enable VK_AMD_shader_explicit_vertex_parameter
Rhys Perry [Thu, 15 Dec 2022 17:26:53 +0000 (17:26 +0000)]
radv/gfx11: enable VK_AMD_shader_explicit_vertex_parameter

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

20 months agoac/llvm/gfx11: implement load_input_vertex
Rhys Perry [Thu, 15 Dec 2022 17:25:56 +0000 (17:25 +0000)]
ac/llvm/gfx11: implement load_input_vertex

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

20 months agoaco/gfx11: implement load_input_vertex
Rhys Perry [Thu, 15 Dec 2022 17:20:10 +0000 (17:20 +0000)]
aco/gfx11: implement load_input_vertex

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

20 months agoOpenCL/draw module: Support linking with LLVM and clang 15 static libraries
pal1000 [Sun, 9 Oct 2022 21:56:03 +0000 (00:56 +0300)]
OpenCL/draw module: Support linking with LLVM and clang 15 static libraries

Cc: mesa-stable
Closes: #7243

Closes: #7487

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19009>

20 months agoradv: enable graphicsPipelineLibraryIndependentInterpolationDecoration
Samuel Pitoiset [Wed, 7 Dec 2022 13:37:08 +0000 (14:37 +0100)]
radv: enable graphicsPipelineLibraryIndependentInterpolationDecoration

They don't need to match.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20202>

20 months agoradv: enable graphicsPipelineLibraryFastLinking
Samuel Pitoiset [Wed, 7 Dec 2022 11:10:01 +0000 (12:10 +0100)]
radv: enable graphicsPipelineLibraryFastLinking

I think fast-linking could be improved a lot but this allows to test
GPL with Zink (RADV_PERFTEST=gpl + ZINK_DEBUG=gpl).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20202>

20 months agoradv: import compiled binaries from libraries only when fast-linking is enabled
Samuel Pitoiset [Wed, 7 Dec 2022 13:28:48 +0000 (14:28 +0100)]
radv: import compiled binaries from libraries only when fast-linking is enabled

When VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT is used, the
pipeline includes a complete set of state specified entirely by
libraries. That means that we should skip using compiled binaries
(including PS epilogs) and we should create an optimized pipeline.

Found this with Zink because RADV was creating two pipelines with the
same PS epilog, while the optimized one shouldn't use any PS epilog.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20202>

20 months agoradv/gfx11: disable mesh shaders
Rhys Perry [Thu, 15 Dec 2022 20:51:25 +0000 (20:51 +0000)]
radv/gfx11: disable mesh shaders

Even if the perftest is used, these should be disabled on GFX11. We
don't implement it yet

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

20 months agoaco/gfx11: export mrtz in discard early exit for non-color shaders
Rhys Perry [Thu, 15 Dec 2022 20:31:52 +0000 (20:31 +0000)]
aco/gfx11: export mrtz in discard early exit for non-color shaders

If a shader doesn't export any color targets and instead only exports
mrtz, the discard early exit block should match.

Fixes artifacts on Lara in Rise of the Tomb Raider benchmark and hair in
The Witcher 3 (classic).

https://reviews.llvm.org/D128185

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: bc8da20dda6 ("aco: export MRT0 instead of NULL on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20345>

20 months agozink: fix line-smooth interpolation
Erik Faye-Lund [Mon, 5 Dec 2022 15:16:43 +0000 (16:16 +0100)]
zink: fix line-smooth interpolation

Extending the lines by half a pixel in each direction without doing
anything about the varyings makes the varyings interpolate over a
distance than intended. While this can be negligeble for long lines,
it can lead to big error for short lines.

Let's instead add extra geometry for each of the line-caps, so we can
make sure the varyings stay constant for the whole cap, and interpolate
over the intended distance instead.

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

20 months agozink: lower smooth-lines if not supported
Erik Faye-Lund [Tue, 6 Dec 2022 07:54:34 +0000 (08:54 +0100)]
zink: lower smooth-lines if not supported

This implements line-smoothing the same way as the draw-module does,
except using a geometry shader instead of a CPU pass.

Ideally, this should be enabled either by checking for the various
smooth-line caps, or by a DRIconf setting.

Unfortunately, RADV doesn't support he smooth-lines features, and we
don't want to force it down a pessimistic shader-key code-path. So that
plan is out the window for now.

While DRIconf is also neat, it's a bit of work to wire up, and we don't
really know of any real-world applications who would need this yet. So,
for now, let's just unconditionally enable is on the IMG proprietary
driver, which is going to need this for sure.

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

20 months agozink: add line-smooth lowering passes
Erik Faye-Lund [Wed, 16 Nov 2022 15:28:06 +0000 (16:28 +0100)]
zink: add line-smooth lowering passes

These passes implements basically the same logic as draw_pipe_aaline.c
does, but using geometry shaders instead of doing it CPU-side.

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

20 months agozink: fix line-stipple varying allocation
Erik Faye-Lund [Thu, 1 Dec 2022 21:17:42 +0000 (22:17 +0100)]
zink: fix line-stipple varying allocation

This was really derpy. There's two things wrong; first of all, we should
pick at LEAST VARYING_SLOT_VAR0, second, util_last_bit64 returns one
more than the index of the bit already, so we don't want to add twice
here.

Fixes: 4b17c099ca4 ("zink: add line-stippling lowering passes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19847>

20 months agor600/sfn: Check possibility of channel switching also for trans-slot
Gert Wollny [Fri, 16 Dec 2022 10:46:33 +0000 (11:46 +0100)]
r600/sfn: Check possibility of channel switching also for trans-slot

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

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

20 months agor600: don't try to serialized shaders translated from TGSI
Gert Wollny [Thu, 15 Dec 2022 14:23:48 +0000 (15:23 +0100)]
r600: don't try to serialized shaders translated from TGSI

TTN seems to have a problem encoding vec4[4] correctly, so that
serialization might fail.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7891

Fixes: 5b205ef (r600: Store nir shaders serialized to save memory)

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

20 months agoci: allow omitting of --rev for ci_run_n_monitor.py
David Heidelberg [Thu, 15 Dec 2022 23:36:13 +0000 (00:36 +0100)]
ci: allow omitting of --rev for ci_run_n_monitor.py

When --rev is omitted, try to get revision automatically.

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20271>

20 months agoci: ci_run_n_monitor fix Unicode log parsing
David Heidelberg [Sun, 11 Dec 2022 23:48:05 +0000 (00:48 +0100)]
ci: ci_run_n_monitor fix Unicode log parsing

Fixes issues as  `...truncated \ xXX escape` while parsing the log.

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20271>

20 months agov3dv: be more careful when restoring dirty state after meta operations
Iago Toral Quiroga [Fri, 16 Dec 2022 11:31:27 +0000 (12:31 +0100)]
v3dv: be more careful when restoring dirty state after meta operations

So far we have been only restoring dirty dynamic states used by meta
pipelines however, static state from meta pipelines will also clear
dirty flags, preventing follow-up draw calls in the command buffer
to honor these if they are flagged as dynamic states in their
pipelines. Fix this by always resetting all dirty state flags after
a meta operation so we re-emit all the state we need with the next draw
call.

Fixes:
dEQP-VK.dynamic_state.monolithic.image.clear

cc: mesa-stable

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

20 months agov3dv: pipeline creation feedback may not request all stages
Iago Toral Quiroga [Fri, 16 Dec 2022 09:32:15 +0000 (10:32 +0100)]
v3dv: pipeline creation feedback may not request all stages

Nothing in the spec seems to require that the number of stages for
which creation feedback is requested must match the number of stages
available in the pipeline. In fact, the spec explicitly mentions
that this number could be 0:

   "If pipelineStageCreationFeedbackCount is not 0,
    pPipelineStageCreationFeedbacks must be a valid pointer to an
    array of pipelineStageCreationFeedbackCount
    VkPipelineCreationFeedback structures"

Fixes an assert crash in:
dEQP-VK.pipeline.monolithic.creation_feedback.graphics_tests.vertex_stage_fragment_stage_no_cache_zero_out_feedback_cout

cc: mesa-stable

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

20 months agoegl/wayland: Prefer back buffer with minimum buffer age
Michel Dänzer [Fri, 20 Aug 2021 15:56:24 +0000 (17:56 +0200)]
egl/wayland: Prefer back buffer with minimum buffer age

This may allow applications making use of buffer age to save some effort
in some cases.

v2: (Simon Ser)
* Add space between struct member and "<" operator.
* Remove break statement which prevented the change from working as
  intended in swrast_update_buffers.

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

20 months agoloader/dri3: Simplify new buffer allocation in dri3_find_back
Michel Dänzer [Fri, 20 Aug 2021 15:10:24 +0000 (17:10 +0200)]
loader/dri3: Simplify new buffer allocation in dri3_find_back

We can find the idle buffer with lowest buffer age or the first
unallocated slot in the same loop.

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

20 months agoloader/dri3: Find idle buffer with minimum buffer age in dri3_find_back
Michel Dänzer [Thu, 19 Aug 2021 13:53:06 +0000 (15:53 +0200)]
loader/dri3: Find idle buffer with minimum buffer age in dri3_find_back

This may allow applications making use of buffer age to save some effort
in some cases.

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

20 months agoloader/dri3: Clean up dri3_find_back logic
Michel Dänzer [Thu, 19 Aug 2021 14:03:03 +0000 (16:03 +0200)]
loader/dri3: Clean up dri3_find_back logic

No need to go through the loop again for allocating a new buffer.

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

20 months agozink: lower mem_global to scalar
Karol Herbst [Thu, 1 Dec 2022 15:57:22 +0000 (16:57 +0100)]
zink: lower mem_global to scalar

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20106>

20 months agonir_lower_io_to_scalar: handle load/store_global
Karol Herbst [Thu, 1 Dec 2022 15:55:27 +0000 (16:55 +0100)]
nir_lower_io_to_scalar: handle load/store_global

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20106>

20 months agonir_lower_io_to_scalar: make use of nir_get_io_offset_src
Karol Herbst [Thu, 1 Dec 2022 15:53:49 +0000 (16:53 +0100)]
nir_lower_io_to_scalar: make use of nir_get_io_offset_src

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20106>

20 months agov3dv: honor render area in subpass resolve fallback
Iago Toral Quiroga [Thu, 15 Dec 2022 07:04:08 +0000 (08:04 +0100)]
v3dv: honor render area in subpass resolve fallback

When falling back to handling subpass resolves via separate
image resolves we were resolving the entire attachment instead
of limiting the resolve to the render area defined for the render
pass.

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

20 months agov3dv: handle depth/stencil resolves we can't implement via TLB
Iago Toral Quiroga [Wed, 14 Dec 2022 11:38:28 +0000 (12:38 +0100)]
v3dv: handle depth/stencil resolves we can't implement via TLB

If we can't use the TLB to do a subpass resolve we have a fallaback
that emits separate image resolves, but this fallback was only
handling color resolves. This adds depth/stencil as well.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

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