platform/upstream/mesa.git
2 years agolavapipe: EXT_4444_formats support
Mike Blumenkrantz [Wed, 21 Jul 2021 15:02:17 +0000 (11:02 -0400)]
lavapipe: EXT_4444_formats support

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

2 years agollvmpipe: fix 4-bit output scaling.
Dave Airlie [Mon, 20 Jul 2020 05:41:27 +0000 (15:41 +1000)]
llvmpipe: fix 4-bit output scaling.

This is overkill, but hey 4-bits per channel is hardly something to
care about.

(Suggestions welcome for a better version).

Fixes:
dEQP-GLES2.functional.fbo.render.*rgba4*

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12001>

2 years agovirgl: Add support for NIR shaders when VIRGL_DEBUG=nir.
Emma Anholt [Thu, 9 Sep 2021 20:13:41 +0000 (13:13 -0700)]
virgl: Add support for NIR shaders when VIRGL_DEBUG=nir.

This will let me incrementally fix nir-to-tgsi against virgl without
having to carry around the whole "remove TGSI from mesa/st" MR.

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

2 years agonir_to_tgsi: Force the TXQ LOD argument to be scalar.
Emma Anholt [Mon, 2 Aug 2021 23:17:08 +0000 (16:17 -0700)]
nir_to_tgsi: Force the TXQ LOD argument to be scalar.

Otherwise, older virglrenderer fails all the texturesize tests.

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

2 years agonir_to_tgsi: Add a workaround for virgl UBO array dynamic indexing.
Emma Anholt [Wed, 15 Sep 2021 21:49:46 +0000 (14:49 -0700)]
nir_to_tgsi: Add a workaround for virgl UBO array dynamic indexing.

virgl makes one array of UBOs starting from the first non-CB0 UBO used,
and does dynamic indexing off of that.  It requires that the dynamic
indexing be CONST[ADDR[0]+base], rather than having the base be loaded in
addr0.

If we had a nir_intrinsic_base() on load_ubo, this would be easy.  As we
don't, emit a subtract at address deref time.

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

2 years agonir_to_tgsi: Sort FS output declarations to avoid virglrenderer bugs.
Emma Anholt [Wed, 4 Aug 2021 23:58:52 +0000 (16:58 -0700)]
nir_to_tgsi: Sort FS output declarations to avoid virglrenderer bugs.

The TGSI debug output is a lot more readable if it's in location order,
anyway.

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

2 years agonir-to-tgsi: Avoid emitting TXL just for lod 0 on non-vertex shaders.
Emma Anholt [Thu, 29 Jul 2021 21:59:11 +0000 (14:59 -0700)]
nir-to-tgsi: Avoid emitting TXL just for lod 0 on non-vertex shaders.

Prompted by comparing virgl fails and finding that it has issues with
immediate args to TXL/TXB, at least.

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

2 years agonir_to_tgsi: Turn GS PRIMID into an input instead of a sysval.
Emma Anholt [Fri, 10 Sep 2021 18:38:35 +0000 (11:38 -0700)]
nir_to_tgsi: Turn GS PRIMID into an input instead of a sysval.

While TGSI can represent it either way, virgl and r600 at least demand an
input.

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

2 years agonir_to_tgsi: Add support for nir_intrinsic_load_barycentric_at_sample.
Emma Anholt [Fri, 10 Sep 2021 23:38:43 +0000 (16:38 -0700)]
nir_to_tgsi: Add support for nir_intrinsic_load_barycentric_at_sample.

It doesn't have to be a constant sample, so we need to store it at load
time and use the load's dest at interpolate_at time.

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

2 years agonir_to_tgsi: Add support for load_barycentric_sample.
Emma Anholt [Thu, 29 Jul 2021 19:48:26 +0000 (12:48 -0700)]
nir_to_tgsi: Add support for load_barycentric_sample.

This is used for var->data.sample inputs, which are already declared to be
TGSI_INTERPOLATE_LOC_SAMPLE, so we can just use the interpolated inputs.

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

2 years agonir_to_tgsi: Add support for declaring image arrays.
Emma Anholt [Thu, 9 Sep 2021 16:18:03 +0000 (09:18 -0700)]
nir_to_tgsi: Add support for declaring image arrays.

Required for virgl.

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

2 years agogallium/ureg: Sort the input decls, too.
Emma Anholt [Thu, 9 Sep 2021 19:52:00 +0000 (12:52 -0700)]
gallium/ureg: Sort the input decls, too.

Just like outputs, virglrenderer needs its inputs sorted.  Should be
harmless for other TGSI producers, and makes the declarations more
readable.

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

2 years agonir_to_tgsi: Add support for load_output/load_per_vertex_output.
Emma Anholt [Wed, 4 Aug 2021 23:03:25 +0000 (16:03 -0700)]
nir_to_tgsi: Add support for load_output/load_per_vertex_output.

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

2 years agonir_to_tgsi: Include txf_ms's sample index.
Emma Anholt [Wed, 8 Sep 2021 22:42:04 +0000 (15:42 -0700)]
nir_to_tgsi: Include txf_ms's sample index.

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

2 years agomesa/st: Don't bump locations of patch vars for !PIPE_CAP_TEXCOORD.
Emma Anholt [Wed, 8 Sep 2021 23:24:02 +0000 (16:24 -0700)]
mesa/st: Don't bump locations of patch vars for !PIPE_CAP_TEXCOORD.

There's no need to reserve the bottom 9 VARYING_SLOT_PATCH*, since
VARYING_SLOT_TEXCOORD won't be mapped there.  This helps us match up with
nir_to_tgsi, which wasn't shifting down by 9 for patch.

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

2 years agolavapipe: inherit from vk_image
Mike Blumenkrantz [Fri, 1 Oct 2021 14:41:57 +0000 (10:41 -0400)]
lavapipe: inherit from vk_image

simple and easy since we don't use much of this anyway

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

2 years agollvmpipe/cs: change submission pattern for threadpool
Dave Airlie [Wed, 6 Oct 2021 00:31:26 +0000 (10:31 +1000)]
llvmpipe/cs: change submission pattern for threadpool

Recent ncnn benchmarks showed a slowdown, and this change seemed
more likely.

The batching into threads for the main workloads is fine, however
the remainder stuff doesn't get spread out and can bottleneck in
one thread.

Switch to a model where the initial work is batched, but the
remainder is iterated over one by one.

Brings ncnn benchmarks back in line with previously.

Fixes: 69109e0b1935 ("llvmpipe/cs: rework thread pool for avoid mtx locking")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13210>

2 years agoanv: enable VK_KHR_maintenance4
Lionel Landwerlin [Wed, 28 Jul 2021 11:57:51 +0000 (14:57 +0300)]
anv: enable VK_KHR_maintenance4

v2 (Jason Ekstrand):
 - Get maxBufferSize from ISL.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agointel/isl: Add a max_buffer_size limit to isl_device
Jason Ekstrand [Tue, 7 Sep 2021 15:28:41 +0000 (10:28 -0500)]
intel/isl: Add a max_buffer_size limit to isl_device

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

2 years agoanv: implement vkGetDeviceImageSparseMemoryRequirementsKHR
Lionel Landwerlin [Wed, 28 Jul 2021 11:38:18 +0000 (14:38 +0300)]
anv: implement vkGetDeviceImageSparseMemoryRequirementsKHR

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agoanv: implement vkGetDeviceImageMemoryRequirementsKHR
Lionel Landwerlin [Wed, 28 Jul 2021 11:36:45 +0000 (14:36 +0300)]
anv: implement vkGetDeviceImageMemoryRequirementsKHR

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agoanv: move VkImage object allocation to anv_CreateImage
Lionel Landwerlin [Wed, 28 Jul 2021 10:36:51 +0000 (13:36 +0300)]
anv: move VkImage object allocation to anv_CreateImage

v2 (Jason Ekstrand):
 - Switch the order of arguments to be device, image, other stuff

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agoanv: Add an anv_image_get_memory_requirements helper
Jason Ekstrand [Tue, 5 Oct 2021 15:44:42 +0000 (10:44 -0500)]
anv: Add an anv_image_get_memory_requirements helper

This is similar to a patch from Lionel except works in terms of aspects
rather than bindings.  This makes it easy to use from the Android code.

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

2 years agoanv: remove unused function
Lionel Landwerlin [Wed, 28 Jul 2021 10:18:23 +0000 (13:18 +0300)]
anv: remove unused function

Fixes: 49908c602ffd ("anv/android: Rework our handling of AHardwareBuffer imports")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agoanv: implement vkGetDeviceBufferMemoryRequirementsKHR
Lionel Landwerlin [Wed, 28 Jul 2021 09:29:35 +0000 (12:29 +0300)]
anv: implement vkGetDeviceBufferMemoryRequirementsKHR

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agoanv: move GetBufferMemoryRequirement with other buffer functions
Lionel Landwerlin [Wed, 28 Jul 2021 09:20:02 +0000 (12:20 +0300)]
anv: move GetBufferMemoryRequirement with other buffer functions

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13199>

2 years agovulkan: Update the XML and headers to 1.2.195
Jason Ekstrand [Tue, 5 Oct 2021 14:15:27 +0000 (09:15 -0500)]
vulkan: Update the XML and headers to 1.2.195

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

2 years agonir/algebraic: Small optimizations for SpvOpFOrdNotEqual and SpvOpFUnordEqual
Ian Romanick [Fri, 12 Mar 2021 00:20:06 +0000 (16:20 -0800)]
nir/algebraic: Small optimizations for SpvOpFOrdNotEqual and SpvOpFUnordEqual

No shader-db changes on any Intel platform.

Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 144380118 -> 143692823 (-0.5%)
SENDs in all programs: 6920822 -> 6920822 (+0.0%)
Loops in all programs: 38299 -> 38299 (+0.0%)
Cycles in all programs: 8434782176 -> 8423078994 (-0.1%)
Spills in all programs: 206830 -> 204469 (-1.1%)
Fills in all programs: 318737 -> 313660 (-1.6%)

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>

2 years agospirv: Generate shorter code for SpvOpFUnord comparisons
Ian Romanick [Thu, 11 Mar 2021 17:46:07 +0000 (09:46 -0800)]
spirv: Generate shorter code for SpvOpFUnord comparisons

No shader-db or fossil-db changes on any Intel platform.

v2: Keep the flt <-> fge switcharoo local to the SpvOpFUnordLessThan,
etc. handling.  Add a comment explaining why the suboptimal
SpvOpFUnordEqual implementation is used here.  Suggested by Caio.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>

2 years agospirv: SpvOpFUnordNotEqual doesn't need special treatment
Ian Romanick [Fri, 12 Mar 2021 00:31:39 +0000 (16:31 -0800)]
spirv: SpvOpFUnordNotEqual doesn't need special treatment

The NIR fneu opcode already matches the "unordered not equal" semantics
of the SPIR-V opcode.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>

2 years agospirv: Minor cleanup in SpvOpFOrdNotEqual
Ian Romanick [Fri, 12 Mar 2021 00:20:47 +0000 (16:20 -0800)]
spirv: Minor cleanup in SpvOpFOrdNotEqual

v2: Add a comment explaining why the suboptimal SpvOpFOrdNotEqual
implementation is still used here.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>

2 years agospirv: Silence unused parameter warnings in vtn_alu.c
Ian Romanick [Fri, 12 Mar 2021 00:40:52 +0000 (16:40 -0800)]
spirv: Silence unused parameter warnings in vtn_alu.c

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12320>

2 years agoci: updates
Mike Blumenkrantz [Tue, 14 Sep 2021 02:53:30 +0000 (22:53 -0400)]
ci: updates

fails are from #4571

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

2 years agozink: support 16bit rgbx formats
Mike Blumenkrantz [Fri, 2 Apr 2021 15:59:52 +0000 (11:59 -0400)]
zink: support 16bit rgbx formats

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

2 years agopan/bi: Optimize abs(derivative)
Alyssa Rosenzweig [Sat, 2 Oct 2021 13:02:36 +0000 (09:02 -0400)]
pan/bi: Optimize abs(derivative)

We implement fine derivatives as:

broadcast(x, (lane & ~1) + 1) - broadcast(x, lane & ~1)

Most of the complexity is to get the right sign. If we can ignore the
sign, we can generate the simpler code:

broadcast(x, lane ^ 1) - lane

This is a particular win on v7+ where the broadcast instruction (CLPER)
can do `lane ^ value` for free. However, even on v6 where we lower to an
explicit XOR instruction, it's still a win.

The limiting case is fwidth. The fragment shader

   gl_FragColor = fwidth(vec4_varying);

has the following results on v6, v7, and v9:

G72 (-26% instructions, -43% cycles):
38 inst, 30 tuples, 5 clauses, 1.166667 cycles, 1.166667 arith, 28 quadwords
28 inst, 19 tuples, 4 clauses, 0.666667 cycles, 0.666667 arith, 19 quadwords

G76 (-37% instructions, -54% cycles):
38 inst, 30 tuples, 5 clauses, 1.166667 cycles, 1.166667 arith, 28 quadwords
24 inst, 16 tuples, 4 clauses, 0.541667 cycles, 0.541667 arith, 18 quadwords

G78 (-40% instructions, -56% cycles):
40 inst, 1.125000 cycles, 0.250000 fma, 0.109375 cvt, 1.125000 sfu, 20 quadwords
24 inst, 0.500000 cycles, 0.250000 fma, 0.015625 cvt, 0.500000 sfu, 12 quadwords

shader-db tells a similar story -- most shaders are unaffected, but a
shader that uses fwidth has a 20% reduction in cycle count:

instructions helped:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 264 -> 262 (-0.76%)
instructions helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 36 -> 28 (-22.22%)
tuples helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 27 -> 22 (-18.52%)
tuples HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 211 -> 212 (0.47%)
clauses HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 32 -> 33 (3.12%)
cycles helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 1 -> 0.79 (-20.83%)
arith helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 1 -> 0.79 (-20.83%)
quadwords helped:   shaders/chromeos/109-1.shader_test MESA_SHADER_FRAGMENT: 31 -> 28 (-9.68%)
quadwords HURT:   shaders/tesseract/488.shader_test MESA_SHADER_FRAGMENT: 176 -> 178 (1.14%)

total instructions in shared programs: 148370 -> 148360 (<.01%)
instructions in affected programs: 300 -> 290 (-3.33%)
helped: 2
HURT: 0

total tuples in shared programs: 124188 -> 124184 (<.01%)
tuples in affected programs: 238 -> 234 (-1.68%)
helped: 1
HURT: 1
helped stats (abs) min: 5.0 max: 5.0 x̄: 5.00 x̃: 5
helped stats (rel) min: 18.52% max: 18.52% x̄: 18.52% x̃: 18.52%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.47% max: 0.47% x̄: 0.47% x̃: 0.47%

total clauses in shared programs: 25692 -> 25693 (<.01%)
clauses in affected programs: 32 -> 33 (3.12%)
helped: 0
HURT: 1

total cycles in shared programs: 12132.04 -> 12131.83 (<.01%)
cycles in affected programs: 1 -> 0.79 (-20.83%)
helped: 1
HURT: 0

total arith in shared programs: 4623.75 -> 4623.54 (<.01%)
arith in affected programs: 1 -> 0.79 (-20.83%)
helped: 1
HURT: 0

total quadwords in shared programs: 110386 -> 110385 (<.01%)
quadwords in affected programs: 207 -> 206 (-0.48%)
helped: 1
HURT: 1
helped stats (abs) min: 3.0 max: 3.0 x̄: 3.00 x̃: 3
helped stats (rel) min: 9.68% max: 9.68% x̄: 9.68% x̃: 9.68%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 1.14% max: 1.14% x̄: 1.14% x̃: 1.14%

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

2 years agonir: Add Mali-specific derivative opcodes
Alyssa Rosenzweig [Sat, 2 Oct 2021 13:02:19 +0000 (09:02 -0400)]
nir: Add Mali-specific derivative opcodes

Add derivative opcodes fddx_must_abs_mali/fddy_must_abs_mali satisfying:

   fabs(fdd*_must_abs_mali(v)) = fabs(fdd*(v))

The sign of their result is undefined.

On Bifrost and Valhall, these unsigned derivatives can be implemented
more efficiently than the correctly-signed counterparts, since the sign
fixup requires extra ALU instructions. On backends where this is the
case, it is useful to optimize fabs(fdd*(v)) to
fabs(fdd*_must_abs_mali(v)). This pattern comes up with the GLSL builtin
`fwidth`.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12332>

2 years agoac/surface: Use 64 && 128 for GFX10_3 on non-modifier path
Joshua Ashton [Thu, 30 Sep 2021 15:03:51 +0000 (16:03 +0100)]
ac/surface: Use 64 && 128 for GFX10_3 on non-modifier path

DCC_IND_BLK is not hooked up for this to work in the kernel in any released version, and it's unsafe to do so even if it was because it doesn't check the modifiers.

There's no reason to change the legacy non-modifier path to be more performant at the expense of breaking backwards compatibility with older versions of Mesa.

Fixes: 0f6251b3 ("ac/surface: use DCC compatible with image stores for < 4K resolutions")
Closes: #5422

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13122>

2 years agomesa: use simple_mtx_t for ShaderIncludeMutex
Marek Olšák [Fri, 1 Oct 2021 19:59:00 +0000 (15:59 -0400)]
mesa: use simple_mtx_t for ShaderIncludeMutex

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agomesa: use simple_mtx_t for TexMutex
Marek Olšák [Fri, 1 Oct 2021 19:46:48 +0000 (15:46 -0400)]
mesa: use simple_mtx_t for TexMutex

change mtx_recursive -> mtx_plain, there's no recursive locking

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agogallium/pb_slab: use simple_mtx_t
Marek Olšák [Fri, 1 Oct 2021 19:44:43 +0000 (15:44 -0400)]
gallium/pb_slab: use simple_mtx_t

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agogallium/pb_cache: use simple_mtx_t
Marek Olšák [Fri, 1 Oct 2021 19:44:30 +0000 (15:44 -0400)]
gallium/pb_cache: use simple_mtx_t

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agoutil/queue: use simple_mtx_t for finish_lock
Marek Olšák [Fri, 1 Oct 2021 19:40:48 +0000 (15:40 -0400)]
util/queue: use simple_mtx_t for finish_lock

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agoutil/slab: use simple_mtx_t
Marek Olšák [Fri, 1 Oct 2021 19:40:40 +0000 (15:40 -0400)]
util/slab: use simple_mtx_t

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agomesa: add missing unlock_texture into generate_texture_mipmap
Marek Olšák [Tue, 5 Oct 2021 22:06:08 +0000 (18:06 -0400)]
mesa: add missing unlock_texture into generate_texture_mipmap

Fixes: 5a39938b0004de36ac55 "mesa: Throw an error for compressed glGenerateMipmap on GLES2 contexts."

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13152>

2 years agonir_to_dxil: Add tagging raw SRVs in shader flags
Enrico Galli [Fri, 1 Oct 2021 22:16:22 +0000 (15:16 -0700)]
nir_to_dxil: Add tagging raw SRVs in shader flags

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13157>

2 years agogallivm/format: clamp SINT conversion rather than truncate.
Dave Airlie [Tue, 5 Oct 2021 01:33:49 +0000 (11:33 +1000)]
gallivm/format: clamp SINT conversion rather than truncate.

KHR-GL32.packed_pixels.pbo_rectangle.r16i on zink on lavapipe
ends up using a pbo that does an SINT image write. This was producing
truncated rather than clamped values.

Fix the calculations for 8/16-bit signed ints to clamp not truncate.

Fixes: 13e5f331db77 ("gallivm/nir: fix image store conversions")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13187>

2 years agoi915g: Check for the scanout-layout conditions before setting level info.
Emma Anholt [Tue, 5 Oct 2021 19:33:15 +0000 (12:33 -0700)]
i915g: Check for the scanout-layout conditions before setting level info.

Fixes leaks (release) or assertion failures (debug) on allocating small
scanout resources, when falling through to the non-scanout-specific layout
code, which became more common as of ad50b47a14e9 ("gbm: assume
USE_SCANOUT in create_with_modifiers").

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13202>

2 years agopanfrost: Fix PAN_MESA_DEBUG=sync with INTEL_blackhole_render
Alyssa Rosenzweig [Mon, 27 Sep 2021 23:47:22 +0000 (19:47 -0400)]
panfrost: Fix PAN_MESA_DEBUG=sync with INTEL_blackhole_render

We need to ignore the "sync" in this case, or we'll crash with
"incomplete job" since we never submitted the work. Fixes the Piglit
intel_blackhole-draw_gles2 when run in CI.

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

2 years agopanfrost: Don't set CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER
Alyssa Rosenzweig [Mon, 27 Sep 2021 21:32:57 +0000 (17:32 -0400)]
panfrost: Don't set CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER

We already set HALF_INTEGER, which is what the compiler actually does.
If we also set PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER, we get
incorrect lowering. Only set the CAP we respect.

On Bifrost, this convention is arbitrary. We should consider moving the
Bifrost lowering into NIR to optimize this better...

Fixes Piglit glsl-arb-fragment-coord-conventions.

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

2 years agopanfrost: Introduce PAN_MAX_VARYINGS define
Alyssa Rosenzweig [Mon, 27 Sep 2021 20:53:30 +0000 (16:53 -0400)]
panfrost: Introduce PAN_MAX_VARYINGS define

The number of varying records we need to reserve in the worst case is
greater than the number of source-level varyings we advertise
(gl_Position, gl_PointSize...)

We advertise MAX_VARYINGS source level varyings, which means anywhere we
manipulate varyings we need up to (MAX_VARYINGS + max non-source level
varyings) records. Add a PAN_MAX_VARYINGS define for this and use it
throughout.

Fixes a buffer overflow in Piglit glsl-max-varyings, which now passes
instead of crashes.

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

2 years agopanfrost: Fix off-by-one in varying count assert
Alyssa Rosenzweig [Mon, 27 Sep 2021 20:51:32 +0000 (16:51 -0400)]
panfrost: Fix off-by-one in varying count assert

We want to assert that the number of varyings (the count) is at most the
the maximum count. This is <=, not <, with the assertion previously
failing for exactly the maximum.

Fixes: 2c2cf0ecfe6 ("panfrost: Streamline varying linking code")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13070>

2 years agopanfrost: Move special_varying to compiler definitions
Alyssa Rosenzweig [Mon, 27 Sep 2021 20:48:33 +0000 (16:48 -0400)]
panfrost: Move special_varying to compiler definitions

The number of special varyings on midgard can influence how much space
we need to allocate for varyings in the compiler ABI. Move the enum so
we can get access it.

No functional change. This is cc stable purely so the following patches
can be backported.

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

2 years agollvmpipe: fix crash when doing FB fetch + gl_FragDepth write in one shader
Pavel Asyutchenko [Thu, 2 Sep 2021 18:11:04 +0000 (21:11 +0300)]
llvmpipe: fix crash when doing FB fetch + gl_FragDepth write in one shader

Reproducible by piglit test from this MR:
https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/576

Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12705>

2 years agoturnip: Replace our format table with fd6_format_table.
Emma Anholt [Mon, 27 Sep 2021 20:05:13 +0000 (13:05 -0700)]
turnip: Replace our format table with fd6_format_table.

Now we have a common format table with just a little bit of overriding in
turnip, which I hope we can decrease over time.

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

2 years agoturnip: Do format lookups from the fd6 format table and cross-check.
Emma Anholt [Mon, 27 Sep 2021 18:33:07 +0000 (11:33 -0700)]
turnip: Do format lookups from the fd6 format table and cross-check.

Intermediate step to make sure things stay the same as I transition us to
sharing the format table.

The YUV special casing is pretty not the prettiest, but I'm hoping to
continue working on planar RGB formats as pipe formats separately.

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

2 years agoturnip: Switch tu_format internals to using pipe_format more.
Emma Anholt [Mon, 27 Sep 2021 18:56:32 +0000 (11:56 -0700)]
turnip: Switch tu_format internals to using pipe_format more.

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

2 years agoturnip: Give D32_SFLOAT_S8_UINT a native format.
Emma Anholt [Mon, 27 Sep 2021 18:04:22 +0000 (11:04 -0700)]
turnip: Give D32_SFLOAT_S8_UINT a native format.

We won't actually use the native format here, as when sampling our image
we we just see the format for either the D or S aspect.  This syncs us up
with freedreno's table, though.

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

2 years agofreedreno/a6xx: Enable UBWC for RGBA5551 (and 1555) textures.
Emma Anholt [Fri, 1 Oct 2021 23:31:50 +0000 (16:31 -0700)]
freedreno/a6xx: Enable UBWC for RGBA5551 (and 1555) textures.

Turnip has it enabled, and it seems to be happy in the CTS.

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

2 years agofreedreno/a6xx: Add support for A/XRGB1555 formats.
Emma Anholt [Fri, 1 Oct 2021 22:43:49 +0000 (15:43 -0700)]
freedreno/a6xx: Add support for A/XRGB1555 formats.

This switches the format we use by default for GLES's rgb5_a1, and means
that our formats supported more closely matches turnip.

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

2 years agofreedreno/a6xx: Rewrite the format table format/swap helpers.
Emma Anholt [Fri, 1 Oct 2021 23:46:54 +0000 (16:46 -0700)]
freedreno/a6xx: Rewrite the format table format/swap helpers.

We need to take a tiling mode to in order to support 1555 like turnip
does, and I like this naming better.

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

2 years agofreedreno/a6xx: Make the format table const.
Emma Anholt [Fri, 1 Oct 2021 23:45:10 +0000 (16:45 -0700)]
freedreno/a6xx: Make the format table const.

This data never changes.

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

2 years agofreedreno/a6xx: Use fd6_pipe2tex() for the 2D src format.
Emma Anholt [Fri, 1 Oct 2021 23:41:39 +0000 (16:41 -0700)]
freedreno/a6xx: Use fd6_pipe2tex() for the 2D src format.

The differences between the two are:

- tex supports more formats (fine, we've already decided on which formats
  we can blit)
- FMT6_10_10_10_2_UNORM instead of FMT6_10_10_10_2_UNORM_DEST.
- FMT6_A8_UNORM for PIPE_FORMAT_A8_UNORM.

For 1555 support we get another difference between tex and color, and we
need 2/3 of the tex differences for blit srcs, so switch it over.  This
also matches what turnip does (except it doesn't have A8 as a format).

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

2 years agofreedreno/a6xx: Put R8_G8_B8_420_UNORM in the format table.
Emma Anholt [Fri, 1 Oct 2021 21:19:28 +0000 (14:19 -0700)]
freedreno/a6xx: Put R8_G8_B8_420_UNORM in the format table.

turnip will use this format, even if we don't have the freedreno side
rigged up yet.

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

2 years agoutil/format: Add an RGB planar format for YV12, like we have for NV12.
Emma Anholt [Fri, 1 Oct 2021 21:14:00 +0000 (14:14 -0700)]
util/format: Add an RGB planar format for YV12, like we have for NV12.

Turnip will use this for mapping the to the corresponding hardware format,
and we could also extend mesa/st to avoid adding extra samplers for
external image sampling of YV12 on freedreno.

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

2 years agofreedreno/a6xx+: Add support for the R8G8_R8B8 and G8R8_B8R8 formats.
Emma Anholt [Thu, 30 Sep 2021 18:03:49 +0000 (11:03 -0700)]
freedreno/a6xx+: Add support for the R8G8_R8B8 and G8R8_B8R8 formats.

This means that EGLimage imports of YUYV and UYVY can use a single sampler
instead of having to create RGBA8 and RG8 samplers mapping the same
texture.  The swizzles are the same as turnip uses, and it makes the
piglit tests for these formats happy.

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

2 years agofreedreno/a6xx: Add some more 16-bit rgb/rgba swaps to our format tables.
Emma Anholt [Fri, 24 Sep 2021 22:20:58 +0000 (15:20 -0700)]
freedreno/a6xx: Add some more 16-bit rgb/rgba swaps to our format tables.

BGR565 is chosen for GL_RGB565 and BGRA4 for GL_RGBA4, so it doesn't
change GLES's behavior.

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

2 years agofreedreno/a6xx: Drop texturing support from other scaled formats.
Emma Anholt [Fri, 24 Sep 2021 22:32:23 +0000 (15:32 -0700)]
freedreno/a6xx: Drop texturing support from other scaled formats.

GLES doesn't expose these texture formats, and we don't want to start
exposing them when turnip starts using our tables.

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

2 years agofreedreno/a6xx: Add support for EXT_texture_sRGB_R8/RG8.
Emma Anholt [Fri, 24 Sep 2021 22:05:57 +0000 (15:05 -0700)]
freedreno/a6xx: Add support for EXT_texture_sRGB_R8/RG8.

Noticed to be missing when comparing format tables between turnip and
freedreno.  Passes dEQP-GLES31 fine.

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

2 years agofreedreno/a6xx: disable vertex fetch support flag for b8g8r8a8_srgb.
Emma Anholt [Fri, 24 Sep 2021 21:21:07 +0000 (14:21 -0700)]
freedreno/a6xx: disable vertex fetch support flag for b8g8r8a8_srgb.

We don't have an srgb decode flag on vertex fetch, r8g8b8a8_srgb isn't
supported either, and GL doesn't ask for vertex fetch for this anyway.

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

2 years agofreedreno/a6xx: Add int/scaled/snorm vertex formats to match turnip.
Emma Anholt [Fri, 24 Sep 2021 21:18:18 +0000 (14:18 -0700)]
freedreno/a6xx: Add int/scaled/snorm vertex formats to match turnip.

Noticed because the vertex formats didn't match up between the two.  GL
doesn't actually look for these vertex formats, though.

Having these marked as supporting texture or color could theoretically
change things I think.

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

2 years agofreedreno/a6xx: Move the format table to common code.
Emma Anholt [Fri, 24 Sep 2021 20:57:34 +0000 (13:57 -0700)]
freedreno/a6xx: Move the format table to common code.

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

2 years agor300: fix UB caused by 1 << 31 and 2 << 30
Filip Gawin [Sat, 2 Oct 2021 16:28:17 +0000 (18:28 +0200)]
r300: fix UB caused by 1 << 31 and 2 << 30

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13158>

2 years agovulkan/wsi/wayland: fix an invalid u_vector_init call
Chia-I Wu [Tue, 5 Oct 2021 01:01:06 +0000 (18:01 -0700)]
vulkan/wsi/wayland: fix an invalid u_vector_init call

u_vector_init requires size to be power-of-two.

Fixes: 151b65b2119 ("vulkan/wsi/wayland: generalize modifier handling")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13186>

2 years agoturnip: clamp per-tile scissors to max viewport size in binning pass
Danylo Piliaiev [Tue, 5 Oct 2021 11:49:40 +0000 (14:49 +0300)]
turnip: clamp per-tile scissors to max viewport size in binning pass

Tiles on the edge may cross maximum viewport size, we have to clamp
per-tile scissor to maximum allowed viewport dimensions.

Add MAX_VIEWPORT_SIZE constant along the way.

Fixes vkd3d test "test_draw_uav_only"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13197>

2 years agoradv: Use VK_DEFINE_*HANDLE_CASTS instead of rolling our own
Jason Ekstrand [Mon, 27 Sep 2021 22:40:22 +0000 (17:40 -0500)]
radv: Use VK_DEFINE_*HANDLE_CASTS instead of rolling our own

The core ones have some nifty stuff like asserts that it's a valid
vk_object_base and has the right type.  We don't have real type safety
with Vulkan handles but this is as close as we can get.  The core ones
also track when we've started handing out handles for logging purposes
which we want.

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

2 years agointel/blorp: fix a compile warning about uninitialized use
Tapani Pälli [Tue, 5 Oct 2021 10:16:51 +0000 (13:16 +0300)]
intel/blorp: fix a compile warning about uninitialized use

warning: ‘bind_offset’ may be used uninitialized in this function

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13190>

2 years agonir/lower_io: preserve all metadata when no progress
Lionel Landwerlin [Mon, 4 Oct 2021 18:24:00 +0000 (21:24 +0300)]
nir/lower_io: preserve all metadata when no progress

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13168>

2 years agoradv/llvm: fix exporting VS parameters
Samuel Pitoiset [Tue, 5 Oct 2021 10:20:29 +0000 (12:20 +0200)]
radv/llvm: fix exporting VS parameters

My mistake.

Fixes: 2aa705ec87c ("radv: determine the VS output parameters in the shader info pass")
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/13191>

2 years agoanv: remove redundant VertexURBEntryReadLength setting
Lionel Landwerlin [Mon, 4 Oct 2021 10:20:46 +0000 (13:20 +0300)]
anv: remove redundant VertexURBEntryReadLength setting

We're setting the same field a dozen lines below to the exact same
value.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13169>

2 years agonir: preserve all metadata when nir_opt_vectorize doesn't make progress
Marcin Ślusarz [Tue, 10 Aug 2021 10:46:55 +0000 (12:46 +0200)]
nir: preserve all metadata when nir_opt_vectorize doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agonir: preserve all metadata when nir_propagate_invariant doesn't make progress
Marcin Ślusarz [Tue, 10 Aug 2021 10:43:05 +0000 (12:43 +0200)]
nir: preserve all metadata when nir_propagate_invariant doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agonir: preserve all metadata when nir_lower_int_to_float doesn't make progress
Marcin Ślusarz [Mon, 9 Aug 2021 15:00:01 +0000 (17:00 +0200)]
nir: preserve all metadata when nir_lower_int_to_float doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agoglsl: preserve all metadata when lower_buffer_interface_derefs doesn't make progress
Marcin Ślusarz [Fri, 6 Aug 2021 13:27:52 +0000 (15:27 +0200)]
glsl: preserve all metadata when lower_buffer_interface_derefs doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agoanv: preserve all metadata when anv_nir_lower_multiview doesn't make progress
Marcin Ślusarz [Fri, 6 Aug 2021 12:50:00 +0000 (14:50 +0200)]
anv: preserve all metadata when anv_nir_lower_multiview doesn't make progress

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agoanv: use nir_shader_instructions_pass in anv_nir_lower_ycbcr_textures
Marcin Ślusarz [Fri, 6 Aug 2021 12:46:21 +0000 (14:46 +0200)]
anv: use nir_shader_instructions_pass in anv_nir_lower_ycbcr_textures

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agoanv: use nir_shader_instructions_pass in anv_nir_add_base_work_group_id
Marcin Ślusarz [Fri, 6 Aug 2021 12:42:35 +0000 (14:42 +0200)]
anv: use nir_shader_instructions_pass in anv_nir_add_base_work_group_id

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_metadata_none instead of its value
Marcin Ślusarz [Fri, 6 Aug 2021 12:38:31 +0000 (14:38 +0200)]
intel/compiler: use nir_metadata_none instead of its value

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_opt_peephole_ffma
Marcin Ślusarz [Fri, 6 Aug 2021 12:33:14 +0000 (14:33 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_opt_peephole_ffma

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_lower_storage_image
Marcin Ślusarz [Fri, 6 Aug 2021 12:27:58 +0000 (14:27 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_storage_image

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_lower_scoped_barriers
Marcin Ślusarz [Fri, 6 Aug 2021 12:16:24 +0000 (14:16 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_scoped_barriers

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_lower_mem_access_bit_sizes
Marcin Ślusarz [Fri, 6 Aug 2021 12:12:11 +0000 (14:12 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_mem_access_bit_sizes

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_lower_conversions
Marcin Ślusarz [Fri, 6 Aug 2021 11:58:06 +0000 (13:58 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_lower_conversions

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_clamp_image_1d_2d_array_sizes
Marcin Ślusarz [Fri, 6 Aug 2021 11:20:53 +0000 (13:20 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_clamp_image_1d_2d_array_sizes

No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agointel/compiler: use nir_shader_instructions_pass in brw_nir_demote_sample_qualifiers
Marcin Ślusarz [Fri, 6 Aug 2021 10:56:31 +0000 (12:56 +0200)]
intel/compiler: use nir_shader_instructions_pass in brw_nir_demote_sample_qualifiers

Changes:
- nir_metadata_preserve(..., nir_metadata_block_index | nir_metadata_dominance)
  is called only when pass makes progress
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress
- pass returns true ONLY when it makes progress ("progress" was initialized incorrectly)

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13189>

2 years agoradv: fix vk_object_base_init/finish for internal device memory objects
Samuel Pitoiset [Mon, 4 Oct 2021 11:40:44 +0000 (13:40 +0200)]
radv: fix vk_object_base_init/finish for internal device memory objects

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

2 years agoradv: fix writing combined image/sampler descriptor
Samuel Pitoiset [Mon, 4 Oct 2021 11:22:59 +0000 (13:22 +0200)]
radv: fix writing combined image/sampler descriptor

This will crash with the common Vulkan handles if sampler is NULL.

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

2 years agoradv: fix vk_object_base_init/finish for push descriptors
Samuel Pitoiset [Mon, 4 Oct 2021 11:10:07 +0000 (13:10 +0200)]
radv: fix vk_object_base_init/finish for push descriptors

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

2 years agointel/compiler: add missing line returns to logs
Lionel Landwerlin [Sun, 3 Oct 2021 12:58:36 +0000 (15:58 +0300)]
intel/compiler: add missing line returns to logs

In the upcoming intel_clc tool, we're allowing to print these messages
out and some of them just don't look right.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13165>

2 years agoanv: enable UBO indexing
Lionel Landwerlin [Wed, 29 Sep 2021 07:22:14 +0000 (10:22 +0300)]
anv: enable UBO indexing

We added support but didn't expose it through the API.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b704d03efd4767 ("anv: Do UBO loads with global addresses for bindless")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5426
Acked-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13097>

2 years agocrocus/query: don't loop on ready status after gpu hang.
Dave Airlie [Tue, 5 Oct 2021 02:11:26 +0000 (12:11 +1000)]
crocus/query: don't loop on ready status after gpu hang.

When a GPU hang occurs, the syncobj will eventually timeout,
if this is a wait, just set ready, so things will continue.

This matches 965 behaviour better.

Fixes: c282a082bef0 ("crocus/query: poll the syncobj in the no wait situation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13188>