Jesse Natalie [Fri, 6 Nov 2020 16:09:30 +0000 (17:09 +0100)]
microsoft: Add CLC frontend and kernel/compute support to DXIL converter
This adds a standalone library which can convert through the pipeline of
OpenCL C -> SPIR -> SPIR-V -> NIR -> DXIL. It can add in the libclc
implementations of various library functions in the NIR phase, and
also massages the NIR to shift it more towards graphics-style compute.
This is leveraged by the out-of-tree OpenCLOn12 runtime
(https://github.com/microsoft/OpenCLOn12).
This is the combination of a lot of commits from our development branch,
containing code by several authors.
Co-authored-by: Boris Brezillon <boris.brezillon@collabora.com>
Co-authored-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jesse Natalie [Fri, 13 Nov 2020 23:08:10 +0000 (15:08 -0800)]
spirv: Allow spirv_to_nir callers to provide a float execution mode
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jesse Natalie [Thu, 12 Nov 2020 17:52:11 +0000 (09:52 -0800)]
nir_load_libclc: Mark libclc shader as internal
This allows NIR_PRINT to skip passes run on it.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Boris Brezillon [Thu, 14 May 2020 11:18:33 +0000 (13:18 +0200)]
nir: Make nir_build_deref_offset() support ptr_as_array
nir_build_deref_offset() can be extended to support calculating an
offset relative to a base pointer.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jesse Natalie [Wed, 11 Nov 2020 22:24:02 +0000 (14:24 -0800)]
vtn/opencl: Fix alignment for half vload/vstore
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jesse Natalie [Thu, 20 Aug 2020 17:20:57 +0000 (10:20 -0700)]
nir: Add nir_alu_type -> glsl_base_type conversion helper
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Boris Brezillon [Tue, 14 Apr 2020 08:56:20 +0000 (01:56 -0700)]
compiler/spirv: Handle the LocalSizeHint execution modes
It's basically the same as the LocalSize version except it fills
the local_size_hint array.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Boris Brezillon [Thu, 16 Jul 2020 13:37:41 +0000 (15:37 +0200)]
nir: Fix nextafter() for hardware that don't support denorms
We need to make sure we never return a denorm float, either by flushing
the denorm to 0 or by adjusting the minimum non-zero value.
v2 (Rhys): Use shader float controls execution mode instead of a dedicated option
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jesse Natalie [Tue, 2 Jun 2020 15:30:35 +0000 (08:30 -0700)]
panfrost/util: Move nir_undef_to_zero into core nir and add 'lower'
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jason Ekstrand [Tue, 3 Nov 2020 17:34:18 +0000 (11:34 -0600)]
nir,clover: Drop nir_lower_mem_constant_vars
We have a more generic helper now so clover doesn't need quite as many
special paths.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jason Ekstrand [Tue, 3 Nov 2020 17:33:19 +0000 (11:33 -0600)]
nir: Add a more generic helper for gathering constant initializers
The one we had was tied to nir_var_mem_constant but we also need it for
global and, one day, I can imagine us needing it for shared (though
there's currently no spec that requires it).
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Jason Ekstrand [Tue, 3 Nov 2020 17:07:07 +0000 (11:07 -0600)]
nir/lower_io: Add data OOB asserts to write_constant
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
Vinson Lee [Wed, 11 Nov 2020 22:08:48 +0000 (14:08 -0800)]
microsoft/compiler: Add scope for declaration in case statement.
This patch fixes this build error.
../src/microsoft/compiler/dxil_nir.c: In function 'extract_comps_from_vec32':
../src/microsoft/compiler/dxil_nir.c:52:10: error: a label can only be part of a statement and a declaration is not a statement
52 | unsigned dst_offs = i * comps_per32b;
| ^~~~~~~~
Fixes:
b9c61379ab4 ("microsoft/compiler: translate nir to dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7563>
Vinson Lee [Wed, 11 Nov 2020 21:27:05 +0000 (13:27 -0800)]
microsoft/compiler: Add struct glsl_type forward declaration.
This patch fixes this build error.
In file included from ../src/microsoft/compiler/dxil_enums.c:24:
../src/microsoft/compiler/dxil_enums.h:323:58: warning: 'struct glsl_type' declared inside parameter list will not be visible outside of this definition or declaration
323 | enum dxil_component_type dxil_get_comp_type(const struct glsl_type *type);
| ^~~~~~~~~
../src/microsoft/compiler/dxil_enums.h:325:71: warning: 'struct glsl_type' declared inside parameter list will not be visible outside of this definition or declaration
325 | enum dxil_prog_sig_comp_type dxil_get_prog_sig_comp_type(const struct glsl_type *type);
| ^~~~~~~~~
../src/microsoft/compiler/dxil_enums.h:327:61: warning: 'struct glsl_type' declared inside parameter list will not be visible outside of this definition or declaration
327 | enum dxil_resource_kind dxil_get_resource_kind(const struct glsl_type *type);
| ^~~~~~~~~
../src/microsoft/compiler/dxil_enums.c:31:30: error: conflicting types for 'dxil_get_prog_sig_comp_type'
31 | enum dxil_prog_sig_comp_type dxil_get_prog_sig_comp_type(const struct glsl_type *type)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/microsoft/compiler/dxil_enums.c:24:
../src/microsoft/compiler/dxil_enums.h:325:30: note: previous declaration of 'dxil_get_prog_sig_comp_type' was here
325 | enum dxil_prog_sig_comp_type dxil_get_prog_sig_comp_type(const struct glsl_type *type);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes:
b9c61379ab4 ("microsoft/compiler: translate nir to dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7562>
Vinson Lee [Wed, 11 Nov 2020 20:22:38 +0000 (12:22 -0800)]
microsoft/compiler: Add struct dxil_features forward declaration.
This patch fixes this build error.
In file included from ../src/microsoft/compiler/dxil_container.c:24:
../src/microsoft/compiler/dxil_container.h:98:42: warning: ‘struct dxil_features’ declared inside parameter list will not be visible outside of this definition or declaration
98 | const struct dxil_features *features);
| ^~~~~~~~~~~~~
../src/microsoft/compiler/dxil_container.c:72:1: error: conflicting types for ‘dxil_container_add_features’
72 | dxil_container_add_features(struct dxil_container *c,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/microsoft/compiler/dxil_container.c:24:
../src/microsoft/compiler/dxil_container.h:97:1: note: previous declaration of ‘dxil_container_add_features’ was here
97 | dxil_container_add_features(struct dxil_container *c,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes:
b9c61379ab4 ("microsoft/compiler: translate nir to dxil")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7560>
Vinson Lee [Tue, 10 Nov 2020 03:48:04 +0000 (19:48 -0800)]
nv50/ir: Initialize GCRA members in constructor.
Fix defect reported by Coverity Scan.
Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member nodes is not initialized in this
constructor nor in any functions that it calls.
uninit_member: Non-static class member nodeCount is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7522>
Marek Olšák [Mon, 2 Nov 2020 11:11:43 +0000 (06:11 -0500)]
radeonsi: handle pipe_draw_info::increment_draw_id
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Mon, 2 Nov 2020 10:53:26 +0000 (05:53 -0500)]
radeonsi: swap DrawId and StartInstance SGPR locations
We need to change both values at the same time, so they need to be next
to each other.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Mon, 2 Nov 2020 10:53:58 +0000 (05:53 -0500)]
radeonsi: don't load DrawID for indirect draws if it's unused
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 22:56:50 +0000 (17:56 -0500)]
mesa: don't FLUSH_VERTICES from primitive restart changes
It's now a draw state with no interactions with glBegin/End.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 18:43:43 +0000 (13:43 -0500)]
mesa: add primitive restart state to Driver.Draw parameters
so that display lists don't have to disable it and drivers are simpler.
This will also enable unification with Gallium.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 18:01:30 +0000 (13:01 -0500)]
mesa: index _RestartIndex with index_size_shift
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 17:55:32 +0000 (12:55 -0500)]
mesa: move primitive restart enablement determination from st/mesa to main
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 20:45:52 +0000 (15:45 -0500)]
mesa: remove constant drawID parameter from _mesa_draw_arrays
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 17:40:54 +0000 (12:40 -0500)]
mesa: clean up GLboolean types in draw.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 17:35:48 +0000 (12:35 -0500)]
mesa: clean up Driver.Draw parameter types
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Mon, 2 Nov 2020 08:26:25 +0000 (03:26 -0500)]
gallium/u_threaded: add support for multi draws
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 16:44:04 +0000 (11:44 -0500)]
gallium/u_threaded: store start/count in min/max_index for better packing
This increases the maximum number of draws per batch from 192 to 256.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 14:04:40 +0000 (09:04 -0500)]
gallium: extend draw_vbo to support multi draws
Essentially rename multi_draw to draw_vbo and remove start and count
from pipe_draw_info.
This is only an interface change. It doesn't add multi draw support
anywhere.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 15:55:43 +0000 (10:55 -0500)]
gallium: add missing bits of the direct multi draw interface
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 14:53:32 +0000 (09:53 -0500)]
gallium/u_threaded: improve draw merging by clearing pipe_draw_info fields
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 12:14:22 +0000 (07:14 -0500)]
gallium: add pipe_draw_info::index_bounds_valid
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 13:38:50 +0000 (08:38 -0500)]
gallium/u_threaded: clean up direct vs indirect draws
It's called draw_single because multi draws will use a different structure.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Tue, 3 Nov 2020 15:52:18 +0000 (10:52 -0500)]
gallium/u_threaded: lift DIV_ROUND_UP to eliminate it for constant expressions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Sun, 1 Nov 2020 11:38:32 +0000 (06:38 -0500)]
gallium: make pipe_draw_indirect_info * a draw_vbo parameter
This removes 8 bytes from pipe_draw_info (think u_threaded_context)
and a lot of info->indirect pointer indirections.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Fri, 30 Oct 2020 13:53:50 +0000 (09:53 -0400)]
gallium: move count_from_stream_output into pipe_draw_indirect_info
This removes some overhead from tc_draw_vbo and increases the maximum number
of draws per batch from 153 to 192 in u_threaded_context.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Marek Olšák [Fri, 30 Oct 2020 13:50:50 +0000 (09:50 -0400)]
mesa: add Driver.DrawTransformFeedback
to remove some overhead from Driver.Draw.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
Alejandro Piñeiro [Fri, 13 Nov 2020 10:20:08 +0000 (11:20 +0100)]
turnip: minor tu_queue fixes related to vk_base_object
Include:
* Missing call to tu_queue_finish
* Use the proper free method for device->queues
Fixes
5d3fdbc52bf8bee6f0acfd55c87b8d280908b559
Tested-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7663>
Eric Anholt [Tue, 17 Nov 2020 21:19:36 +0000 (13:19 -0800)]
turnip: Assert about the storage buffer offset alignment.
Giving us an unaligned pointer is invalid, and this helps switch a CTS bug
from being a flake to a consistent crash.
https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/2661
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7662>
Michel Zou [Mon, 16 Nov 2020 19:07:06 +0000 (20:07 +0100)]
libgl-gdi: add zink support
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Closes #3802
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7643>
Michel Zou [Tue, 17 Nov 2020 08:29:54 +0000 (09:29 +0100)]
zink: fix unused variable warning
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7643>
Alejandro Piñeiro [Thu, 12 Nov 2020 15:35:31 +0000 (16:35 +0100)]
v3dv: implement VK_EXT_private_data
Which is using base class's implementation.
Based on Hyunjun's commit
d941c6b74fefa97d2d4a1c522170312946d964ca
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7627>
Alejandro Piñeiro [Thu, 12 Nov 2020 15:30:41 +0000 (16:30 +0100)]
v3dv: use the common base object type and struct
Used as reference Hyujun's commit
5d3fdbc52bf8bee6f0acfd55c87b8d280908b559, that does the same for
turnip.
This commit also replaces in several cases alloc for zalloc, and adds
checks on more Destroy methods if the object to be free is NULL or
not. Most of them were needed to avoid crashes/weird behaviour due
trying to use un-initialized data. Note that now that vk_object_free
iterates over a array, making it more against un-initialized or just
NULL data.
Additionally, using zalloc we can also remove some memset to 0. In
fact we needed to remove them, as if not, they would override the
vk_object_base object to 0 (the alternative would me doing a memset
computing a pointer offset, but that's is not needed as we can just
use zalloc).
v2:
* Call memset(0) on reused descriptor sets when calling
ResetDescriptorPool, not when reallocating them (Iago)
* Add null check when calling DestroyImageView (detected by a full CTS run)
v3: Fixed rebase conflicts after last meta copy/clear changes
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7627>
Marek Olšák [Wed, 11 Nov 2020 16:41:49 +0000 (11:41 -0500)]
radeonsi: add an option to enable 2x2 coarse shading for non-GUI elements
This is for experiments with VRS.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7646>
Marek Olšák [Wed, 11 Nov 2020 17:08:35 +0000 (12:08 -0500)]
amd: add register enums for VRS
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7646>
Andres Gomez [Mon, 16 Nov 2020 21:56:05 +0000 (23:56 +0200)]
ci: update some radv trace checksums
After
16c756e55d5 ("spirv: reverse order in matrix multiplication")
some checksums for the radv driver remained to be updated.
v2:
- Correct typo (Mihai).
Signed-off-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7645>
Andres Gomez [Mon, 16 Nov 2020 21:12:57 +0000 (23:12 +0200)]
ci: update some radv trace checksums
After
24a18b1a4b9 ("nir: scalarize fdot in reverse") some checksums
for the radv driver remained to be updated.
v2:
- Correct typo (Mihai).
Signed-off-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Peres <martin.peres@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7645>
Michel Zou [Sat, 31 Oct 2020 12:18:30 +0000 (13:18 +0100)]
util: fix -Wshift-count-overflow warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7392>
Tony Wasserka [Mon, 16 Nov 2020 10:07:09 +0000 (11:07 +0100)]
meson: Treat LLVM headers as a system dependency
This will suppress warnings from LLVM includes.
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Dylan Baker <dylan@pnbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7632>
Leo Liu [Sun, 25 Oct 2020 00:00:18 +0000 (20:00 -0400)]
frontends/omx/av1: enable AV1 OMX Bellagio support
By adding name, role and profile to OMX decoder
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sat, 24 Oct 2020 23:54:46 +0000 (19:54 -0400)]
frontends/omx/av1: add AV1 tasks management
This handles different task queues based on OMX bellagio
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 18 Oct 2020 15:09:12 +0000 (11:09 -0400)]
frontends/omx/av1: add AV1 OBU header parsers
Based on AV1 spec: https://aomediacodec.github.io/av1-spec
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 18 Oct 2020 14:45:05 +0000 (10:45 -0400)]
frontends/omx/bellagio: add AV1 initial support to omx dec
Also add bitstream base parser based on AV1 spec
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 4 Oct 2020 19:02:40 +0000 (15:02 -0400)]
radeonsi: cap AV1 support to SIENNA CICHLID
since AV1 is avaiable from VCN3
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 4 Oct 2020 19:01:37 +0000 (15:01 -0400)]
radeonsi: cap AV1 codec configuration
This defines the support size to 8K and no interlaced buffer
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 4 Oct 2020 18:54:55 +0000 (14:54 -0400)]
radeon/vcn: fill up the probs buffer
with the segmetation data and mask
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Wed, 11 Nov 2020 02:01:15 +0000 (21:01 -0500)]
radeon/vcn: get AV1 message buffer
This passes parameters to firmware based on interface by frames.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Wed, 11 Nov 2020 01:59:16 +0000 (20:59 -0500)]
radeon/vcn: fill up the context buffer
with the mode tables, mv probs tables, and coef probs tables
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Wed, 11 Nov 2020 01:58:09 +0000 (20:58 -0500)]
radeon/vcn: add AV1 context buffer
The context buffer will be filled up with the tables, and used
by firmware for decode
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 4 Oct 2020 17:12:24 +0000 (13:12 -0400)]
radeon/vcn: add AV1 default tables for the context
These tables will be used by firmware
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Wed, 11 Nov 2020 01:56:47 +0000 (20:56 -0500)]
radeon/vcn: add AV1 dpb buffer size
Just use the default size for now
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sun, 4 Oct 2020 16:58:07 +0000 (12:58 -0400)]
radeon/vcn: add AV1 support to the decoder
This adds AV1 stream type to the AV1 decoder
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Wed, 11 Nov 2020 01:55:06 +0000 (20:55 -0500)]
radeon/vcn: add AV1 codec driver firmware interfaces
This collects parameters that firmware and hardware require for
the AV1 codec.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Leo Liu [Sat, 12 Sep 2020 14:50:08 +0000 (10:50 -0400)]
vl: add AV1 codec picture support
This adds AV1 video profile, format and picture description to vl.
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7596>
Chad Versace [Tue, 22 Sep 2020 18:23:13 +0000 (11:23 -0700)]
anv/image: Define anv_image_get_aux_addr (v3)
Simple refactor. No intended change in behavior.
Replace each derivation of aux address with anv_image_get_aux_addr().
The function will soon do more in support of
VK_EXT_image_drm_format_modifier, where the image bo and aux bo may be
disjoint.
v2:
- Replace param 'aspect' with 'plane'.
v3:
- Workaround for stencil ccs. If no aux surface, then return
ANV_NULL_ADDRESS.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v3)
Chad Versace [Sun, 9 Aug 2020 21:29:54 +0000 (14:29 -0700)]
anv/image: Check surface offsets after adding each surface
Pre-patch, we checked the offsets once per aspect after adding all
surfaces for the aspect. The additional checks will make it easier to
diagnose layout bugs.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sun, 9 Aug 2020 21:21:15 +0000 (14:21 -0700)]
anv/image: Rewrite check_surfaces() [v2]
Pure refactor. No intended change in behavior.
This makes the code infinitely easier to understand. And it uncovers
a potential bug (marked with XXX comment).
v2: Fix narrowing conversions on 32-bit arch. s/size_t/uintmax_t/.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
Chad Versace [Sun, 9 Aug 2020 20:46:34 +0000 (13:46 -0700)]
anv/image: Further split add_*_surface funcs (v2)
Months ago, make_surface() added *all* surfaces required for the given
aspect. It was a monster monolithic function, and difficult to reason
about its correctness. In commit
c652ff8c (2020-03-06), I split the code
for aux surfaces into its own function, add_aux_surface_if_supported().
This patch continues the splitting, therefore making bugs easier to
identify.
Code changes:
- Move the code that adds the shadow surface from make_surface() to
a new function add_shadow_surface(), called from
add_all_surfaces().
- Move the call to add_aux_surface_if_supported() from make_surface()
to add_all_surfaces().
- To preserve correctness of the assertions on image layout in
make_surface(), move them to the loop in add_all_surfaces() after
all the aspect's surfaces have been added.
- Rename make_surface() to add_primary_surface() because now that's
what it does.
Pure refactor, no intended change in behavior.
v2:
- Rebase onto "anv: Fix isl_surf_usage_flags for stencil images".
- Sanitize the image's extent earlier.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
Chad Versace [Sun, 9 Aug 2020 20:01:24 +0000 (13:01 -0700)]
anv/image: Define add_all_surfaces()
This deduplicates the loops in anv_image_create() and
resolve_ahw_image().
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sun, 9 Aug 2020 19:53:47 +0000 (12:53 -0700)]
anv/image: Add more asserts to choose_isl_tiling_flags
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sun, 9 Aug 2020 00:39:24 +0000 (17:39 -0700)]
anv/image: Move some DRM code in anv_get_image_format_properties()
In anv_get_image_format_properties(), the special-case code for
VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT is tiny. It is mostly a detached
'case' in the 'switch' block for VkImageType. So move the special-case
code to immediately follow the 'switch' block.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sun, 9 Aug 2020 00:33:49 +0000 (19:33 -0500)]
anv/image: Emit error message for non-2D DRM images
In vkGetPhysicalDeviceImageFormatProperties.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sun, 9 Aug 2020 00:29:47 +0000 (19:29 -0500)]
anv/image: Drop redundant rejection of YCbCr formats with modifiers
The check in anv_get_image_format_properties() is already handled in
anv_get_image_format_features().
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sun, 9 Aug 2020 00:11:33 +0000 (19:11 -0500)]
anv/image: Respect VkImageFormatListCreateInfo for VkImageFormatProperties (v2)
When filling VkImageFormatProperties, anv_get_image_format_properties()
checks the requested VkImageUsageFlags and VkImageCreateFlags against
the VkFormatFeatureFlags available to the queried VkFormat. However, we
neglected to consider if any formats given in
VkImageFormatListCreateInfo
further restricted the available VkFormatFeatureFlags.
The image view formats are more likely to introduce additional
restrictions when DRM format modifiers are present.
v2:
- Do not drop anv_formats_ccs_e_compatible().
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
Chad Versace [Sat, 8 Aug 2020 23:45:48 +0000 (18:45 -0500)]
anv/image: Fail earlier in anv_get_image_format_properties
If anv_get_image_format_features reports that the inputs are
unsupported, fail immediately.
Without the early fail, I have less confidence in the function's
correctness when a DRM format modifier is present.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sat, 8 Aug 2020 23:42:22 +0000 (18:42 -0500)]
anv/image: Minor refactor of VkImageFormatProperties::sampleCounts
The code in anv_get_image_format_properties() that set sampleCounts
appears correct, but weirdly inconsistent. Clean the code to
consistently set sampleCounts in the same location as
maxExtent/maxMipLevels/maxArraySize.
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Wed, 5 Aug 2020 18:09:32 +0000 (11:09 -0700)]
anv/image: Rename get_wsi_format_modifier_properties_list()
Rename it to get_drm_format_modifier_properties_list() because it is now
independent of WSI.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Sat, 8 Aug 2020 19:59:21 +0000 (12:59 -0700)]
anv/image: Fix VkExternalMemoryProperties for images (v5)
In vkGetPhysicalDeviceImageFormatProperties2, we advertised support for
VK_IMAGE_TILING_LINEAR and VK_IMAGE_TILING_OPTIMAL for all memory
handles.
However, when importing or exporting an image, there must exist a method
that enables the app and driver to agree on the image's memory layout.
If no method exists, then we should reject image creation.
v2:
- Reduce copy-paste for Lionel.
v3:
- Treat tiling LINEAR and DRM_FORMAT_MODIFIER as identical when
determing compatible memory handles.
- Improve comments.
v4:
- Remove DMA_BUF from opaque_fd_only_props.
v5:
- Minor changes to code style for `if`. (for jekstrand)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v4)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v4)
Chad Versace [Wed, 5 Aug 2020 18:11:50 +0000 (11:11 -0700)]
anv/image: Delete the list of modifier-compatible formats
The code asserted that we supported no more than 4 formats with
modifiers: /VK_FORMAT_B8G8R8(A8)?_(SRGB|UNORM)/.
Strangely, 2 of the 4 were non-power-of-two formats, which were rejected
elsewhere.
The assertion's comment suggested that we use a hard-coded list of
formats because the driver was not yet able to determine if a given
format was compatible with a given modifier. Therefore, the list only
contained formats that were compatible with *all* modifiers. That code
deficiency no longer exists: anv_get_image_format_features() can check
format/modifier compatibility.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Wed, 5 Aug 2020 17:23:05 +0000 (10:23 -0700)]
anv/image: Refactor iteration over modifiers
Refactor in get_wsi_format_modifier_properties_list().
Instead of iterating over a function-local hard-coded list, iterate over
all modifiers in isl_drm.c.
This will improve agreement in behavior between
VkDrmFormatModifierPropertiesListEXT
VkPhysicalDeviceImageDrmFormatModifierInfoEXT.
The future disagreement this patch attempts to prevent is the
combination of:
a. VkDrmFormatModifierPropertiesListEXT neglects to return a valid
modifier because its hard-coded list of modifiers drifts
out-of-sync with hard-coded lists elsewhere in the code. (Already
today, the list in get_wsi_format_modifier_properties_list() does
not match the list in isl_drm.c; though, this has produced no bug
yet).
b. vkGetPhysicalDeviceImageFormatProperties2 accepts, via
VkPhysicalDeviceImageDrmFormatModifierInfoEXT, the modifier
overlooked in (a), because it does not use the same hard-coded
list in get_wsi_format_modifier_properties_list(). (Recall that
the spec requires vkGetPhysicalDeviceImageFormatProperties2 to
correctly accept/reject any int that the app provides, even when
the int is an invalid modifier).
c. The Bug. The driver told the app in (b) that it can legally
create an image with format+modifier, but the app cannot query
the VkFormatFeatureFlags of the format+modifier due to (a).
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Wed, 5 Aug 2020 16:23:39 +0000 (09:23 -0700)]
isl: Make public the list of modifiers
This allows Vulkan and GL to iterate over the full list of modifiers
instead of hard-coding in various places the "same" list as isl.
(Anvil's list has already diverged from isl's list. It omits Gen12
modifiers).
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Wed, 5 Aug 2020 17:16:19 +0000 (10:16 -0700)]
anv/image: Fill drmFormatModifierTilingFeatures (v2)
Fill VkDrmFormatModifierPropertiesEXT::drmFormatModifierTilingFeatures
with anv_get_image_format_features().
anv_formats.c:get_wsi_format_modifier_properties_list() incorrectly left
it uninitialized.
v2: Increment drmFormatModifierPlaneCount if modifier support aux.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v2)
Chad Versace [Mon, 3 Aug 2020 17:02:40 +0000 (10:02 -0700)]
anv/image: Teach anv_get_image_format_features() about modifiers (v3)
Because anv_get_image_format_features() now understands modifiers, also
relocate most of the modifier compatibility checks from
anv_get_format_plane() into anv_get_image_format_features() in order to
avoid duplication.
The new signature forces some code movement in
anv_get_image_format_properties().
v2:
- Reject VK_FORMAT_B4G4R4A4_UNORM_PACK16 with modifiers on HSW.
v3:
- Revert the v2 change.
- Query isl_format_layout instead of pipe_format. (for jekstrand)
- Drop misguided comments. (for jekstrand)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v3)
Chad Versace [Fri, 16 Oct 2020 18:09:09 +0000 (11:09 -0700)]
isl: Add isl_format_layout::uniform_channel_type
If each format channel has the same base type (such unorm), then that
is the format's "uniform channel type".
Calculating the field at buildtime is probably better than looping over
all channels at runtime each time we wish to query it.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Wed, 5 Aug 2020 15:57:13 +0000 (08:57 -0700)]
anv/image: Use isl_drm_modifier_get_score()
It replaces anv_drm_format_mod_score().
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Tue, 25 Aug 2020 17:35:24 +0000 (10:35 -0700)]
isl: Define isl_drm_modifier_get_score() [v3]
Return the modifier's score, which indicates the driver's preference for the
modifier relative to others. A higher score is better. Zero means
unsupported.
Intended to assist selection of a modifier from an externally provided list,
such as VkImageDrmFormatModifierListCreateInfoEXT.
v2:
- Rename anv_drm_format_mod_score to isl_drm_modifier_get_score.
- Squash all incremental changes to anv_drm_format_mod_score.
v3:
- Drop redundant 'unlikely'. (for nchery)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v3)
Chad Versace [Tue, 8 Sep 2020 16:44:43 +0000 (09:44 -0700)]
anv/image: Fix isl_surf_usage_flags for stencil images
Respect VkImageStencilUsageCreateInfoEXT.
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Chad Versace [Tue, 4 Aug 2020 17:14:11 +0000 (10:14 -0700)]
anv/image: Check DISJOINT in vkGetPhysicalDeviceImageFormatProperties2 (v2)
The code did not return error when VK_IMAGE_CREATE_DISJOINT_BIT was
incompatible with the other input params.
If the Vulkan spec forbids a set of input params for vkCreateImage,
but permits them for vkGetPhysicalDeviceImageFormatProperties2,
then vkGetPhysicalDeviceImageFormatProperties2 must reject those input
params with failure.
- v2: Clearer commit message.
CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v2)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Erik Faye-Lund [Fri, 13 Nov 2020 15:53:04 +0000 (16:53 +0100)]
zink: more accurately track supported blits
We don't care if blits need to respect render-conditions if there's no
active one. So let's hit the potentially faster native blit-paths
instead.
Fixes:
5743fa6e709 ("zink: enable conditional rendering if available")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3792
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7606>
Erik Faye-Lund [Tue, 17 Nov 2020 10:11:59 +0000 (11:11 +0100)]
zink: always insert barriers for general-layout
We need to always have barriers between individual uses of resources
in the general-layout, because otherwise a write-cache might not be
flushed before the resource is used.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7652>
Erik Faye-Lund [Tue, 17 Nov 2020 10:11:38 +0000 (11:11 +0100)]
zink: mark general layout as transfer-read/write
The general layout can be used for transfers, so we need to make sure
the vulkan driver knows. This will help the driver know when it needs to
flush caches.
While we're at it, also add shader-read, which is another access we use.
We should stop using that one ASAP, but for now this seems like the
right thing to do.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7652>
Iago Toral Quiroga [Tue, 17 Nov 2020 11:10:59 +0000 (12:10 +0100)]
v3dv: rename playout and dslayout fields to use underscores.
Following a suggestion from Alejandro, since playout is a word on its own
and can be confusing. It also makes it more consistent with other
variable names that use an underscore.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7651>
Iago Toral Quiroga [Tue, 17 Nov 2020 08:22:20 +0000 (09:22 +0100)]
v3dv: blit shader clean-ups
This avoids redundant per-layer operations that are the same across
layers or that only need to do once. Namely:
- The sampler for the blit source is the same for all layers.
- The decision about whether we need to load TLB contents or not only
needs to be done once.
- Some command buffer state such as the pipeline, the viewport and the
scissor is the same for all layers and should only be bound once.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7651>
Iago Toral Quiroga [Tue, 17 Nov 2020 08:09:06 +0000 (09:09 +0100)]
v3dv: initialize pipeline layouts for meta operations at driver initialization
This removes the need to lock just to check if we have created them
due to the lazy allocation strategy we had in place.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7651>
Iago Toral Quiroga [Thu, 12 Nov 2020 09:43:54 +0000 (10:43 +0100)]
v3dv: add a buffer to image copy path using a texel buffer
This is much faster than the blit fallback (which requires to upload
the linear buffer to a tiled image) and the CPU path.
A simple stress test involving 100 buffer to image copies of a
single layer image with 10 mipmap levels provides the following
results:
Path | Recording Time | Execution Time |
-------------------------------------------------|
Texel Buffer | 2.954s | 0.137s |
-------------------------------------------------|
Blit | 10.732s | 0.148s |
-------------------------------------------------|
CPU | 0.002s | 1.453s |
-------------------------------------------------|
So generally speaking, this texel buffer copy path is the fastest
of the paths that can do partial copies, however, the CPU path might
provide better results in cases where command buffer recording is
important to overall performance. This is probably the reason why
the CPU path seems to provide slightly better results for vkQuake2.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7651>
Iago Toral Quiroga [Fri, 13 Nov 2020 08:17:53 +0000 (09:17 +0100)]
v3dv: fix width for buffer view texture state
This is in units of texels, not bytes.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7651>
Samuel Pitoiset [Wed, 11 Nov 2020 08:24:06 +0000 (09:24 +0100)]
radv: don't subtract max_verts_per_prim from hw_max_esverts on gfx10.3
Ported from RadeonSI.
GFX10.3 does it properly.
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/7566>
Samuel Pitoiset [Wed, 11 Nov 2020 08:20:52 +0000 (09:20 +0100)]
radv: don't count unusable vertices to the NGG LDS size
Ported from RadeonSI.
To get optimal LDS usage since the previous change.
Cc: 20.2
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/7566>
Samuel Pitoiset [Wed, 11 Nov 2020 08:17:32 +0000 (09:17 +0100)]
radv: fix applying the NGG minimum vertex count requirement
Ported from RadeonSI.
The restriction was applied too late.
Cc: 20.2
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/7566>
Samuel Pitoiset [Wed, 11 Nov 2020 08:02:31 +0000 (09:02 +0100)]
radv: do VGT_FLUSH when switching NGG -> legacy on Sienna Cichlid
Ported from RadeonSI.
Cc: 20.2
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/7566>