platform/upstream/mesa.git
3 years agod3d12: Add DXCore screen variation
Jesse Natalie [Tue, 8 Dec 2020 20:21:11 +0000 (12:21 -0800)]
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>

3 years agod3d12: Refactor screen to abstract DXGI details
Jesse Natalie [Tue, 8 Dec 2020 20:14:40 +0000 (12:14 -0800)]
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>

3 years agod3d12: Use DirectX-Headers wrap for d3d12.h
Jesse Natalie [Tue, 24 Nov 2020 19:54:07 +0000 (11:54 -0800)]
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>

3 years agoegl/wayland: add a NULL guard for the authenticate callback
Simon Ser [Tue, 8 Dec 2020 18:17:37 +0000 (19:17 +0100)]
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>

3 years agost/mesa: set drawpixels swizzle before creating sampler view
Mike Blumenkrantz [Tue, 15 Dec 2020 04:35:55 +0000 (23:35 -0500)]
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: d11fefa9616 ("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>

3 years agozink: fix 8 bit index handling code
Erik Faye-Lund [Mon, 14 Dec 2020 10:51:14 +0000 (11:51 +0100)]
zink: fix 8 bit index handling code

index_size is specified in bytes, not bits.

Fixes: f4583b40863 ("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>

3 years agozink: ralloc spirv_shader
Erik Faye-Lund [Thu, 10 Dec 2020 16:51:39 +0000 (17:51 +0100)]
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>

3 years agozink: use emit_bitcast helper
Erik Faye-Lund [Thu, 10 Dec 2020 14:51:08 +0000 (15:51 +0100)]
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>

3 years agozink: use shader-read-only-optimal for samplers
Erik Faye-Lund [Tue, 17 Nov 2020 10:37:14 +0000 (11:37 +0100)]
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>

3 years agodriconf: add workaround for Enter The Gungeon
Pierre-Eric Pelloux-Prayer [Wed, 9 Dec 2020 14:41:59 +0000 (15:41 +0100)]
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>

3 years agost/mesa: disable line stippling if pattern is all 1's
Pierre-Eric Pelloux-Prayer [Thu, 10 Dec 2020 17:50:50 +0000 (18:50 +0100)]
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>

3 years agoRevert "st/dri: make sure software color-buffers are linear"
Erik Faye-Lund [Tue, 15 Dec 2020 18:54:56 +0000 (19:54 +0100)]
Revert "st/dri: make sure software color-buffers are linear"

This reverts commit 040a2643c08dd0accee6942bc05836b99417ee49.

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>

3 years agozink: force display-targets to be linear
Erik Faye-Lund [Tue, 15 Dec 2020 18:51:29 +0000 (19:51 +0100)]
zink: force display-targets to be linear

This is close to a revert of commit
b5b25ee0327f65d837ff84f59b497232d52ec25d, 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>

3 years agoswr: Fix building with LLVM12
jzielins [Thu, 10 Dec 2020 16:55:35 +0000 (17:55 +0100)]
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>

3 years agoradeonsi: improve a comment about an MSAA bug workaround
Marek Olšák [Wed, 9 Dec 2020 23:18:33 +0000 (18:18 -0500)]
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>

3 years agoradeonsi: disable NGG fast launch with indexed triangle strips to fix a hang
Marek Olšák [Wed, 9 Dec 2020 23:22:21 +0000 (18:22 -0500)]
radeonsi: disable NGG fast launch with indexed triangle strips to fix a hang

This will be added to our TODO list.

Fixes: aaed7a29bef - 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>

3 years agoradeonsi: fix small primitive culling with MSAA force-disabled and smoothing
Marek Olšák [Thu, 10 Dec 2020 00:18:37 +0000 (19:18 -0500)]
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: 7648060dc03 - 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>

3 years agoglsl: Fix typos in comments.
Vinson Lee [Wed, 25 Nov 2020 02:59:03 +0000 (18:59 -0800)]
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>

3 years agolima: adjust pp and gp max const buffer size
Erico Nunes [Fri, 11 Dec 2020 18:58:07 +0000 (19:58 +0100)]
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>

3 years agogallium/swr: Fix Windows build
jzielins [Tue, 15 Dec 2020 17:23:50 +0000 (18:23 +0100)]
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: 9ac8f8f490d0ee08ac9ca6f1c6963043c2991443
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8117>

3 years agoCI: Add repeat-wait to Windows Piglit skip
Jesse Natalie [Tue, 15 Dec 2020 19:28:22 +0000 (11:28 -0800)]
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>

3 years agod3d12: Fix incorrect fence timeout calculation
Jesse Natalie [Tue, 8 Dec 2020 22:58:45 +0000 (14:58 -0800)]
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>

3 years agoci: Add an ASan build on x86.
Eric Anholt [Mon, 30 Nov 2020 20:01:23 +0000 (12:01 -0800)]
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>

3 years agoamd: Fix leak in ac_surface_modifier_test.
Eric Anholt [Mon, 14 Dec 2020 22:17:32 +0000 (14:17 -0800)]
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>

3 years agodriconf: Fix memory leak in the unit test.
Eric Anholt [Fri, 4 Dec 2020 23:34:47 +0000 (15:34 -0800)]
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>

3 years agoglsl/standalone: Fix memory leaks
Eric Anholt [Fri, 4 Dec 2020 23:17:51 +0000 (15:17 -0800)]
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>

3 years agomapi: Fix symbols check with ASan enabled.
Eric Anholt [Fri, 4 Dec 2020 21:23:03 +0000 (13:23 -0800)]
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>

3 years agoglsl/uniform_initializer_tests: Fix memory leak
Eric Anholt [Fri, 4 Dec 2020 21:19:32 +0000 (13:19 -0800)]
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>

3 years agoglsl/general_ir_test: Fix leaks.
Eric Anholt [Fri, 4 Dec 2020 20:54:46 +0000 (12:54 -0800)]
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>

3 years agodisk_cache: Fix memory leaks in the unit test.
Eric Anholt [Fri, 4 Dec 2020 20:51:45 +0000 (12:51 -0800)]
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>

3 years agofreedreno/ir3: Free the compiler at the end of the unit tests.
Eric Anholt [Fri, 4 Dec 2020 20:46:12 +0000 (12:46 -0800)]
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>

3 years agoglx/tests: Fix leaks in the unit tests.
Eric Anholt [Fri, 4 Dec 2020 19:47:46 +0000 (11:47 -0800)]
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>

3 years agoglx/tests: Remove unused teardown function.
Eric Anholt [Fri, 4 Dec 2020 19:37:43 +0000 (11:37 -0800)]
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>

3 years agoutil/vma: Fix leak of the heap in the unit test.
Eric Anholt [Fri, 4 Dec 2020 19:17:39 +0000 (11:17 -0800)]
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>

3 years agoutil: Fix memory leak in a hash table unit test.
Eric Anholt [Fri, 4 Dec 2020 19:13:37 +0000 (11:13 -0800)]
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>

3 years agoetnaviv, v3d: Fix valgrind include paths.
Eric Anholt [Mon, 30 Nov 2020 20:40:34 +0000 (12:40 -0800)]
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>

3 years agoradv,aco: Compile with -Wimplicit-fallthrough when available
Tony Wasserka [Tue, 1 Dec 2020 11:31:05 +0000 (12:31 +0100)]
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>

3 years agoaco: Annotate switch fallthroughs
Tony Wasserka [Tue, 1 Dec 2020 10:52:20 +0000 (11:52 +0100)]
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>

3 years agoradv: add support for resolving layered depth/stencil images
Samuel Pitoiset [Thu, 10 Dec 2020 08:33:36 +0000 (09:33 +0100)]
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>

3 years agoglx/xlib: Build fix
Adam Jackson [Fri, 11 Dec 2020 21:52:10 +0000 (16:52 -0500)]
glx/xlib: Build fix

Helgrind support missed a spot.

Fixes: 53f7d539cd9 ("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>

3 years agozink: Simplify MoltenVK support a bit
Adam Jackson [Wed, 9 Dec 2020 17:20:45 +0000 (12:20 -0500)]
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>

3 years agozink: Factor out zink_create_logical_device
Adam Jackson [Tue, 8 Dec 2020 22:11:19 +0000 (17:11 -0500)]
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>

3 years agozink: Factor out zink_get_loader_version()
Adam Jackson [Tue, 8 Dec 2020 22:02:47 +0000 (17:02 -0500)]
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>

3 years agozink: Factor out winsys awareness from zink_internal_create_screen
Adam Jackson [Wed, 2 Dec 2020 20:38:35 +0000 (15:38 -0500)]
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>

3 years agozink: Fix indentation in zink_create_instance
Adam Jackson [Wed, 9 Dec 2020 17:27:27 +0000 (12:27 -0500)]
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>

3 years agogallium/util: add bitcast helpers for double and uint
Erik Faye-Lund [Thu, 10 Dec 2020 12:20:53 +0000 (13:20 +0100)]
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>

3 years agogallium/util: make bitcast-helpers explicitly sized
Erik Faye-Lund [Thu, 10 Dec 2020 12:18:36 +0000 (13:18 +0100)]
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>

3 years agoetnaviv: tex_state: fix miplevel selection
Lucas Stach [Fri, 14 Aug 2020 21:55:20 +0000 (23:55 +0200)]
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>

3 years agogallium/dri2: Don't forget protected content flag
Lionel Landwerlin [Mon, 14 Dec 2020 19:32:55 +0000 (21:32 +0200)]
gallium/dri2: Don't forget protected content flag

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: bd182777c8f2c4 ("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>

3 years agoanv: Add DRM_RDWR flag in anv_gem_handle_to_fd
Robin Ole Heinemann [Sun, 13 Dec 2020 01:22:57 +0000 (02:22 +0100)]
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>

3 years agovulkan/overlay: add new options to display device/swapchain-format
Lionel Landwerlin [Mon, 14 Dec 2020 08:53:42 +0000 (10:53 +0200)]
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>

3 years agovulkan/overlay: don't display frame numbers unless required
Lionel Landwerlin [Mon, 14 Dec 2020 08:50:25 +0000 (10:50 +0200)]
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>

3 years agoegl/android: implement image cleanup callback
David Stevens [Thu, 26 Nov 2020 04:52:58 +0000 (13:52 +0900)]
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>

3 years agoi965: plumb loader image cleanup callback
David Stevens [Wed, 9 Dec 2020 01:38:25 +0000 (10:38 +0900)]
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>

3 years agofrontend/dri: plumb loader image cleanup callback
David Stevens [Thu, 26 Nov 2020 04:15:55 +0000 (13:15 +0900)]
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>

3 years agodri: add image cleanup callback to loader extensions
David Stevens [Thu, 26 Nov 2020 05:03:16 +0000 (14:03 +0900)]
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>

3 years agoegl/android: don't pass loaderPriv in get_front_bo
David Stevens [Thu, 26 Nov 2020 09:29:31 +0000 (18:29 +0900)]
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>

3 years agozink: Fix typos.
Vinson Lee [Sat, 12 Dec 2020 02:41:39 +0000 (18:41 -0800)]
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>

3 years agogallium: Add optional pipe_context to flush_frontbuffer
Jesse Natalie [Thu, 10 Dec 2020 18:50:54 +0000 (10:50 -0800)]
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\9aák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8045>

3 years agoaco: allow divergent mbcnt_amd masks
Rhys Perry [Mon, 14 Dec 2020 13:18:39 +0000 (13:18 +0000)]
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>

3 years agoaco: fix mbcnt_amd with wave32
Rhys Perry [Mon, 14 Dec 2020 13:18:25 +0000 (13:18 +0000)]
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>

3 years agoxmlconfig: Disable WITH_XMLCONFIG on Windows
James Park [Mon, 7 Dec 2020 18:36:05 +0000 (10:36 -0800)]
xmlconfig: Disable WITH_XMLCONFIG on Windows

This change was stomped by recent refactor.

Fixes: 1618bd1bee6 ("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>

3 years agoglx: fix spelling issues
Andrii Simiklit [Mon, 7 Dec 2020 11:03:09 +0000 (13:03 +0200)]
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>

3 years agoglx: lets compare drawing command sizes using MIN3
Andrii Simiklit [Mon, 7 Dec 2020 10:50:28 +0000 (12:50 +0200)]
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>

3 years agoaco/spill: only prevent rematerializable vars from being DCE'd if they haven't been...
Daniel Schürmann [Fri, 11 Dec 2020 18:37:50 +0000 (19:37 +0100)]
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>

3 years agoaco: fix DCE of rematerializable phi operands
Daniel Schürmann [Fri, 11 Dec 2020 13:30:30 +0000 (14:30 +0100)]
aco: fix DCE of rematerializable phi operands

Otherwise, if a phi gets spilled, the operand might be considered unused.

Fixes: d48d72e98af9436babeeb3a94b312f94bc582b36 ('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>

3 years agoradv: advertise VK_KHR_fragment_shading_rate on GFX10.3+
Samuel Pitoiset [Mon, 30 Nov 2020 17:54:06 +0000 (18:54 +0100)]
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>

3 years agoaco: implement a workaround for gl_FragCoord.z with VRS on GFX10.3
Samuel Pitoiset [Thu, 10 Dec 2020 20:47:23 +0000 (21:47 +0100)]
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>

3 years agoradv/llvm: implement a workaround for gl_FragCoord.z with VRS on GFX10.3
Samuel Pitoiset [Fri, 11 Dec 2020 07:46:19 +0000 (08:46 +0100)]
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>

3 years agoradv: track if VRS is enabled to apply a workaround on GFX10.3
Samuel Pitoiset [Fri, 11 Dec 2020 12:35:45 +0000 (13:35 +0100)]
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>

3 years agoaco: implement fragment shading rate
Samuel Pitoiset [Mon, 23 Nov 2020 15:01:00 +0000 (16:01 +0100)]
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>

3 years agoradv/llvm: implement fragment shading rate
Samuel Pitoiset [Thu, 26 Nov 2020 16:37:38 +0000 (17:37 +0100)]
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>

3 years agoradv: implement VK_KHR_fragment_shading_rate
Samuel Pitoiset [Thu, 26 Nov 2020 16:39:53 +0000 (17:39 +0100)]
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>

3 years agoradv: add VK_KHR_fragment_shading_rate but leave it disabled
Samuel Pitoiset [Tue, 20 Oct 2020 13:11:00 +0000 (15:11 +0200)]
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>

3 years agoamd/registers: add missing VRS registers
Samuel Pitoiset [Mon, 23 Nov 2020 16:59:10 +0000 (17:59 +0100)]
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>

3 years agoaco: don't create dead exec mask phis on merge blocks
Daniel Schürmann [Fri, 11 Dec 2020 16:44:19 +0000 (17:44 +0100)]
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>

3 years agoetnaviv: remove imm_ prefix from etna_shader_uniform_info members
Christian Gmeiner [Wed, 18 Nov 2020 14:54:16 +0000 (15:54 +0100)]
etnaviv: remove imm_ prefix from etna_shader_uniform_info members

This prefix is meaningless.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8062>

3 years agoetnaviv: rename from immedaite to uniform in some places
Christian Gmeiner [Wed, 18 Nov 2020 14:36:03 +0000 (15:36 +0100)]
etnaviv: rename from immedaite to uniform in some places

This naming change should clarify what we are actually doing here.

We are defining/managing what data is stored in the GPUs
uniform data storage area. A shader can access this area with
the ETNA_RGROUP_UNIFORM register group.

In this uniform data area we need to store const buffer data and
own immediate/constant data.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8062>

3 years agoradv: fix access to uninitialized radeon_bo_metadata
Simon Ser [Thu, 3 Dec 2020 15:03:15 +0000 (16:03 +0100)]
radv: fix access to uninitialized radeon_bo_metadata

If the image tiling is set to VK_IMAGE_TILING_LINEAR,
buffer_set_metadata will read an uninitialized radeon_bo_metadata.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: d5fd8cd46eee ("radv: Allow non-dedicated linear images and buffer.")
Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7898>

3 years agost/pbo: fix pbo uploads without PIPE_CAP_TGSI_VS_LAYER_VIEWPORT
Mike Blumenkrantz [Sat, 12 Dec 2020 00:00:23 +0000 (19:00 -0500)]
st/pbo: fix pbo uploads without PIPE_CAP_TGSI_VS_LAYER_VIEWPORT

the code here tries to be too smart and only use a geometry shader if there's
actually multiple layers being uploaded, but the fragment shader also unconditionally
reads gl_Layer as long as the pipe cap for gs is set, which means that
in the case when the gs is dynamically disabled due to uploading a
single-layer surface, the fs has no input to read for gl_Layer and everything breaks

always using a gs isn't ideal, but it's considerably more work to manage multiple
fs variants based on layer usage

Fixes: c99f2fe70ec ("st/mesa: implement PBO upload for multiple layers")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8067>

3 years agozink: really fix direct image mapping offset (I mean it this time)
Mike Blumenkrantz [Sat, 12 Dec 2020 16:59:40 +0000 (11:59 -0500)]
zink: really fix direct image mapping offset (I mean it this time)

I got confused and:
* used the vkformat instead of the pipe format for getting format description
* incorrectly calculated bpp

but this time it's definitely 100% fixed I promise

Fixes: 456b57802ea ("zink: fix direct image mapping offset")

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

3 years agoci: skip failing test on lavapipe
Simon Ser [Sun, 13 Dec 2020 10:04:58 +0000 (11:04 +0100)]
ci: skip failing test on lavapipe

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8077>

3 years agozink: fix property detection
Hoe Hao Cheng [Sun, 13 Dec 2020 05:03:34 +0000 (13:03 +0800)]
zink: fix property detection

yikes, that's a bad typo right there

Fixes: a103666b ("zink: decouple features and enabling conditions in zink_device_info.py")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8076>

3 years agomesa: Remove cmd_size < 0 check.
Vinson Lee [Thu, 10 Dec 2020 02:51:16 +0000 (18:51 -0800)]
mesa: Remove cmd_size < 0 check.

cmd_size was changed to size_t in commit 4b2445916e6 ("glthread:
change sizes to unsigned or size_t where needed").

Fix defect reported by Coverity Scan.

Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This less-than-zero comparison of an unsigned
value is never true. cmd_size < 0UL

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

3 years agointel/genxml: Avoid generating identical 12.5 and 12 branches.
Vinson Lee [Wed, 9 Dec 2020 06:32:16 +0000 (22:32 -0800)]
intel/genxml: Avoid generating identical 12.5 and 12 branches.

Fix defects reported by Coverity Scan.

Identical code for different branches (IDENTICAL_BRANCHES)

identical_branches: The same code is executed regardless of
whether 0 is true, because the 'then' and 'else' branches are
identical. Should one of the branches be modified, or the entire
'if' statement replaced?

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8001>

3 years agomesa: Remove extra texObj.
Vinson Lee [Wed, 9 Dec 2020 06:04:53 +0000 (22:04 -0800)]
mesa: Remove extra texObj.

Fix defect reported by Coverity Scan.

Evaluation order violation (EVALUATION_ORDER)
write_write_typo: In texObj = texObj = _mesa_get_tex_unit(ctx, u)->CurrentTex[tgt], texObj is written twice with the same value.

Fixes: d0e18550e26 ("mesa: optimize saving/restoring bound textures for glPush/PopAttrib")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8000>

3 years agonir: Redefine start/end_ip of blocks to fix NIR-to-TGSI liveness bugs.
Eric Anholt [Fri, 11 Dec 2020 17:48:15 +0000 (09:48 -0800)]
nir: Redefine start/end_ip of blocks to fix NIR-to-TGSI liveness bugs.

With the block's end_ip accidentally being the ip of the next instruction,
contrary to the comment, you would end up doing end-of-block freeing early
and have the value missing when it came time to emit the next instruction.
Just expand the ips to have separate ones for start and end of block --
while it means that nir_instr->index is no longer incremented by 1 per
instruction, it makes sense for use in liveness because a backend is
likely to need to do other things at block boundaries (like emit the if
statement's code), and having an ip to identify that stuff is useful.

Fixes: a206b581578d ("nir: Add a block start/end ip to live instr index metadata.")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7658>

3 years agogallium/ntt: Drop reindexing of SSA defs and regs.
Eric Anholt [Fri, 13 Nov 2020 20:29:39 +0000 (12:29 -0800)]
gallium/ntt: Drop reindexing of SSA defs and regs.

It made the nir_print_shader() for NIR_TO_TGSI_DEBUG not match up with the
instructions being emitted, confusing me.  Given that I'm seeing only like
1/3 shrinking in the SSA indices, just drop the reindexing since it's not
doing much (and we don't store that much per SSA index).

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

3 years agogallium/ntt: Don't manually reindex instrs.
Eric Anholt [Fri, 13 Nov 2020 20:25:36 +0000 (12:25 -0800)]
gallium/ntt: Don't manually reindex instrs.

Getting the live SSA defs will do it if necessary, and that liveness is
what we use the instr index for.  (We used to need to do it manually, and
cleanups for merging resulted in the index being treated as metadata).

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

3 years agolavapipe: add support for VK_KHR_descriptor_update_template
Dave Airlie [Fri, 4 Dec 2020 00:25:32 +0000 (10:25 +1000)]
lavapipe: add support for VK_KHR_descriptor_update_template

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

3 years agolavapipe: add support for VK_KHR_push_descriptor
Dave Airlie [Fri, 4 Dec 2020 00:24:46 +0000 (10:24 +1000)]
lavapipe: add support for VK_KHR_push_descriptor

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

3 years agolavapipe: refactor descriptor set binding to support push later.
Dave Airlie [Fri, 4 Dec 2020 00:22:40 +0000 (10:22 +1000)]
lavapipe: refactor descriptor set binding to support push later.

This refactors the code push descriptor code so it can be reused
later for push descriptors.

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

3 years agogallium/u_threaded: fix pipe_resource leak for staging transfer
Pierre-Eric Pelloux-Prayer [Thu, 10 Dec 2020 13:35:34 +0000 (14:35 +0100)]
gallium/u_threaded: fix pipe_resource leak for staging transfer

In 2900f82e191 I mistakenly used tc_set_resource_reference in both
tc_transfer_unmap and tc_call_transfer_unmap.

This causes a leak because tc_call_transfer_unmap clears dst before
acquiring a reference, so it must only be used when initializing
tc_payloads.

This fixes the perf drop reported by Marek in MR 7098.

Fixes: 2900f82e191 ("gallium/u_threaded: fix staging and non-staging conflicts")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8035>

3 years agolima: add support for half float textures
Erico Nunes [Mon, 30 Nov 2020 00:39:26 +0000 (01:39 +0100)]
lima: add support for half float textures

Add support for the half float texel type and pixel types.
This enables the OES_texture_half_float extension.

Tested with piglit test oes_texture_float (half float and with linear
filtering) and passes all deqp half float related tests.

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

3 years agomesa: allow half float textures based on ARB_half_float_pixel
Erico Nunes [Wed, 9 Dec 2020 22:24:37 +0000 (23:24 +0100)]
mesa: allow half float textures based on ARB_half_float_pixel

In targets that support half float textures but not float textures (so
without ARB_texture_float), the previous logic did not allow for
enabling half float texture support in desktop OpenGL.
OES_texture_half_float is only valid for OpenGL ES 2.0 contexts, so
include ARB_half_float_pixel in the logic to cover OpenGL too.
Remove _mesa_is_gles3 from the check since in case of a gles3 context,
OES_texture_half_float is already assumed to be enabled.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8020>

3 years agozink: fix direct image mapping offset
Mike Blumenkrantz [Fri, 11 Dec 2020 15:53:53 +0000 (10:53 -0500)]
zink: fix direct image mapping offset

the x and y offsets here were improperly calculated without taking into account:
* layer/level offset
* x/y coord bpp

Fixes: 8d46e35d16e ("zink: introduce opengl over vulkan")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8058>

3 years agoCI: Add Windows source dependency map
Daniel Stone [Fri, 11 Dec 2020 10:41:32 +0000 (10:41 +0000)]
CI: Add Windows source dependency map

Now that we've soaked the Windows build in and it's working well,
restrict it to only running on given pipelines, albeit in a somewhat
surprising way.

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

3 years agonir: change return type to void
Christian Gmeiner [Fri, 11 Dec 2020 09:57:13 +0000 (10:57 +0100)]
nir: change return type to void

init_liveness_block(..) only gets called without using the
always true return value. Switch from bool to void.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8051>

3 years agoturnip: pCounterBufferOffsets can be NULL on vkCmd*TransformFeedbackEXT()
Samuel Iglesias Gonsálvez [Fri, 11 Dec 2020 14:53:50 +0000 (15:53 +0100)]
turnip: pCounterBufferOffsets can be NULL on vkCmd*TransformFeedbackEXT()

According to the spec for both vkCmd{Begin,End}TransformFeedbackEXT(),
if pCounterBufferOffsets is NULL, then it is assumed the offsets are
zero.

Fixes crash on dEQP-VK.transform_feedback.simple.backward_dependency_no_offset_array

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8057>

3 years agomesa: Remove silly "dummy_false" extension support
Adam Jackson [Thu, 10 Dec 2020 03:38:07 +0000 (22:38 -0500)]
mesa: Remove silly "dummy_false" extension support

This removes the memory of some old OES extensions from the table, which
seems to be harmless.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8037>