platform/upstream/mesa.git
2 years agoci/dxvk: fix DXVK 64-bit only wine setup
David Heidelberg [Wed, 14 Sep 2022 19:36:51 +0000 (21:36 +0200)]
ci/dxvk: fix DXVK 64-bit only wine setup

Reported: https://github.com/doitsujin/dxvk/issues/2921

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

2 years agoci/lava: prepare wineprefix for GL and DXVK
David Heidelberg [Thu, 4 Aug 2022 14:02:35 +0000 (16:02 +0200)]
ci/lava: prepare wineprefix for GL and DXVK

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

2 years agoci/lava: add wine and apitrace into amd64 rootfs container
David Heidelberg [Sat, 16 Jul 2022 12:11:16 +0000 (14:11 +0200)]
ci/lava: add wine and apitrace into amd64 rootfs container

Wine is from WineHQ, with stripped i386 part, which we don't use.

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

2 years agoradv: fix handling multiview with GPL
Samuel Pitoiset [Tue, 20 Sep 2022 10:53:11 +0000 (12:53 +0200)]
radv: fix handling multiview with GPL

When multiview is used, the last pre-rasterization stage should export
the layer to the fragment shader. With GPL, the next stage is
implicitly FS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>

2 years agoradv: fix handling primitive ID and clip/cull distances with GPL
Samuel Pitoiset [Tue, 20 Sep 2022 09:19:13 +0000 (11:19 +0200)]
radv: fix handling primitive ID and clip/cull distances with GPL

When compiling the pre-rasterization stages with GPL, we can't know if
the fragment shader reads the primitive ID or the clip/cull distances
as inputs and we have to export them unconditionally.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>

2 years agoradv: fix handling ViewportIndex with GPL
Samuel Pitoiset [Tue, 20 Sep 2022 09:40:35 +0000 (11:40 +0200)]
radv: fix handling ViewportIndex with GPL

When the fragment shader reads the viewport index as input and the last
pre-rasterization stage doesn't export it, it should be implicitly
zero (ie. first viewport). When the next stage is known, it's already
lowered in NIR, but with GPL we can't because we don't know if the FS
reads it. To fix this use AC_EXP_PARAM_DEFAULT_VAL_000.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>

2 years agoradv: rework multiview lowering in NIR slightly
Samuel Pitoiset [Tue, 20 Sep 2022 10:46:15 +0000 (12:46 +0200)]
radv: rework multiview lowering in NIR slightly

This will be used to export multiview unconditionally with GPL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>

2 years agov3dv: expose VK_EXT_image_robustness
Iago Toral Quiroga [Fri, 23 Sep 2022 07:10:36 +0000 (09:10 +0200)]
v3dv: expose VK_EXT_image_robustness

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

2 years agobroadcom/compiler: add a lowering for robust image access
Iago Toral Quiroga [Mon, 26 Sep 2022 08:47:19 +0000 (10:47 +0200)]
broadcom/compiler: add a lowering for robust image access

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

2 years agobroadcom/compiler: rename static helpers involved with robust buffer access
Iago Toral Quiroga [Fri, 23 Sep 2022 09:19:34 +0000 (11:19 +0200)]
broadcom/compiler: rename static helpers involved with robust buffer access

To make it explicit that they involve buffers, since we will be adding
robust image access shortly.

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

2 years agobroadcom/compiler: rename v3d_nir_lower_robust_buffer_access.c
Iago Toral Quiroga [Fri, 23 Sep 2022 09:01:45 +0000 (11:01 +0200)]
broadcom/compiler: rename v3d_nir_lower_robust_buffer_access.c

We are going to add code to handle image robustness shortly, so
better rename this to v3d_nir_lower_robust_access.c

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

2 years agodocs: fixup broken rst syntax
Erik Faye-Lund [Sat, 17 Sep 2022 11:09:20 +0000 (13:09 +0200)]
docs: fixup broken rst syntax

Seems I messed this up when converting things, and nobody noticed until
now!

Fixes: d4397c00485 ("docs: use envvar role for envvars")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18641>

2 years agoci/docs: Stick to specific version of python packages
Yonggang Luo [Tue, 27 Sep 2022 02:23:42 +0000 (10:23 +0800)]
ci/docs: Stick to specific version of python packages

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18833>

2 years agomesa/main: don't copy signed rgtc via float
Erik Faye-Lund [Thu, 8 Sep 2022 09:48:49 +0000 (11:48 +0200)]
mesa/main: don't copy signed rgtc via float

There's no good reason to copy via float instead of snorm, so let's take
that shortcut.

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

2 years agomesa/main: fix broken indent
Erik Faye-Lund [Thu, 8 Sep 2022 09:32:17 +0000 (11:32 +0200)]
mesa/main: fix broken indent

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

2 years agonir/loop_analyze: remove cost of redundant selects
Timothy Arceri [Wed, 14 Sep 2022 01:21:00 +0000 (11:21 +1000)]
nir/loop_analyze: remove cost of redundant selects

If we know that a select will be eliminated once the loop is
unrolled than we don't need to count the instruction towards the
cost of the loop.

This change helps 2 loops unroll in an xcom enemy unknown shader
that is loaded full of these redundant selects.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18587>

2 years agonir/loop_analyze: delay instruction cost calculation
Timothy Arceri [Wed, 14 Sep 2022 00:18:05 +0000 (10:18 +1000)]
nir/loop_analyze: delay instruction cost calculation

Here we move the calculation of the instruction cost of the loop
after we have processed other information such as finding the
induction variables. This is useful because we can use this further
information to find instructions that will be eliminated if the
loop was to unroll and therefore give them a cost of 0.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18587>

2 years agorusticl/mem: return errors for OOB accesses
Karol Herbst [Sun, 25 Sep 2022 12:20:59 +0000 (14:20 +0200)]
rusticl/mem: return errors for OOB accesses

There is a little bit more to do, but this at least resolves crashes due
to OOB accesses and/or assertions.

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

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

2 years agomesa: make glPopMatrix a no-op if the matrix hasn't changed
Marek Olšák [Tue, 23 Aug 2022 04:13:37 +0000 (00:13 -0400)]
mesa: make glPopMatrix a no-op if the matrix hasn't changed

This happens a lot with viewperf because glMultMatrixf contains identity
matrices.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: use memcmp instead of floating-point comparisons in glMultMatrixf
Marek Olšák [Tue, 23 Aug 2022 04:12:59 +0000 (00:12 -0400)]
mesa: use memcmp instead of floating-point comparisons in glMultMatrixf

This is faster.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoglthread: skip glMultMatrixf if it's identity
Marek Olšák [Tue, 23 Aug 2022 04:12:09 +0000 (00:12 -0400)]
glthread: skip glMultMatrixf if it's identity

This is common with viewperf and it helps.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoglthread,hud: draw per-frame values and expose the number of batches per frame
Marek Olšák [Tue, 23 Aug 2022 04:09:23 +0000 (00:09 -0400)]
glthread,hud: draw per-frame values and expose the number of batches per frame

This is better because we see the statistics for 1 frame instead of 1 second.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoglthread: use 8-bit GLenum for prim modes where it results in better packing
Marek Olšák [Sun, 21 Aug 2022 21:30:18 +0000 (17:30 -0400)]
glthread: use 8-bit GLenum for prim modes where it results in better packing

This is OK because all modes > 14 are invalid.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoglthread: use GLenum16 for enums, but clamp it to 0xffff to get correct errors
Marek Olšák [Sun, 21 Aug 2022 19:49:53 +0000 (15:49 -0400)]
glthread: use GLenum16 for enums, but clamp it to 0xffff to get correct errors

0xffff is an invalid enum.

This was initially implemented without clamping and then reverted because
of the concern that we would randomly get correct enums and not report
errors if we just dropped the high bits.

This packs calls better in glthread_batch.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: rename GL dispatch initialization functions to make the intent clear
Marek Olšák [Thu, 11 Aug 2022 08:34:00 +0000 (04:34 -0400)]
mesa: rename GL dispatch initialization functions to make the intent clear

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: remove deprecated comments
Marek Olšák [Fri, 12 Aug 2022 09:20:31 +0000 (05:20 -0400)]
mesa: remove deprecated comments

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoapi_hw_select_init_h.py: simplify the code
Marek Olšák [Thu, 11 Aug 2022 15:04:13 +0000 (11:04 -0400)]
api_hw_select_init_h.py: simplify the code

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoglapi: rename 'vtxfmt' to 'beginend' to make it clear
Marek Olšák [Fri, 12 Aug 2022 08:58:14 +0000 (04:58 -0400)]
glapi: rename 'vtxfmt' to 'beginend' to make it clear

These are really just the functions that execute between Begin/End.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: initialize OutsideBeginEnd directly instead of through Exec
Marek Olšák [Thu, 11 Aug 2022 05:26:06 +0000 (01:26 -0400)]
mesa: initialize OutsideBeginEnd directly instead of through Exec

Exec is just a mutable pointer to one of the dispatch tables.
OutsideBeginEnd is what we are actually initializing here. This makes
the original intention clear.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: remove unused function _mesa_get_dispatch
Marek Olšák [Wed, 10 Aug 2022 05:06:40 +0000 (01:06 -0400)]
mesa: remove unused function _mesa_get_dispatch

just use CurrentClientDispatch directly

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: don't restore the dispatch at the end of glCallList
Marek Olšák [Wed, 10 Aug 2022 04:56:26 +0000 (00:56 -0400)]
mesa: don't restore the dispatch at the end of glCallList

No places use the glapi dispatch. All places use ctx directly.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agovbo: don't call _glapi_set_dispatch for GL_COMPILE_AND_EXECUTE loopback
Marek Olšák [Wed, 10 Aug 2022 04:08:02 +0000 (00:08 -0400)]
vbo: don't call _glapi_set_dispatch for GL_COMPILE_AND_EXECUTE loopback

It uses Exec directly, so this didn't do anything.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: reorder and pack gl_buffer_object
Marek Olšák [Mon, 22 Aug 2022 04:43:36 +0000 (00:43 -0400)]
mesa: reorder and pack gl_buffer_object

The frequently-accessed fields are at the beginning, hoping
we only need to load 1 cache line to get them all.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: remove unused gl_buffer_object::Data and Written
Marek Olšák [Mon, 22 Aug 2022 04:30:00 +0000 (00:30 -0400)]
mesa: remove unused gl_buffer_object::Data and Written

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: restructure bind_buffer_object for better performance
Marek Olšák [Mon, 22 Aug 2022 05:40:35 +0000 (01:40 -0400)]
mesa: restructure bind_buffer_object for better performance

The CPU time spent in _mesa_BindBuffer_no_error decresed from 11.4% to 9.2%.
I explain in the code what is happening here because it's not obvious.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: inline _mesa_handle_bind_buffer_gen and correct things
Marek Olšák [Mon, 22 Aug 2022 05:37:36 +0000 (01:37 -0400)]
mesa: inline _mesa_handle_bind_buffer_gen and correct things

Changes:
- the function is inlined, which will help the next commit to improve perf
- use no_error inside the function
- if the function returns true, the buffer is non-NULL, so remove NULL
  checking in callers

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: inline _mesa_reference_buffer_object
Marek Olšák [Mon, 22 Aug 2022 05:31:41 +0000 (01:31 -0400)]
mesa: inline _mesa_reference_buffer_object

The last parameter is always a constant expression, so this simplifies it.
This is also required by later commits.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: trivial simplifications in _mesa_reference_buffer_object_
Marek Olšák [Sun, 21 Aug 2022 17:59:41 +0000 (13:59 -0400)]
mesa: trivial simplifications in _mesa_reference_buffer_object_

The else statement conditions were tautological.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: clean up st_indirect_draw_vbo interface and callers
Marek Olšák [Sun, 14 Aug 2022 04:57:11 +0000 (00:57 -0400)]
mesa: clean up st_indirect_draw_vbo interface and callers

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: remove unused code using _mesa_prim
Marek Olšák [Sun, 14 Aug 2022 04:35:41 +0000 (00:35 -0400)]
mesa: remove unused code using _mesa_prim

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: remove _mesa_draw_gallium_fallback by adapting st_feedback_draw_vbo
Marek Olšák [Sun, 14 Aug 2022 04:21:30 +0000 (00:21 -0400)]
mesa: remove _mesa_draw_gallium_fallback by adapting st_feedback_draw_vbo

This makes st_feedback_draw_vbo implement the DrawGallium.
That's the last users of the fallback functions.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agomesa: replace ALLOC_PRIMS with persistently-allocated context arrays
Marek Olšák [Sun, 14 Aug 2022 03:52:46 +0000 (23:52 -0400)]
mesa: replace ALLOC_PRIMS with persistently-allocated context arrays

This is cleaner.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>

2 years agoradv: Build acceleration structures using BVH IR
Friedrich Vock [Sat, 24 Sep 2022 20:10:02 +0000 (22:10 +0200)]
radv: Build acceleration structures using BVH IR

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agoradv: Create pipelines for conversion meta shaders
Friedrich Vock [Fri, 23 Sep 2022 14:02:37 +0000 (16:02 +0200)]
radv: Create pipelines for conversion meta shaders

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agoradv: Add conversion shader for leaf nodes
Friedrich Vock [Wed, 21 Sep 2022 13:09:55 +0000 (15:09 +0200)]
radv: Add conversion shader for leaf nodes

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agoradv: Add conversion shader for internal nodes
Friedrich Vock [Mon, 19 Sep 2022 21:16:10 +0000 (23:16 +0200)]
radv: Add conversion shader for internal nodes

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agoradv: Add BVH IR types
Friedrich Vock [Thu, 22 Sep 2022 20:47:11 +0000 (22:47 +0200)]
radv: Add BVH IR types

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agoradv: Split CmdBuildAccelerationStructuresKHR into different functions
Friedrich Vock [Wed, 21 Sep 2022 14:02:36 +0000 (16:02 +0200)]
radv: Split CmdBuildAccelerationStructuresKHR into different functions

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agoradv: Rename internal node shader to lbvh_internal
Friedrich Vock [Mon, 19 Sep 2022 21:15:31 +0000 (23:15 +0200)]
radv: Rename internal node shader to lbvh_internal

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18769>

2 years agozink: only emit runtime array for ssbos if present
Mike Blumenkrantz [Wed, 14 Sep 2022 18:17:22 +0000 (14:17 -0400)]
zink: only emit runtime array for ssbos if present

it's impossible to accurately determine whether an op will use the base,
sized array or the unsized array due to dynamic indexing, and thus it's
impossible to not violate spec by emitting both arrays at offset=0 so they
can overlap

so instead, just emit the runtime array and blast all bounds checking in
vk drivers into the void

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

2 years agozink: remove color_write_missing driver workaround
Mike Blumenkrantz [Wed, 14 Sep 2022 12:18:30 +0000 (08:18 -0400)]
zink: remove color_write_missing driver workaround

this is no longer used

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

2 years agozink: allow reordered clear_buffer calls
Mike Blumenkrantz [Fri, 9 Sep 2022 14:42:49 +0000 (10:42 -0400)]
zink: allow reordered clear_buffer calls

rare to hit, but no point in not promoting them when possible

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

2 years agozink: avoid overflow when clamping bufferviews
Mike Blumenkrantz [Wed, 7 Sep 2022 17:21:28 +0000 (13:21 -0400)]
zink: avoid overflow when clamping bufferviews

cc: mesa-stable

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

2 years agozink: name bo variables using bitsize
Mike Blumenkrantz [Thu, 15 Sep 2022 13:58:08 +0000 (09:58 -0400)]
zink: name bo variables using bitsize

debugging++

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

2 years agozink: fix handling for ssbos that are just runtime arrays
Mike Blumenkrantz [Mon, 12 Sep 2022 15:08:20 +0000 (11:08 -0400)]
zink: fix handling for ssbos that are just runtime arrays

this used to correctly calculate runtime array size as zero, but since the
switch to glsl_get_explicit_size(), zero can no longer be returned

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

2 years agozink: fix sparse queue creation
Mike Blumenkrantz [Mon, 19 Sep 2022 14:14:26 +0000 (10:14 -0400)]
zink: fix sparse queue creation

to use an explicit sparse queue, it has to actually be created along with
the device

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

2 years agozink: always unset var->data.explicit_xfb_buffer
Mike Blumenkrantz [Sun, 25 Sep 2022 19:11:04 +0000 (15:11 -0400)]
zink: always unset var->data.explicit_xfb_buffer

ensure that this isn't accidentally triggering for non-xfb shaders

Fixes: 6d40db84c9d ("zink: handle direct xfb output from output variables")

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

2 years agozink: free vertex_state_cache on shutdown
Mike Blumenkrantz [Fri, 23 Sep 2022 13:46:43 +0000 (09:46 -0400)]
zink: free vertex_state_cache on shutdown

cc: mesa-stable

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

2 years agozink: fix some batch tracking leaks
Mike Blumenkrantz [Fri, 23 Sep 2022 13:46:10 +0000 (09:46 -0400)]
zink: fix some batch tracking leaks

not leaking over time, just leaking on shutdown

Fixes: 83c76b8efbf ("zink: rework batch tracking for resources")

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

2 years agozink: add asserts to verify optimal key state
Mike Blumenkrantz [Mon, 26 Sep 2022 17:46:20 +0000 (13:46 -0400)]
zink: add asserts to verify optimal key state

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

2 years agozink: copy optimal key always
Mike Blumenkrantz [Mon, 26 Sep 2022 17:46:10 +0000 (13:46 -0400)]
zink: copy optimal key always

this is going away in the future, but for now it's annoying

Fixes: 7336580408a ("zink: unspaghettify some program update code")

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

2 years agoiris: Ignore aux for copy_region source if there's no unresolved color
Kenneth Graunke [Fri, 23 Sep 2022 05:50:37 +0000 (22:50 -0700)]
iris: Ignore aux for copy_region source if there's no unresolved color

This mirrors the behavior of iris_resource_texture_aux_usage(), which
bypasses the aux metadata when there's no advantage to using it.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18790>

2 years agolavapipe: propagate shader access info across libraries
Mike Blumenkrantz [Mon, 26 Sep 2022 19:22:35 +0000 (15:22 -0400)]
lavapipe: propagate shader access info across libraries

cc: mesa-stable

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

2 years agolavapipe: set writemask for compute shader buffers
Mike Blumenkrantz [Mon, 26 Sep 2022 18:41:31 +0000 (14:41 -0400)]
lavapipe: set writemask for compute shader buffers

I don't know how this wasn't being set?

cc: mesa-stable

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

2 years agod3d12: Replace size_t with uint64_t in d3d12_video_encoder definitions for cross...
Sil Vilerino [Mon, 26 Sep 2022 11:59:11 +0000 (07:59 -0400)]
d3d12: Replace size_t with uint64_t in d3d12_video_encoder definitions for cross-plat compatibility

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18821>

2 years agozink: unspaghettify some program update code
Mike Blumenkrantz [Tue, 6 Sep 2022 16:35:43 +0000 (12:35 -0400)]
zink: unspaghettify some program update code

the initial implementation of optimal_keys was added inline, but really
it's an entirely different codepath. by separating these out, it makes the
code more readable, and it also allows for slightly better optimization of
of the optimal_keys codepath

~4-5% improvement for drawoverhead -test 7

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: be even more granular with optimal_key program updates
Mike Blumenkrantz [Fri, 2 Sep 2022 15:13:44 +0000 (11:13 -0400)]
zink: be even more granular with optimal_key program updates

since the bits of each key are easily and efficiently comparable,
the draw-time updating here can be made extremely granular to
update exactly the stages that have changed since the last
time the program was used, further reducing overhead instead of
updating every possible key value

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: simplify bit tracking in zink_gfx_program_update()
Mike Blumenkrantz [Fri, 2 Sep 2022 15:08:46 +0000 (11:08 -0400)]
zink: simplify bit tracking in zink_gfx_program_update()

much nicer now that gfx dirty bits are isolated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: split dirty_shader_stages for gfx and compute
Mike Blumenkrantz [Fri, 2 Sep 2022 15:07:34 +0000 (11:07 -0400)]
zink: split dirty_shader_stages for gfx and compute

this simplifies/clarifies a lot of related code

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: use optimal_keys to massively reduce size of pipeline cache comparisons
Mike Blumenkrantz [Thu, 1 Sep 2022 20:52:27 +0000 (16:52 -0400)]
zink: use optimal_keys to massively reduce size of pipeline cache comparisons

since the entire pipeline module key is a uint32_t, this value can be used
for comparisons instead of comparing every shader module

ideally in the future more drivers will support the required features for
optimal_keys, allowing the other variant functions to be deleted

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: add 'optimal_keys' handling for shader keys
Mike Blumenkrantz [Thu, 1 Sep 2022 19:56:06 +0000 (15:56 -0400)]
zink: add 'optimal_keys' handling for shader keys

if it's known on init that there are no variants for nonseamless cubes,
or inlined values, or decomposed vertex attrs, then shader keys can be
compressed more optimally to reduce the work needed on program updates

more importantly, this reduces the total hash value for all the shader
modules to a single uint32_t (technically 24 bits), which is much better
than having to manage and incrementally add all the separte module hashes

...but for now using this is incompatible with gpl, so disable that

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: add some padding to small shader keys for byte-alignment
Mike Blumenkrantz [Thu, 1 Sep 2022 19:55:46 +0000 (15:55 -0400)]
zink: add some padding to small shader keys for byte-alignment

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: ALWAYS_INLINE bind_gfx_stage
Mike Blumenkrantz [Thu, 1 Sep 2022 17:53:22 +0000 (13:53 -0400)]
zink: ALWAYS_INLINE bind_gfx_stage

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: move to AoS for gfx program shader modules
Mike Blumenkrantz [Thu, 1 Sep 2022 17:45:53 +0000 (13:45 -0400)]
zink: move to AoS for gfx program shader modules

this matches up better with the actual usage; the zink_shader_module
is still stored in the shader cache

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: copy the non-dirty shader stages when updating gfx program
Mike Blumenkrantz [Thu, 1 Sep 2022 17:37:41 +0000 (13:37 -0400)]
zink: copy the non-dirty shader stages when updating gfx program

typo during refactoring

Fixes: d8455e5ebfa ("zink: change u_foreach_bit to regular for loop in zink_gfx_program_update")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: handle inline uniforms during first-time shader generation
Mike Blumenkrantz [Thu, 1 Sep 2022 17:33:44 +0000 (13:33 -0400)]
zink: handle inline uniforms during first-time shader generation

this is unlikely but possible

Fixes: a0e69e7601a ("zink: split out first-time shader module creation")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: remove a bunch of casts from shader key inlines
Mike Blumenkrantz [Thu, 1 Sep 2022 17:19:54 +0000 (13:19 -0400)]
zink: remove a bunch of casts from shader key inlines

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: wrap zink_shader_key_base access for nonseamless cubemap use
Mike Blumenkrantz [Thu, 1 Sep 2022 17:07:39 +0000 (13:07 -0400)]
zink: wrap zink_shader_key_base access for nonseamless cubemap use

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: check on init whether decomposed attrs are needed
Mike Blumenkrantz [Thu, 1 Sep 2022 16:57:56 +0000 (12:57 -0400)]
zink: check on init whether decomposed attrs are needed

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agozink: add a bool flag for decomposed vertex elements
Mike Blumenkrantz [Thu, 1 Sep 2022 16:32:11 +0000 (12:32 -0400)]
zink: add a bool flag for decomposed vertex elements

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18786>

2 years agoci/crocus: update ci results
Erik Faye-Lund [Mon, 26 Sep 2022 12:56:14 +0000 (14:56 +0200)]
ci/crocus: update ci results

Seems we haven't been running the Crocus CI much lately, and some things
has changed. The new failures needs to be investegated and fixed, but
let's update the results for now.

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

2 years agoaco: mostly implement FS input loads on GFX11
Rhys Perry [Mon, 20 Jun 2022 17:11:07 +0000 (18:11 +0100)]
aco: mostly implement FS input loads on GFX11

Quad-divergent CF and vertex selection doesn't work, but should at least
prevent crashes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco/tests: add GFX11 assembly tests
Rhys Perry [Fri, 17 Jun 2022 16:42:35 +0000 (17:42 +0100)]
aco/tests: add GFX11 assembly tests

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: omit read-only memory_sync_info when printing
Rhys Perry [Mon, 18 Jul 2022 19:44:21 +0000 (20:44 +0100)]
aco: omit read-only memory_sync_info when printing

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add VINTERP instruction format
Rhys Perry [Fri, 17 Jun 2022 12:53:08 +0000 (13:53 +0100)]
aco: add VINTERP instruction format

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add LDSDIR instruction format
Rhys Perry [Fri, 17 Jun 2022 12:53:08 +0000 (13:53 +0100)]
aco: add LDSDIR instruction format

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: limit GFX11 to 128 VGPRs for now
Rhys Perry [Tue, 9 Aug 2022 18:29:34 +0000 (19:29 +0100)]
aco: limit GFX11 to 128 VGPRs for now

See https://reviews.llvm.org/D128054

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: update assembler for GFX11
Rhys Perry [Fri, 17 Jun 2022 10:23:00 +0000 (11:23 +0100)]
aco: update assembler for GFX11

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco/gfx11: don't use more than 1 NSA dword
Rhys Perry [Thu, 14 Jul 2022 14:37:07 +0000 (15:37 +0100)]
aco/gfx11: don't use more than 1 NSA dword

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add GFX11 opcode numbers
Rhys Perry [Thu, 16 Jun 2022 17:15:16 +0000 (18:15 +0100)]
aco: add GFX11 opcode numbers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: fix assembly of MUBUF-to-LDS loads
Rhys Perry [Fri, 17 Jun 2022 15:25:42 +0000 (16:25 +0100)]
aco: fix assembly of MUBUF-to-LDS loads

These have an implicit m0 read and don't write VGPRs.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: add reg() helper to assembler
Rhys Perry [Thu, 16 Jun 2022 18:36:24 +0000 (19:36 +0100)]
aco: add reg() helper to assembler

SGPR encoding is slightly different on GFX11.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoaco: rename Interp_instruction to VINTRP_instruction
Rhys Perry [Wed, 14 Sep 2022 10:19:30 +0000 (11:19 +0100)]
aco: rename Interp_instruction to VINTRP_instruction

These is clearer since GFX11 adds another interpolation format.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17333>

2 years agoradeonsi/vcn: support async
Ruijing Dong [Fri, 23 Sep 2022 13:52:15 +0000 (09:52 -0400)]
radeonsi/vcn: support async

enable async for vcn

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18781>

2 years agoaco: Fixes compiling error about char8_t with c++20
Yonggang Luo [Sat, 24 Sep 2022 18:47:00 +0000 (02:47 +0800)]
aco: Fixes compiling error about char8_t with c++20

The error is:
../mesa/src/amd/compiler/aco_register_allocation.cpp:382:7: error: no matching function for call to 'printf'
      printf(u8"☐");

Fixes: 209a89e51d1 ("aco: Convert to use u8 literal for Unicode character to fixes msvc warning")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7318

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18796>

2 years agoradv/rt: inline radv_rt_pipeline_create_() helper into radv_rt_pipeline_create()
Daniel Schürmann [Thu, 22 Sep 2022 14:46:47 +0000 (16:46 +0200)]
radv/rt: inline radv_rt_pipeline_create_() helper into radv_rt_pipeline_create()

This saves some re-allocation and will help in future with RT shader functions.

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

2 years agoradv/rt: create separate radv_rt_pipeline struct
Daniel Schürmann [Thu, 22 Sep 2022 13:26:01 +0000 (15:26 +0200)]
radv/rt: create separate radv_rt_pipeline struct

inherited from radv_compute_pipeline to contain all RT-related information.
This will make it easier to transition to RT shader functions.

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

2 years agopvr: Fix assignment to ISP back_a.sref
Matt Coster [Mon, 5 Sep 2022 14:56:12 +0000 (15:56 +0100)]
pvr: Fix assignment to ISP back_a.sref

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

2 years agoradv: use direct access to last_vgt_api_stage_locs for sgpr emission
Mike Blumenkrantz [Wed, 7 Sep 2022 20:14:45 +0000 (16:14 -0400)]
radv: use direct access to last_vgt_api_stage_locs for sgpr emission

radv_lookup_user_sgpr is heavy, stop using it

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18808>

2 years agoradv: store pointer to sgprs for last vertex stage
Mike Blumenkrantz [Wed, 7 Sep 2022 20:06:15 +0000 (16:06 -0400)]
radv: store pointer to sgprs for last vertex stage

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18808>