Commit Graph

133612 Commits

Author SHA1 Message Date
Mauro Rossi b53d404aa7 android: freedreno/ir3: Switch over to new encoder/decoder
Fixes the following building error:

FAILED: out/target/product/x86_64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
...
ld.lld: error: undefined symbol: isa_assemble
>>> referenced by ir3_shader.c:151 (external/mesa/src/freedreno/ir3/ir3_shader.c:151)
...
ld.lld: error: undefined symbol: isa_decode
>>> referenced by ir3_shader.c:668 (external/mesa/src/freedreno/ir3/ir3_shader.c:668)

Fixes: 5cae4779c ("freedreno/ir3: Switch over to new encoder/decoder")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8538>
2021-01-17 21:57:05 +01:00
Mauro Rossi 7c0298e2fe android: freedreno/hw/isa: Add description of ir3 ISA
Necessary to build libir3decode and libir3encode for Android

Fixes: 6d94f575d ("freedreno/hw/isa: Add description of ir3 ISA")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8538>
2021-01-17 21:57:05 +01:00
Hoe Hao Cheng a183ee2ed7 zink: remove excessive checks for loader version
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Hoe Hao Cheng c85902d60d zink/codegen: find promotion version using vulkan registry
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Hoe Hao Cheng 833b6ab443 zink/codegen: adding/fixing comments and copyright notice
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Hoe Hao Cheng a454c562d6 zink/codegen: codegen-ize load_instance_extensions()
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Hoe Hao Cheng c0259e5c6e zink/codegen: enable instance extension unconditionally if promoted
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Hoe Hao Cheng 463d7dc9c3 zink/codegen: make 'struct' optional in Version
while we are at it, fix a typo too

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Hoe Hao Cheng d0125fc487 zink/codegen: add some new attributes to Extension
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8521>
2021-01-17 15:24:03 +00:00
Vinson Lee 32797beaf5 nouveau: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre Moreau <dev@pmoreau.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8490>
2021-01-16 17:09:54 -08:00
Erico Nunes 7c885ad6c0 lima: introduce fs and vs shader cache
Some opengl features require shader recompilation to be implemented in
the mali400 and can only be detected at draw time. In some applications,
this could lead to recompiling shaders on every frame which could kill
performance. Introduce a shader cache to prevent this issue.
lima didn't have vertex shader recompilation yet but it is needed to
implement followup features, so include it here too.
Code heavily borrowed from the vc4 shader cache implementation.

One notable difference between the vc4 reference implementation and lima
is that lima still compiles the base shader at state creation time
without deferring it to the next draw (so that it stays compatible with
behaviour expected by unmodified shader-db, for example).

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8357>
2021-01-16 22:20:35 +00:00
Alexander Kapshuk 88fc4e26b6 frontends/va/image: Eliminate repetitive code on error paths
Removes repetitive code in exit on error paths in the derive image function.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8481>
2021-01-16 19:23:13 +00:00
Joel Linn 5939a64b15 freedreno/a2xx: add RB perfcounter 1-3
Xenos driver reads four perf counters in total.

v2: fix register names

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7666>
2021-01-16 19:10:22 +00:00
Joel Linn 040ffee71f freedreno/a2xx: fix/add RBBM perfcounter
Xenos driver read two perf counters and their order is also different.

v2: fix typo in register address

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7666>
2021-01-16 19:10:22 +00:00
Ilia Mirkin a0f4affcf6 glsl: only expose int64 atomics when extension is enabled
This limits the exposure of these functions to when the extension is
available. Prevents crashes otherwise, as the rest of the infrastructure
doesn't necessarily expect these functions when the extension is not
available.

Fixes: 40c1f9883e ("mesa,glsl: add support for GL_NV_shader_atomic_int64")
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8533>
2021-01-16 18:21:03 +00:00
Ilia Mirkin 6638b58ccf nv50/ir: clear dnz flag when converting mul/mad to simpler ops
Fixes some assertion failures in the GM107 emitter with the game
'tansei', noticed while debugging gitlab issue 4101.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8534>
2021-01-16 18:04:22 +00:00
Rob Clark 07a1a341bf freedreno/a6xx: Add r2d support for GMEM resolves
For cases where we need to do an MSAA resolve that BLIT events cannot
handle, fall back to CP_BLIT (r2d)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4085
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8509>
2021-01-16 17:28:02 +00:00
Bas Nieuwenhuizen c28469bae1 ac/surface: Fix GFX9 sparse mip info.
Used the wrong offset & pitch for gfx9.

Fixes: 50bafb85ec ("ac/surf: Add sparse texture info to radeon_surf.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4072
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8526>
2021-01-16 14:09:18 +00:00
Ilia Mirkin 55c42b7885 st/mesa: fix broken moves for u2i64 and related ops
These ops just put out mov's directly, which screws up the assignment
logic -- it just tries to only process the "last" mov. Don't try to do
the more optimized thing for 64-bit types, where this is just much
trickier.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8463>
2021-01-16 08:03:14 +00:00
Mike Blumenkrantz 011fea1a90 zink: reduce blendfactor when alpha_to_one is set
if alpha is 1, some of these blendfactors can be reduced to simpler ones

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8513>
2021-01-16 06:48:22 +00:00
Dave Airlie 7b48d5d36e lavapipe: fix missing piece of VK_KHR_get_physical_device_properties2
I missed two parts of the APIs for this, so add them, should fix
crashes in gstreamer vulkan when it tries to load lvp.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3989
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8511>
2021-01-16 03:23:40 +00:00
Jeremy Huddleston Sequoia 68a785e63f Fall back on clock_gettime when timespec_get() is unavailable
Fixes: e3a8013de8 "util/u_queue: add util_queue_fence_wait_timeout"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1020
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4088

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Yurii Kolesnykov <root@yurikoles.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8482>
2021-01-16 00:14:46 +00:00
Alyssa Rosenzweig 81becaa685 pan/bi: Fix assertion
Fixes: bef3fedc81 ("pan/bi: Lower 8bit fragment outputs to 16bit")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Coverity
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8489>
2021-01-15 21:50:32 +00:00
Dave Airlie ca834d0b2d device-select-layer: update for vulkan 1.2
The vulkan loader doesn't load layers for apps that require a newer
version of vulkan, so this layer didn't get loaded for vulkan 1.2 apps.

I would like to just stick 1.09 in there but it might be worth
validating it works at new version of vulkan I suppose and the major
doesn't revise that often

Fixes: 9bc5b2d169 ("vulkan: add initial device selection layer. (v6)")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8508>
2021-01-15 20:37:05 +00:00
Jeremy Huddleston Sequoia 766538f83c darwin: Use the system libunwind
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4094

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/8507>
2021-01-15 20:00:20 +00:00
Jeremy Huddleston Sequoia 08ac7b52e7 util: Fix pointer to integer conversion error when using libunwind
../src/util/u_debug_stack.c:97:20: error: incompatible pointer to integer conversion assigning to 'unw_word_t' (aka 'unsigned long') from 'void *' [-Werror,-Wint-conversion]
   pip.unwind_info = NULL;
                   ^ ~~~~
1 error generated.

Fixes: 70c272004f "gallium/util: libunwind support"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4094

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8507>
2021-01-15 20:00:20 +00:00
Jeremy Huddleston Sequoia 00944f80e2 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>
2021-01-15 19:37:32 +00:00
Eric Anholt 8e2e637480 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 92e8e94ee9 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 85f237634c 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 322fa3d9dc 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 6e6228f7f0 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 696b552435 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>
2021-01-15 18:58:50 +00:00
Eric Anholt b938b488f6 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 0565270380 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 8d9826f014 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>
2021-01-15 18:58:50 +00:00
Eric Anholt c5033f7c5e 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 13ae72aaae 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>
2021-01-15 18:58:50 +00:00
Eric Anholt 83f97cd0be 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>
2021-01-15 18:58:50 +00:00
Eric Anholt d938c28c31 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>
2021-01-15 18:58:50 +00:00
Eric Anholt e5e75b714d 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: b28eb044cd ("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>
2021-01-15 18:58:50 +00:00
Rob Clark bfe5ac89b2 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: e7630ec278 ("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>
2021-01-15 17:36:30 +00:00
Mike Blumenkrantz c27347b2e1 zink: enable PIPE_CAP_CLEAR_TEXTURE
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8512>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz 622f8f6ed5 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>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz e100746a73 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>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz 526db0fe82 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>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz 5bd0d7c62f 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>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz a131d06f17 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>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz 196794264f 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>
2021-01-15 16:38:04 +00:00
Mike Blumenkrantz cf40a087f3 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>
2021-01-15 16:38:04 +00:00