Commit Graph

132324 Commits

Author SHA1 Message Date
Eric Anholt a8fb7ac1c4 mapi: Fix symbols check with ASan enabled.
ASan apparently introduces public symbols with __odr_asan as the prefix.
Fixes unit tests when building with ASan.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt 39dbf47bfe glsl/uniform_initializer_tests: Fix memory leak
Needed for meson test with asan enabled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt 49c22c2155 glsl/general_ir_test: Fix leaks.
Needed for meson test with asan enabled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt 1d026e2275 disk_cache: Fix memory leaks in the unit test.
Needed for meson test with asan enabled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt f6665eb053 freedreno/ir3: Free the compiler at the end of the unit tests.
Needed for meson test with asan enabled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt ba8ce62d3c glx/tests: Fix leaks in the unit tests.
Needed for meson test with asan enabled.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt a3a1a65c09 glx/tests: Remove unused teardown function.
If you called it, it would be full of double frees because deleting some
of the objects cleans up their owned stuff.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt 867e7f7cf4 util/vma: Fix leak of the heap in the unit test.
Needed for unit testing with asan enabled.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt e640a9ca79 util: Fix memory leak in a hash table unit test.
Needed for unit testing with asan enabled.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Eric Anholt 547d11de54 etnaviv, v3d: Fix valgrind include paths.
dep_valgrind gives you -I/usr/include/valgrind (or whatever) so if
valgrind/ wasn't in the search path anyway, these includes would fail.
Found in CI when adding valgrind to the build images.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7936>
2020-12-15 19:39:29 +00:00
Tony Wasserka ada9be1ec9 radv,aco: Compile with -Wimplicit-fallthrough when available
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7847>
2020-12-15 18:22:46 +00:00
Tony Wasserka 6ba83d820c aco: Annotate switch fallthroughs
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7847>
2020-12-15 18:22:46 +00:00
Samuel Pitoiset 22790ef3d4 radv: add support for resolving layered depth/stencil images
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/8025>
2020-12-15 18:04:39 +00:00
Adam Jackson 0e9c231aef glx/xlib: Build fix
Helgrind support missed a spot.

Fixes: 53f7d539cd ("util: Add helgrind support for simple_mtx")
Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8108>
2020-12-15 17:30:56 +00:00
Adam Jackson 78c7edf962 zink: Simplify MoltenVK support a bit
There's no harm in checking for the extension on non-macOS, just do it.
Nor can I see any point in checking for both the layer and the
extension, since you're never going to see the extension if the layer
isn't available, so just check for the extension instead of the reduced
boolean. Simplify some variable naming while we're at it.

Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8019>
2020-12-15 17:20:13 +00:00
Adam Jackson 0781808935 zink: Factor out zink_create_logical_device
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8019>
2020-12-15 17:20:13 +00:00
Adam Jackson aa93673d9d zink: Factor out zink_get_loader_version()
This result isn't actually used within zink_create_instance, so don't do
it there.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8019>
2020-12-15 17:20:13 +00:00
Adam Jackson 5f7a8f6fc1 zink: Factor out winsys awareness from zink_internal_create_screen
Magic parameters are gross, this makes zink_internal_create_screen a bit
more reusable.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8019>
2020-12-15 17:20:13 +00:00
Adam Jackson a2f1354bdc zink: Fix indentation in zink_create_instance
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8019>
2020-12-15 17:20:13 +00:00
Erik Faye-Lund c314893988 gallium/util: add bitcast helpers for double and uint
This complements u_bitcast_f2u and u_bitcast_u2f with similar helpers
to cast between double and unsigned integers as well.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8034>
2020-12-15 15:12:41 +00:00
Erik Faye-Lund 615c4610bb gallium/util: make bitcast-helpers explicitly sized
These always work on 32-bit variables, so let's make that assumption
explicit.

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8034>
2020-12-15 15:12:41 +00:00
Lucas Stach 0ba788d73b etnaviv: tex_state: fix miplevel selection
Fixes the piglit tex-miplevel-selection test by:
1. properly taking texture baselevel and maxlevel into account
2. only enable lodbias when mipmapping is enabled

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7634>
2020-12-15 15:43:23 +01:00
Lionel Landwerlin d21cc94201 gallium/dri2: Don't forget protected content flag
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bd182777c8 ("egl: implement EGL_EXT_protected_surface support")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8094>
2020-12-15 10:10:17 +00:00
Robin Ole Heinemann df76963a5c anv: Add DRM_RDWR flag in anv_gem_handle_to_fd
The DRM_RDWR flag is needed for mmap with PROT_WRITE to work.

Cc: mesa-stable
Signed-off-by: Robin Ole Heinemann <robin.ole.heinemann@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8075>
2020-12-15 08:20:34 +00:00
Lionel Landwerlin 94687ee59f vulkan/overlay: add new options to display device/swapchain-format
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3973
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8080>
2020-12-15 08:05:38 +00:00
Lionel Landwerlin af9481cb89 vulkan/overlay: don't display frame numbers unless required
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3972
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8080>
2020-12-15 08:05:38 +00:00
David Stevens a2fb87eea6 egl/android: implement image cleanup callback
According to ANDROID_get_native_client_buffer, EGL implementations must
guarantee that the lifetime of an EGLClientBuffer returned by
eglGetNativeClientBufferANDROID is at least as long as that of the
EGLImage which is bound to. Do this by acquiring a reference to the
underlying AHardwareBuffer for all ANativeWindowBuffers which are bound
to an _EGLImage.

Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
2020-12-15 06:05:27 +00:00
David Stevens a1cf065e0a i965: plumb loader image cleanup callback
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
2020-12-15 06:05:27 +00:00
David Stevens d7814d6e0c frontend/dri: plumb loader image cleanup callback
Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
2020-12-15 06:05:27 +00:00
David Stevens 479840459f dri: add image cleanup callback to loader extensions
The callback may be used by dri drivers to perform cleanup when images
are destroyed. It is added to the dri2 and image loader extensions.

Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
2020-12-15 06:05:27 +00:00
David Stevens 80a028d830 egl/android: don't pass loaderPriv in get_front_bo
This is a noop, as no loader extensions pass a __DRIimage's
loader_private data back to the loader.

Signed-off-by: David Stevens <stevensd@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7805>
2020-12-15 06:05:27 +00:00
Vinson Lee c0f2a19aee zink: Fix typos.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8071>
2020-12-14 20:13:47 -08:00
Jesse Natalie 9ac8f8f490 gallium: Add optional pipe_context to flush_frontbuffer
It's hooked up in all the pipe wrapper drivers, and all the
frontends except a couple places in glx/xlib.

This enables a more efficient path for drivers which use
swrast's Present, but hardware rendering (e.g. d3d12, zink).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8045>
2020-12-14 23:31:37 +00:00
Rhys Perry 23488c3515 aco: allow divergent mbcnt_amd masks
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8085>
2020-12-14 20:35:21 +00:00
Rhys Perry feee375db9 aco: fix mbcnt_amd with wave32
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8085>
2020-12-14 20:35:21 +00:00
James Park 2ffae5a439 xmlconfig: Disable WITH_XMLCONFIG on Windows
This change was stomped by recent refactor.

Fixes: 1618bd1bee ("xmlconfig: Add unit tests for recent bugs in the driconf rewrite.")
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7975>
2020-12-14 17:28:04 +00:00
Andrii Simiklit a7fb3954a1 glx: fix spelling issues
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7965>
2020-12-14 16:57:00 +00:00
Andrii Simiklit 618e480f38 glx: lets compare drawing command sizes using MIN3
It has to fix coverity issue CID1470555:
```
481        if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) {
482           bufSize = __GLX_RENDER_CMD_SIZE_LIMIT;
483        }
484        if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) {
>>>     CID 1470555:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "bufSize = 64000;".
485           bufSize = __GLX_MAX_RENDER_CMD_SIZE;
486        }
```

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7965>
2020-12-14 16:57:00 +00:00
Daniel Schürmann ef4101d6d7 aco/spill: only prevent rematerializable vars from being DCE'd if they haven't been renamed
The small DCE of the spiller only removes the original instructions
of rematerialized variables in case they are unused. If a variable
has been renamed, it cannot match any original instruction anymore.
Thus, the lookup is then unnecessary and can be omitted.

No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8055>
2020-12-14 16:42:49 +00:00
Daniel Schürmann 0bccfd86f6 aco: fix DCE of rematerializable phi operands
Otherwise, if a phi gets spilled, the operand might be considered unused.

Fixes: d48d72e98a ('aco: Initial commit of independent AMD compiler')

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8055>
2020-12-14 16:42:49 +00:00
Samuel Pitoiset a791c1f3a7 radv: advertise VK_KHR_fragment_shading_rate on GFX10.3+
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/7837>
2020-12-14 16:22:39 +00:00
Samuel Pitoiset 77343576eb aco: implement a workaround for gl_FragCoord.z with VRS on GFX10.3
Without it, FragCoord.z will have the value of one of the fine pixels
instead of the center of the coarse pixel.

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/7837>
2020-12-14 16:22:39 +00:00
Samuel Pitoiset 45524afe95 radv/llvm: implement a workaround for gl_FragCoord.z with VRS on GFX10.3
Without it, FragCoord.z will have the value of one of the fine pixels
instead of the center of the coarse pixel.

It's only enabled for RADV.

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/7837>
2020-12-14 16:22:38 +00:00
Samuel Pitoiset 7a464f4296 radv: track if VRS is enabled to apply a workaround on GFX10.3
On some chips, gl_FragCoord.z has to be adjusted.

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/7837>
2020-12-14 16:22:38 +00:00
Samuel Pitoiset c587eaadf6 aco: implement fragment shading rate
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/7837>
2020-12-14 16:22:38 +00:00
Samuel Pitoiset 0bac0b7f19 radv/llvm: implement fragment shading rate
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/7837>
2020-12-14 16:22:38 +00:00
Samuel Pitoiset bf69d89b5a radv: implement VK_KHR_fragment_shading_rate
Only supported on GFX10.3+. Attachment Fragment Shading Rate is
for later.

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/7837>
2020-12-14 16:22:38 +00:00
Samuel Pitoiset d8c1931ca9 radv: add VK_KHR_fragment_shading_rate but leave it disabled
To declare new prototypes.

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/7837>
2020-12-14 16:22:38 +00:00
Samuel Pitoiset 9770ffb07c amd/registers: add missing VRS registers
These register definitions are copied from AMDVLK because they
aren't even in the kernel.

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/7837>
2020-12-14 16:22:38 +00:00
Daniel Schürmann c4217ef2fc aco: don't create dead exec mask phis on merge blocks
Avoids some unnecessary exec copies and allows for a bit more
jump threading.

Totals from 112 (0.08% of 139391) affected shaders (NAVI10):
SpillSGPRs: 3084 -> 3050 (-1.10%)
CodeSize: 2657516 -> 2652376 (-0.19%)
Instrs: 492074 -> 490824 (-0.25%)
Cycles: 40369704 -> 40317052 (-0.13%)
VMEM: 24212 -> 24128 (-0.35%)
SClause: 12018 -> 12010 (-0.07%)
Copies: 72950 -> 72275 (-0.93%)
Branches: 13249 -> 12701 (-4.14%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8059>
2020-12-14 15:58:24 +00:00