Commit Graph

132353 Commits

Author SHA1 Message Date
Jesse Natalie da9b6a21f4 d3d12: Include wsl/winadapter.h when not compiling for Windows
The winadapter.h provides typedefs and defines to enable the
D3D/DXCore headers to be included as-is when targeting non-
Windows platforms.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie 8fc2676e47 winsys_handle: Change D3D12 resource handle type to void*
This lets us include it in Linux builds as well, without needing
to pull in IUnknown.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie 4ee55769d6 microsoft/compiler: Pick up new dxcapi.h
This is more up-to-date with what's on GitHub, and more importantly,
it embeds some of the non-Windows support logic in the header, instead
of shelling out to a nonexistent header.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie f673648003 d3d12: Add DXCore screen variation
Not all Windows platforms have DXGI, and neither does WSL.
Instead, we can use the DXCore API for adapter enumeration.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie 50fab5da93 d3d12: Refactor screen to abstract DXGI details
The next commit will add an alternative that can be dropped in instead.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Jesse Natalie bc5f69faee d3d12: Use DirectX-Headers wrap for d3d12.h
This does 2 things for us:
1. Allows us to compile-time depend on any features from new headers,
   instead of having to conditionally compile based on Windows SDK version.
2. Allows us to reference d3d12.h when compiling for non-Windows.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
2020-12-16 16:25:54 +00:00
Simon Ser c37d8ae82b egl/wayland: add a NULL guard for the authenticate callback
On some platforms, the authenticate callback may be NULL, e.g. on
surfaceless. If a client tries to send a wl_drm.authenticate request
the handler tries to dereference the NULL pointer.

This can be reproduced with libva which unconditionally tries to use
wl_drm.authenticate even with render nodes [1]. Run a compositor with
a surfaceless context, then try to start e.g. mpv to trigger the
segfault.

[1]: https://github.com/intel/libva/pull/476

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7992>
2020-12-16 13:48:48 +00:00
Mike Blumenkrantz a709d99bfd st/mesa: set drawpixels swizzle before creating sampler view
(some) drivers need to have the swizzle set prior to create_sampler_view
being called in order to actually apply it

Fixes: d11fefa961 ("st/mesa: optimize 4-component ubyte glDrawPixels")
Acked-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8107>
2020-12-16 13:25:05 +00:00
Erik Faye-Lund ba74e1be22 zink: fix 8 bit index handling code
index_size is specified in bytes, not bits.

Fixes: f4583b4086 ("zink: move 8bit index handling out of u_primconvert path")

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8081>
2020-12-16 10:43:34 +00:00
Erik Faye-Lund 008bf6ca61 zink: ralloc spirv_shader
This uses ralloc for spirv_shader and it's data-payload, which seems a
bit neater than having to remember to free twice. We can now also easily
piggy back on more sophisticated ralloc usage as well.

No need to use rzalloc here, as we'll write all memory in the struct,
and the struct isn't used as a hashmap key, so padding shouldn't matter.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8049>
2020-12-16 10:37:10 +00:00
Erik Faye-Lund 03ccd3c468 zink: use emit_bitcast helper
We already have this helper, so let's use it. It makes the code
*slightly* shorter and easier to follow IMO.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8049>
2020-12-16 10:37:10 +00:00
Erik Faye-Lund 134df0069f zink: use shader-read-only-optimal for samplers
Using the general layout for samplers can have terrible performance, so
let's use shader-read-only-optimal instead.

This is fairly straight-forward if we use conservative bounds for the
barriers, and assume they are being used in all stages.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7655>
2020-12-16 10:27:52 +00:00
Pierre-Eric Pelloux-Prayer 1a4c4cd110 driconf: add workaround for Enter The Gungeon
Quoting a comment on the bug report:

   I suspect the shader is incorrect.

   When a (conditional) discard is executed then control flow
   becomes non-uniform, meaning that subsequent implicit
   derivatives required for the texture operation are not
   computed correctly.

Using glsl_correct_derivatives_after_discard fixes it. Note
that for radeonsi this requires LLVM master to work properly.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1386
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8005>
2020-12-16 10:52:54 +01:00
Pierre-Eric Pelloux-Prayer 296316b5de st/mesa: disable line stippling if pattern is all 1's
The spec says:
  When disabled, it is as if theline stipple has its default value
(the default value being all 1's)

So treat pattern=0xffff as line stippling = off.

This improves performance in specviewperf13 snx lines tests.
For instance in the last test I get:
  * master: 260 fps, gpu-load: ~92%
  * with this commit: 280 fps, gpu-load: ~72%

(both tested with d60930c017 reverted)

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8105>
2020-12-16 09:33:06 +00:00
Erik Faye-Lund 967ae12931 Revert "st/dri: make sure software color-buffers are linear"
This reverts commit 040a2643c0.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8115>
2020-12-16 09:25:59 +00:00
Erik Faye-Lund 1fd5e7b14e zink: force display-targets to be linear
This is close to a revert of commit
b5b25ee032, but it limits the scope a bit
to avoid needless performance degregation.

In the long run, we should really allow using tiled resources here, and
instead detile while presenting.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8115>
2020-12-16 09:25:59 +00:00
jzielins 87d7568d69 swr: Fix building with LLVM12
Updates SWR code to match recent changes
in StructType and VectorType APIs

Fixes: #3917

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8041>
2020-12-16 10:10:53 +01:00
Marek Olšák 27097ca6b5 radeonsi: improve a comment about an MSAA bug workaround
It doesn't make complete sense to me, but it's copied from the commit
message that made this change.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8022>
2020-12-16 00:43:51 -05:00
Marek Olšák 3b9fb98c4b radeonsi: disable NGG fast launch with indexed triangle strips to fix a hang
This will be added to our TODO list.

Fixes: aaed7a29be - radeonsi: implement GS fast launch for indexed triangle strips

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8022>
2020-12-16 00:43:48 -05:00
Marek Olšák dffc27e5e1 radeonsi: fix small primitive culling with MSAA force-disabled and smoothing
The problem was that the shader constants were based on the framebuffer
sample count and ignored the multisample enable state and the line/polygon
smoothing state, which uses MSAA rasterization that only sets SampleMaskIn
to get the coverage for alpha-blended smoothing (the PS epilog computes
the alpha channel from SampleMaskIn and blending generates the AA results).

- This is a complete rework that adds a new state for NGG cull constants.
- It fixes the same thing for the prim discard compute shader.
- It documents how VS_STATE.SMALL_PRIM_PRECISION is encoded.

It fixes blue corruption in Unigine Heaven with MSAA and Medium details
or better.

Fixes: 7648060dc0 - radeonsi: enable NGG culling by default on gfx10.3 dGPUs

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8022>
2020-12-16 00:43:45 -05:00
Vinson Lee 836b9e1d88 glsl: Fix typos in comments.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7767>
2020-12-16 02:19:56 +00:00
Erico Nunes 001411774d lima: adjust pp and gp max const buffer size
According to the mali driver output, the Mali-400 GP provides space for
304 vec4 uniforms, globals and temporary variables.

The Mali-PP supports a uniform table up to size 32768 total.
However, indirect access to an uniform only supports indices up to 8192
(a 2048 vec4 array). Trying to access beyond that currently causes a pp
job timeout with both lima and the mali driver. To prevent indices
bigger than that in application uniforms, limit to 8192 for now.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8079>
2020-12-16 01:04:41 +00:00
jzielins 9ed50cba6e gallium/swr: Fix Windows build
Fixing small mistake in the swr code that caused
compilation issues on Windows

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>

Fixes: 9ac8f8f490
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8117>
2020-12-15 20:39:06 +00:00
Jesse Natalie 5228847c02 CI: Add repeat-wait to Windows Piglit skip
This test is flaky/racy due to an incorrect timeout value being used.
See https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/433

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8114>
2020-12-15 20:15:23 +00:00
Jesse Natalie 0e215ff487 d3d12: Fix incorrect fence timeout calculation
Fixes: 2ea15cd6 ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8114>
2020-12-15 20:15:22 +00:00
Eric Anholt f3e33dee07 ci: Add an ASan build on x86.
I want to enable ASan runs on freedreno.  It turns out it's a long road to
get there, starting with making sure we can run our unit tests with the
sanitizer enabled.

While I'm revving this container, add in valgrind too to make sure that
our build paths with valgrind enabled work.

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 6f52386544 amd: Fix leak in ac_surface_modifier_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 26198e875a driconf: Fix memory leak 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 0d23f4e56f glsl/standalone: Fix memory 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 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