platform/upstream/mesa.git
3 years agodarwin: Use the system libexpat
Jeremy Huddleston Sequoia [Thu, 14 Jan 2021 18:08:07 +0000 (10:08 -0800)]
darwin: Use the system libexpat

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

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8506>

3 years agoutil/format: Simplify the generated unpack code.
Eric Anholt [Mon, 11 Nov 2019 22:43:14 +0000 (14:43 -0800)]
util/format: Simplify the generated unpack code.

We were declaring the temps, then in the same order declaring
assignments to those temps.  The code is more legible (and shorter)
with the assignments moved in place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Move the rest of format_unpack.py out of code generation.
Eric Anholt [Thu, 7 Nov 2019 22:16:30 +0000 (14:16 -0800)]
mesa: Move the rest of format_unpack.py out of code generation.

There's nothing conditional any more in the template, so just move it
to plain .c code at last.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Use a bunch of util functions for Z/S unpacking.
Eric Anholt [Thu, 7 Nov 2019 21:22:21 +0000 (13:22 -0800)]
mesa: Use a bunch of util functions for Z/S unpacking.

Drops another 2k of text.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agoutil: Give a reasonable answer when unpacking z32unorm from floats.
Eric Anholt [Thu, 7 Nov 2019 21:51:15 +0000 (13:51 -0800)]
util: Give a reasonable answer when unpacking z32unorm from floats.

We weren't clamping the float Z value, just multiplying it by a big
float and casting that to int.  This makes util/format's z unpacking
match Mesa's.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Reuse util_format's unpack functions for pure integer formats.
Eric Anholt [Thu, 7 Nov 2019 19:55:11 +0000 (11:55 -0800)]
mesa: Reuse util_format's unpack functions for pure integer formats.

Drops 5k of compiled text from all GL drivers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Reuse util_format's unpack_8unorm.
Eric Anholt [Thu, 7 Nov 2019 19:35:10 +0000 (11:35 -0800)]
mesa: Reuse util_format's unpack_8unorm.

Drops ~8k of compiled text from all GL drivers.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agoutil: Fix rounding of unpack_unorm8 from small unorm formats.
Eric Anholt [Mon, 11 Nov 2019 23:29:37 +0000 (15:29 -0800)]
util: Fix rounding of unpack_unorm8 from small unorm formats.

The code was doing the bit-shift trick, but not accounting for the
rounding necessary which the Mesa unpack code was previously doing.
Using the helpers prevents a regression in
KHR-GL46.copy_image.smoke_test on iris as we consolidate the
pack/unpack code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agoutil: Fix UBSan failure on _mesa_unorm_to_unorm.
Eric Anholt [Wed, 12 Aug 2020 21:30:18 +0000 (14:30 -0700)]
util: Fix UBSan failure on _mesa_unorm_to_unorm.

It complains about shifting 1<<31 being undefined, so make it a 1u.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agoutil: Move most of src/mesa/main/format_utils.h to util/format/
Eric Anholt [Mon, 11 Nov 2019 23:02:25 +0000 (15:02 -0800)]
util: Move most of src/mesa/main/format_utils.h to util/format/

This is a set of very nice, complete helpers for moving around bits in
various formats, and we want to retain its behavior when deduplicating
Mesa's format pack/unpack and gallium's.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Make _mesa_unpack_rgba_block() use the u_format pack/unpack.
Eric Anholt [Thu, 7 Nov 2019 18:56:06 +0000 (10:56 -0800)]
mesa: Make _mesa_unpack_rgba_block() use the u_format pack/unpack.

This moves it to non-generated code, since there wasn't any codegen
anyway.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Replace the float[4] unpack code with util/format's.
Eric Anholt [Thu, 7 Nov 2019 18:37:54 +0000 (10:37 -0800)]
mesa: Replace the float[4] unpack code with util/format's.

The gallium drivers lose 10-15k of binary by not having this duplicated
unpack code, but classic i965 gains 215k of binary by pulling in
u_format's pack/unpack code.  The cost to classic will go down as we drop
more of the duplicated code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Drop incorrect statement about Z unpack behavior.
Eric Anholt [Thu, 7 Nov 2019 21:27:04 +0000 (13:27 -0800)]
mesa: Drop incorrect statement about Z unpack behavior.

We pass z32f pixels through without clamping, as one would expect.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agomesa: Add some little unit tests showing format unpack behavior.
Eric Anholt [Thu, 7 Nov 2019 20:10:51 +0000 (12:10 -0800)]
mesa: Add some little unit tests showing format unpack behavior.

I'm about to refactor pack/unpack code, and it would be nice to
document what it does as I change it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agoutil/format: Fix pack/unpack of A1R5G5B5_UINT.
Eric Anholt [Fri, 15 Jan 2021 00:17:21 +0000 (16:17 -0800)]
util/format: Fix pack/unpack of A1R5G5B5_UINT.

Avoids regressing KHR-GL33.packed_pixels.pbo_rectangle.* when
transitioning from mesa/main pack/unpack codegen to util/format's.

Fixes: b28eb044cdc1 ("gallium: Add equivalents of packed MESA_FORMAT_*UINT formats.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6297>

3 years agofreedreno/isa: Fix branch/jump offset encoding
Rob Clark [Fri, 15 Jan 2021 16:51:39 +0000 (08:51 -0800)]
freedreno/isa: Fix branch/jump offset encoding

When cross compiling with clang, `1ul` would end up 32b instead of 64b,
resulting in 32b fields (like branch/jump offsets) being encoded as
zero.  Which results in infinite loops.

Fixes: e7630ec278f ("freedreno/hw: Add isaspec mechanism for documenting/defining an ISA")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8528>

3 years agozink: enable PIPE_CAP_CLEAR_TEXTURE
Mike Blumenkrantz [Thu, 13 Aug 2020 17:50:21 +0000 (13:50 -0400)]
zink: enable PIPE_CAP_CLEAR_TEXTURE

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

3 years agozink: add a pipe_context::clear_texture hook
Mike Blumenkrantz [Thu, 13 Aug 2020 21:23:51 +0000 (17:23 -0400)]
zink: add a pipe_context::clear_texture hook

there's a lot going on here, but the gist of it is:
* if we're not in a renderpass, use the no_rp clear helpers
* if we're in a renderpass, use our lord and savior u_blitter with a temporary
  surface that we create just for the blit

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

3 years agozink: break out some of the u_blitter setup into util function
Mike Blumenkrantz [Thu, 13 Aug 2020 21:17:38 +0000 (17:17 -0400)]
zink: break out some of the u_blitter setup into util function

we'll be using this for more than just zink_blit, so we can reuse some code

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

3 years agozink: break out color/zs no_rp clear into separate functions
Mike Blumenkrantz [Thu, 13 Aug 2020 19:09:30 +0000 (15:09 -0400)]
zink: break out color/zs no_rp clear into separate functions

make more code more reusable

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

3 years agozink: break out scissor region testing for clear functions
Mike Blumenkrantz [Thu, 13 Aug 2020 18:22:14 +0000 (14:22 -0400)]
zink: break out scissor region testing for clear functions

it'll be handy to be able to reuse this

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

3 years agozink: handle clears with scissor regions
Mike Blumenkrantz [Thu, 13 Aug 2020 17:44:56 +0000 (13:44 -0400)]
zink: handle clears with scissor regions

this just sets the info struct members as needed

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

3 years agozink: start to refactor clearing
Mike Blumenkrantz [Thu, 13 Aug 2020 15:45:30 +0000 (11:45 -0400)]
zink: start to refactor clearing

we currently only handle clears inside renderpasses, but it's also possible
to perform clears outside of renderpasses, so we can break this logic up a bit
to open the door to handling the non-rp case

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

3 years agozink: move zink_clear to zink_clear.c
Mike Blumenkrantz [Thu, 13 Aug 2020 15:38:32 +0000 (11:38 -0400)]
zink: move zink_clear to zink_clear.c

we're going to have a bunch of clear code, so having it all in a concise
place that's consistent with other gallium drivers is helpful

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

3 years agointel/perf: move gt_frequency to results
Lionel Landwerlin [Tue, 8 Sep 2020 11:33:12 +0000 (14:33 +0300)]
intel/perf: move gt_frequency to results

We want to unify things a bit between GL & Vulkan. So store those
values in the results rather than just in the GL query code.

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

3 years agointel/perf: link queries back to the gen_perf_config object
Lionel Landwerlin [Thu, 3 Sep 2020 09:19:11 +0000 (12:19 +0300)]
intel/perf: link queries back to the gen_perf_config object

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

3 years agointel/perf: add definition for generic perf counters
Lionel Landwerlin [Mon, 7 Sep 2020 14:35:08 +0000 (17:35 +0300)]
intel/perf: add definition for generic perf counters

Those are not part of the OA report but will be used in upcoming
counters.

v2: Rename counter defines (Marcin)

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

3 years agointel/perf: restructure i915 perf version checks
Lionel Landwerlin [Tue, 1 Sep 2020 10:09:04 +0000 (13:09 +0300)]
intel/perf: restructure i915 perf version checks

Trying to make things more readable.

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

3 years agointel/mi_builder: fix self modifying batches
Lionel Landwerlin [Mon, 31 Aug 2020 13:42:32 +0000 (16:42 +0300)]
intel/mi_builder: fix self modifying batches

So far we only write a maximum of 4 dwords further into the batch and
it seems just going over the CS prefetch was enough.

Turns out writing more dwords can delay the writes and we start
prefetching stuff that hasn't landed in memory yet.

This fixes the issue by stalling the CS to ensure the writes have
landed before we go over the prefetch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 796fccce631bf8 ("intel/mi-builder: add framework for self modifying batches")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8525>

3 years agointel/mi_builder: optimize 64bit immediate register loads & memory stores
Lionel Landwerlin [Thu, 27 Aug 2020 10:16:46 +0000 (13:16 +0300)]
intel/mi_builder: optimize 64bit immediate register loads & memory stores

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

3 years agoanv: don't disable KHR_performance_query in debug mode
Lionel Landwerlin [Thu, 27 Aug 2020 12:29:07 +0000 (15:29 +0300)]
anv: don't disable KHR_performance_query in debug mode

This is useful to verify that queries are built properly and avoiding
to deal with i915-perf (typically under simulation).

v2: Remove likely() (Marcin)

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

3 years agov3d: fix dest offset in TFU setup
Juan A. Suarez Romero [Tue, 12 Jan 2021 17:45:49 +0000 (18:45 +0100)]
v3d: fix dest offset in TFU setup

It is using the source level instead of the destiny level (base_level)
to compute the dest offset.

This fixes `framebuffer-blit-levels draw rgba -auto -fbo` piglit test.

Fixes: 976ea90bdca ("v3d: Add support for using the TFU to do some blits.")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8491>

3 years agofreedreno/ir3/parser: add cat7 support
Danylo Piliaiev [Mon, 11 Jan 2021 16:27:12 +0000 (18:27 +0200)]
freedreno/ir3/parser: add cat7 support

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

3 years agost/mesa: optimize binding and unbinding shader images
Marek Olšák [Mon, 11 Jan 2021 15:37:57 +0000 (10:37 -0500)]
st/mesa: optimize binding and unbinding shader images

- use local variable num_images
- only unbind the number of shader images that we have bound

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

3 years agost/mesa: unbind sampler views, images, and vertex buffers after meta ops
Marek Olšák [Mon, 11 Jan 2021 15:33:54 +0000 (10:33 -0500)]
st/mesa: unbind sampler views, images, and vertex buffers after meta ops

v2: use a null array to unbind sampler views

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agocso_context: remove ability to restore VBs, const bufs, sampler views, images
Marek Olšák [Sun, 20 Dec 2020 08:13:20 +0000 (03:13 -0500)]
cso_context: remove ability to restore VBs, const bufs, sampler views, images

This is meant to decrease CPU overhead and reduce the use of cso_context when
better solutions are possible.

These functions are removed. Gallium frontends should just use pipe_context:
- cso_set_sampler_views
- cso_set_shader_images
- cso_set_constant_buffer*

Additionally, vertex buffers are passed through cso_context but they are not
saved there. The only remaining role of cso_context with regard to vertex
buffers is to decide whether to go through u_vbuf or skip it. u_vbuf also
can't save and restore vertex buffers anymore.

This is how the states are restored for meta ops:
- in st/mesa, set st->dirty |= flags to re-bind whatever state has been
  touched
- outside of st/mesa, there is new interface st_context_iface::invalidate_-
 _state that external modules can use to essentially set st->dirty through
  it (like HUD)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: replace st->pipe with pipe in a few places
Marek Olšák [Sun, 20 Dec 2020 08:12:47 +0000 (03:12 -0500)]
st/mesa: replace st->pipe with pipe in a few places

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to set const bufs, sampler views and images
Marek Olšák [Sun, 20 Dec 2020 08:01:37 +0000 (03:01 -0500)]
st/mesa: don't use cso_context to set const bufs, sampler views and images

These cso_context functions will be removed and they are no longer needed
by st/mesa. They also cause CPU overhead because they save states.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs, etc. for PBO glTexSubImage
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, etc. for PBO glTexSubImage

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs, etc. for PBO glReadPixels
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, etc. for PBO glReadPixels

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs, sampler views for glDrawTex*OES
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, sampler views for glDrawTex*OES

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs, sampler views for glDrawPixels
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, sampler views for glDrawPixels

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs for glClear
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs for glClear

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/mesa: don't use cso_context to restore VBs, sampler views for glBitmap
Marek Olšák [Sun, 20 Dec 2020 07:52:52 +0000 (02:52 -0500)]
st/mesa: don't use cso_context to restore VBs, sampler views for glBitmap

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/pp: don't use cso_context to restore VBs, constbuf 0 and sampler views
Marek Olšák [Sun, 20 Dec 2020 07:49:07 +0000 (02:49 -0500)]
gallium/pp: don't use cso_context to restore VBs, constbuf 0 and sampler views

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views
Marek Olšák [Sun, 20 Dec 2020 07:49:07 +0000 (02:49 -0500)]
gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views

These cso_context capabilities will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/api: add state invalidate interface as alternative to cso_save/restore
Marek Olšák [Sun, 20 Dec 2020 07:45:20 +0000 (02:45 -0500)]
gallium/api: add state invalidate interface as alternative to cso_save/restore

Some cso_context save/restore capabilities will be removed to decrease
CPU overhead. This is the alternative solution that e.g. the HUD will use.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agogallium/tests: stop using cso_set_sampler_views
Marek Olšák [Sun, 20 Dec 2020 05:44:03 +0000 (00:44 -0500)]
gallium/tests: stop using cso_set_sampler_views

It will be removed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>

3 years agost/xa: stop using cso_set_sampler_views
Marek Olšák [Sun, 20 Dec 2020 05:43:39 +0000 (00:43 -0500)]
st/xa: stop using cso_set_sampler_views

It will be removed.

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

3 years agost/nine: stop using cso_set_sampler_views
Marek Olšák [Sun, 20 Dec 2020 05:43:08 +0000 (00:43 -0500)]
st/nine: stop using cso_set_sampler_views

It will be removed.

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

3 years agoci: mark some sparse CTS as expected failures on RAVEN
Samuel Pitoiset [Fri, 15 Jan 2021 06:57:53 +0000 (07:57 +0100)]
ci: mark some sparse CTS as expected failures on RAVEN

Same as Vega10.

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

3 years agoandroid: r600/sfn: add sfn_nir_lower_64bit.cpp to Makefile.sources
Mauro Rossi [Thu, 14 Jan 2021 22:15:56 +0000 (23:15 +0100)]
android: r600/sfn: add sfn_nir_lower_64bit.cpp to Makefile.sources

Fixes the following building errors:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: r600::r600_nir_split_64bit_io(nir_shader*)
>>> referenced by sfn_nir.cpp:981 (external/mesa/src/gallium/drivers/r600/sfn/sfn_nir.cpp:981)
...
ld.lld: error: undefined symbol: r600::r600_nir_64_to_vec2(nir_shader*)
>>> referenced by sfn_nir.cpp:1010 (external/mesa/src/gallium/drivers/r600/sfn/sfn_nir.cpp:1010)
...
ld.lld: error: undefined symbol: r600::r600_merge_vec2_stores(nir_shader*)
>>> referenced by sfn_nir.cpp:1015 (external/mesa/src/gallium/drivers/r600/sfn/sfn_nir.cpp:1015)

Fixes: 165fb5117b ("r600/sfn: add lowering passes to get 64 bit ops lowered to 32 bit vec2")
Cc: 21.0 <mesa-stable>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8505>

3 years agoradv: do not invalidate the L2 metadata cache on compute queues
Samuel Pitoiset [Thu, 14 Jan 2021 17:32:16 +0000 (18:32 +0100)]
radv: do not invalidate the L2 metadata cache on compute queues

The flush VA space was only allocated for command buffers on the
graphics queue. Also, the ZPASS_DONE event should never be emitted
on compute queues because it hangs.

Invalidating the L2 metadata cache is only required for coherency
between the RBs and L2, so only on the graphics queue.

The L2 cache is invalidated at beginning of any IBs and that should
also invalidate the L2 metadata cache for compute anyways.

Fixes: 4a783a3c ("radv: Use L2 coherency on GFX9+.")
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/8494>

3 years agoci/freedreno: Remove some long-unseen a6xx known flakes.
Eric Anholt [Thu, 14 Jan 2021 23:43:00 +0000 (15:43 -0800)]
ci/freedreno: Remove some long-unseen a6xx known flakes.

We haven't seen any of these since June.

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

3 years agoci/freedreno: Drop skip list stuff from a5xx flakes.
Eric Anholt [Thu, 14 Jan 2021 23:41:49 +0000 (15:41 -0800)]
ci/freedreno: Drop skip list stuff from a5xx flakes.

I clearly copied the wrong file when setting this up.

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

3 years agoci/freedreno: Drop some long-unseen a5xx flakes.
Eric Anholt [Thu, 14 Jan 2021 23:41:04 +0000 (15:41 -0800)]
ci/freedreno: Drop some long-unseen a5xx flakes.

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

3 years agoci/freedreno: Remove a bunch of stale flakes from a3xx.
Eric Anholt [Thu, 14 Jan 2021 23:39:48 +0000 (15:39 -0800)]
ci/freedreno: Remove a bunch of stale flakes from a3xx.

I haven't seen these in the CI channel in many months.

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

3 years agoci/freedreno: Fix up the xfail/flake handling of a3xx texture functions.
Eric Anholt [Thu, 14 Jan 2021 23:38:12 +0000 (15:38 -0800)]
ci/freedreno: Fix up the xfail/flake handling of a3xx texture functions.

There's only one that's been unstable for the last couple months, and it's
almost always a fail, so just mark that one's state.

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

3 years agoci/freedreno: Mark some a5xx separate_shader tests as xfails.
Eric Anholt [Thu, 14 Jan 2021 23:34:04 +0000 (15:34 -0800)]
ci/freedreno: Mark some a5xx separate_shader tests as xfails.

These almost always fail for us, so we get flake complaints on basically
every job.

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

3 years agogallium/ntt: Avoid referencing undefined channels of system values.
Eric Anholt [Thu, 14 Jan 2021 00:30:15 +0000 (16:30 -0800)]
gallium/ntt: Avoid referencing undefined channels of system values.

Fixes failure to compile the shader on the host with gl_NumWorkGroups (for
example) on virgl.

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

3 years agogallium/ntt: Add support for store_per_vertex_output.
Eric Anholt [Thu, 14 Jan 2021 00:18:02 +0000 (16:18 -0800)]
gallium/ntt: Add support for store_per_vertex_output.

Needed by virgl and r600 to use NTT.

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

3 years agogallium/ntt: Don't vectorize IBFE/UBFE/BFI.
Eric Anholt [Wed, 13 Jan 2021 23:48:36 +0000 (15:48 -0800)]
gallium/ntt: Don't vectorize IBFE/UBFE/BFI.

Since our source language only allows scalar offset/bits arguments,
virglrenderer only handled scalar values too.  Just refuse to vectorize
these to prevent breakage.

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

3 years agomesa/st: Dump nir-to-tgsi output when ST_DEBUG=tgsi or nir is set.
Eric Anholt [Mon, 11 Jan 2021 23:55:29 +0000 (15:55 -0800)]
mesa/st: Dump nir-to-tgsi output when ST_DEBUG=tgsi or nir is set.

Suggested by Gert Wollny, and oh how I've wanted this.

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

3 years agomesa/st: Lower shader images before handing off to NIR-to-TGSI.
Eric Anholt [Mon, 11 Jan 2021 23:43:54 +0000 (15:43 -0800)]
mesa/st: Lower shader images before handing off to NIR-to-TGSI.

Otherwise you'll just throw unknown intrinsic errors on drivers ignorant
of this NIR option.

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

3 years agomesa/st: Make a single helper for the NIR-to-TGSI transfer.
Eric Anholt [Mon, 11 Jan 2021 23:39:15 +0000 (15:39 -0800)]
mesa/st: Make a single helper for the NIR-to-TGSI transfer.

The common path means that we get NIR IR dumping on builtin shaders, too.

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

3 years agofrontend/dri: Expose RGB[AX]_SRGB as well
Rob Clark [Tue, 12 Jan 2021 00:12:10 +0000 (16:12 -0800)]
frontend/dri: Expose RGB[AX]_SRGB as well

platform_android prefers RGB[AX] over BGR[AX] to avoid buggyness with
older android versions.  But we need to include the corresponding SRGB
formats as well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2888
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8452>

3 years agozink: decouple renderpass from framebuffer state
Mike Blumenkrantz [Thu, 24 Dec 2020 14:42:24 +0000 (09:42 -0500)]
zink: decouple renderpass from framebuffer state

a framebuffer is based on the surfaces attached to it

a renderpass is based on the operations being performed

a zink_framebuffer object doesn't necessarily need to be changed
if the renderpass changes, as this might just indicate that a clear operation
is being used instead of a load, so we can cache the corresponding vk objects
into the zink_framebuffer based on the renderpass ops being used to (eventually)
reduce fb object thrashing by doing more incremental updates

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

3 years agozink: use 'fb' variable name for zink_framebuffer objects in zink_framebuffer.c
Mike Blumenkrantz [Thu, 24 Dec 2020 14:22:25 +0000 (09:22 -0500)]
zink: use 'fb' variable name for zink_framebuffer objects in zink_framebuffer.c

let's be a bit consistent and intuitive

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

3 years agozink: rename param in zink_create_framebuffer
Mike Blumenkrantz [Thu, 24 Dec 2020 14:21:48 +0000 (09:21 -0500)]
zink: rename param in zink_create_framebuffer

this is consistent with other state naming

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

3 years agozink: ralloc zink_framebuffer structs
Mike Blumenkrantz [Thu, 24 Dec 2020 14:20:39 +0000 (09:20 -0500)]
zink: ralloc zink_framebuffer structs

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

3 years agozink: remove renderpass refcounting
Mike Blumenkrantz [Thu, 24 Dec 2020 14:17:23 +0000 (09:17 -0500)]
zink: remove renderpass refcounting

this is useless because we never destroy renderpasses during the lifetime
of a process and don't want to do so

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

3 years agozink: add batch flag for checking renderpass state
Mike Blumenkrantz [Thu, 24 Dec 2020 14:16:33 +0000 (09:16 -0500)]
zink: add batch flag for checking renderpass state

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

3 years agozink: rework framebuffer state
Mike Blumenkrantz [Thu, 24 Dec 2020 13:26:32 +0000 (08:26 -0500)]
zink: rework framebuffer state

we don't want to actually be tracking any null surfaces, so instead use
the vk object for this purpose

also store the fb state onto the fb object so we have this info available
at all times

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

3 years agoir3: add debug option to override shader assembly
Danylo Piliaiev [Fri, 8 Jan 2021 13:09:30 +0000 (15:09 +0200)]
ir3: add debug option to override shader assembly

IR3_SHADER_DEBUG=vs,tcs,tes... now also prints shader's sha1.

When there is a file named %sha1%.asm in IR3_SHADER_OVERRIDE_PATH
directory - ir3 assembly from file would be parsed, assembled, and
will override the shader with corresponding sha1 hash.

Parsing failure is considered unrecoverable error.
Upon successful override shader's assembly is printed with:
 "Native code (overridden) for unnamed ..."

This debug option allows easier testing of small changes in
assembly without modifying the compiler or using computerator.

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

3 years agozink: only emit streamout targets during draw if we have them
Mike Blumenkrantz [Tue, 17 Nov 2020 23:30:00 +0000 (18:30 -0500)]
zink: only emit streamout targets during draw if we have them

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

3 years agomesa: always set valid index bounds for non-indexed draws for classic drivers
Marek Olšák [Tue, 12 Jan 2021 19:45:03 +0000 (14:45 -0500)]
mesa: always set valid index bounds for non-indexed draws for classic drivers

This should fix crashing piglit tests on the i915 classic driver.

Fixes: 2358da81d26 - mesa: switch (Multi)DrawArrays to DrawGallium

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8453>

3 years agoiris: Fix android build due to missing link to libmesa_iris_gen125
Jordan Justen [Sun, 10 Jan 2021 00:10:26 +0000 (16:10 -0800)]
iris: Fix android build due to missing link to libmesa_iris_gen125

Reported-by: Yugang Fan
Fixes: cd3251d6baf ("intel/iris: Build gen 12.5")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8426>

3 years agoturnip: make GS use correct varyings size from previous stage
Danylo Piliaiev [Thu, 14 Jan 2021 17:13:19 +0000 (19:13 +0200)]
turnip: make GS use correct varyings size from previous stage

Fixes:
 dEQP-VK.tessellation.invariance.primitive_set.triangles_fractional_even_spacing_ccw
 dEQP-VK.tessellation.invariance.outer_edge_division.triangles_fractional_even_spacing
 dEQP-VK.tessellation.invariance.outer_edge_symmetry.triangles_fractional_odd_spacing_cw
 dEQP-VK.tessellation.invariance.outer_edge_symmetry.quads_fractional_odd_spacing_ccw
 dEQP-VK.tessellation.invariance.outer_edge_symmetry.isolines_equal_spacing_cw
 dEQP-VK.tessellation.invariance.outer_edge_index_independence.triangles_equal_spacing_ccw
 dEQP-VK.tessellation.invariance.outer_edge_index_independence.triangles_fractional_even_spacing_cw
 dEQP-VK.tessellation.invariance.inner_triangle_set.triangles_equal_spacing

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

3 years agoiris: only set point sprite overrides if actually using points
Yevhenii Kolesnikov [Thu, 15 Oct 2020 14:21:14 +0000 (17:21 +0300)]
iris: only set point sprite overrides if actually using points

Fixes black screen in some FNA games.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3431
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7218>

3 years agozink: partially enable SSBO pipe cap
Mike Blumenkrantz [Tue, 5 Jan 2021 13:51:28 +0000 (08:51 -0500)]
zink: partially enable SSBO pipe cap

this enables atomic counters

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add more usage bits for buffer types
Mike Blumenkrantz [Tue, 17 Nov 2020 23:25:41 +0000 (18:25 -0500)]
zink: add more usage bits for buffer types

these things can be anything they want to be when they grow up

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: flag ssbo buffer resources as having pending writes on batch
Mike Blumenkrantz [Tue, 4 Aug 2020 18:57:06 +0000 (14:57 -0400)]
zink: flag ssbo buffer resources as having pending writes on batch

ssbos are the only descriptor type we support (so far) that allows writes
during the draw, so we have to ensure that we set the right flag on the batch
reference to handle sync if the buffer is later read from

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: split UBOs and samplers into 'read' batch references during draw
Mike Blumenkrantz [Fri, 28 Aug 2020 13:17:37 +0000 (09:17 -0400)]
zink: split UBOs and samplers into 'read' batch references during draw

we have the technology, so now we can just flag these resources as being
read from instead of also being written to, freeing them up for concurrent reads
without requiring fencing

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: start supporting atomic shader ops
Mike Blumenkrantz [Tue, 4 Aug 2020 18:28:50 +0000 (14:28 -0400)]
zink: start supporting atomic shader ops

this handles atomic_add, which is what atomic counters use

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: modify ubo loading in ntv to work for ssbos
Mike Blumenkrantz [Tue, 4 Aug 2020 18:24:54 +0000 (14:24 -0400)]
zink: modify ubo loading in ntv to work for ssbos

if ssbo variables are declared using the same structure as ubos, then
the mechanics here are identical, and we can just add a couple extra lines
to handle the atomic ops and different array usage

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: emit ssbo variables in ntv
Mike Blumenkrantz [Tue, 4 Aug 2020 18:26:22 +0000 (14:26 -0400)]
zink: emit ssbo variables in ntv

we're structuring these the same as ubos so we can reuse the same load
function later

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: hook up ssbo shader bindings
Mike Blumenkrantz [Tue, 4 Aug 2020 18:22:52 +0000 (14:22 -0400)]
zink: hook up ssbo shader bindings

this is just the struct zink_shader binding point stuff, but nothing is
using it yet

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add set_shader_buffers pipe_context method
Mike Blumenkrantz [Tue, 4 Aug 2020 18:21:00 +0000 (14:21 -0400)]
zink: add set_shader_buffers pipe_context method

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add util function for emitting ntv atomic ops
Mike Blumenkrantz [Tue, 4 Aug 2020 18:27:36 +0000 (14:27 -0400)]
zink: add util function for emitting ntv atomic ops

these all need specific memory params, but otherwise they're the same
as normal ops, so we can just make a helper function here to add in the memory
params

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agozink: add spirv builder function for runtime array type
Mike Blumenkrantz [Tue, 4 Aug 2020 18:20:19 +0000 (14:20 -0400)]
zink: add spirv builder function for runtime array type

we'll need this for ssbos

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8330>

3 years agonir/lower_uniforms_to_ubo: set explicit_binding on uniform_0
Mike Blumenkrantz [Wed, 2 Dec 2020 16:40:33 +0000 (11:40 -0500)]
nir/lower_uniforms_to_ubo: set explicit_binding on uniform_0

this variable is always bound to buffer index 0, so the binding info
here is actually useful

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7935>

3 years agozink: optimize renderpass hash table
Mike Blumenkrantz [Wed, 13 Jan 2021 16:08:25 +0000 (11:08 -0500)]
zink: optimize renderpass hash table

only the existing render targets need to be used for table entries

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8487>

3 years agoutil/set: split off create() into an init() function
Mike Blumenkrantz [Thu, 7 Jan 2021 14:39:46 +0000 (09:39 -0500)]
util/set: split off create() into an init() function

this brings parity with the matching hash_table api

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoutil/set: add the found param to search_or_add
Mike Blumenkrantz [Thu, 7 Jan 2021 14:38:52 +0000 (09:38 -0500)]
util/set: add the found param to search_or_add

this brings parity with the internal api

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoutil/set: optimize rehash for empty table and no-func clears
Mike Blumenkrantz [Tue, 12 Jan 2021 17:20:41 +0000 (12:20 -0500)]
util/set: optimize rehash for empty table and no-func clears

if the table is filled with deleted entries, we don't need to rzalloc+free an identical
block of memory for the table, we can just memset the existing one

the same applies to table clears without a function passed in that the table
doesn't need to be iterated and can just be memset

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoutil/hash_table: optimize rehash for empty table and no-func clears
Mike Blumenkrantz [Tue, 12 Jan 2021 17:20:41 +0000 (12:20 -0500)]
util/hash_table: optimize rehash for empty table and no-func clears

if the table is filled with deleted entries, we don't need to rzalloc+free an identical
block of memory for the table, we can just memset the existing one

the same applies to table clears without a function passed in that the table
doesn't need to be iterated and can just be memset

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8450>

3 years agoradeonsi: invalidate compute sgprs in si_rebind_buffer
Pierre-Eric Pelloux-Prayer [Mon, 11 Jan 2021 19:40:09 +0000 (20:40 +0100)]
radeonsi: invalidate compute sgprs in si_rebind_buffer

If we don't tag compute sgpr as dirty they will point to the
ol buffer location.
This fixes arb_compute_shader-dlist with mcbp enabled.

Fixes: 85a6bcca615 ("radeonsi: pass at most 3 images and/or shader buffers via user SGPRs for compute")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8433>

3 years agoac: add ifdef __cplusplus guard to header
Pierre-Eric Pelloux-Prayer [Mon, 11 Jan 2021 19:37:25 +0000 (20:37 +0100)]
ac: add ifdef __cplusplus guard to header

ac_shadowed_regs.h can be included from si_state_draw.cpp so this commit
adds the needed guards.

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

3 years agoci: Use meson test directly instead of ninja test
Michel Dänzer [Tue, 12 Jan 2021 17:39:03 +0000 (18:39 +0100)]
ci: Use meson test directly instead of ninja test

The former allows specifying how many processes to spawn for tests. The
latter seems to spawn (up to) as many test processes as there are CPU
cores.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8451>

3 years agoci: Remove .gitlab-ci/meson-build.bat
Michel Dänzer [Tue, 12 Jan 2021 17:27:31 +0000 (18:27 +0100)]
ci: Remove .gitlab-ci/meson-build.bat

Unused since 07885cbcdb0b "CI: Add native Windows VS2019 build"

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8451>