Samuel Pitoiset [Fri, 10 Feb 2023 10:32:07 +0000 (11:32 +0100)]
radv: use last_vgt_api_stage for determining the last stage with XFB
It's shorter and cleaner.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
Mike Blumenkrantz [Thu, 9 Feb 2023 22:20:54 +0000 (17:20 -0500)]
zink: add a local is_compute var for set_shader_images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Mike Blumenkrantz [Thu, 9 Feb 2023 22:20:06 +0000 (17:20 -0500)]
zink: pull out image descriptor updating in set_shader_images
no functional changes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Mike Blumenkrantz [Thu, 9 Feb 2023 22:15:50 +0000 (17:15 -0500)]
zink: rework set_shader_images() hook
this makes the code more methodical, readable, and correct, fixing a
number of issues along the way:
* inaccurate write_bind_count incrementing
* inaccurate barrier_access write unsetting
* inefficient partial rebinds
* leaking texel buffers
also add some comments to make this clearer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Mike Blumenkrantz [Thu, 9 Feb 2023 21:10:56 +0000 (16:10 -0500)]
zink: unref image buffer descriptors on unbind
Fixes:
7ab5c5d36d2 ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Mike Blumenkrantz [Thu, 9 Feb 2023 20:59:04 +0000 (15:59 -0500)]
zink: remove stale comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Mike Blumenkrantz [Thu, 9 Feb 2023 20:53:32 +0000 (15:53 -0500)]
zink: unset gfx shader read when unbinding shader images
this otherwise will never be unset
Fixes:
50e764fa50d ("zink: track gfx/compute descriptor barrier info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Mike Blumenkrantz [Thu, 9 Feb 2023 20:20:27 +0000 (15:20 -0500)]
zink: rename some variables in zink_set_shader_images()
this is more consistent with set_sampler_views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
Samuel Pitoiset [Fri, 10 Feb 2023 17:08:53 +0000 (18:08 +0100)]
radv: fix importing retained NIR shaders when a lib uses the RETAIN bit
Fixes couple of GPL regressions with VKCTS, I thought this was test
bugs but it's valid behaviour as long as the libary uses
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21245>
Alyssa Rosenzweig [Fri, 10 Feb 2023 00:18:43 +0000 (19:18 -0500)]
radv: Use common Get*OpaqueCaptureDescriptorDataEXT
Now stubbed by the Vulkan runtime for you, deduplicate.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>
Alyssa Rosenzweig [Fri, 10 Feb 2023 00:16:22 +0000 (19:16 -0500)]
tu,vulkan: Add common Get*OpaqueCaptureDescriptorDataEXT
In both tu and radv, these are all trivial. Move the trivial implementation from
tu to common code to deduplicate the boilerplate.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>
Tapani Pälli [Fri, 10 Feb 2023 08:02:29 +0000 (10:02 +0200)]
iris: handle error in iris_resource_from_handle
In similar manner as
fdab8fef7aff we might fail creating resource,
let application handle the error. Application may have given wrong
input pitch when importing dmabuf.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8248
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21233>
Kai Wasserbäch [Sat, 11 Feb 2023 17:12:01 +0000 (18:12 +0100)]
fix(FTBFS): clover: fix LLVM #include of Triple.h, moved to TargetParser
Upstream moved Triple.h from ADT to TargetParser in LLVM 17.
Reference: https://github.com/llvm/llvm-project/commit/
62c7f035b4392c1933550eead6ddab35122720bc
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>
Kai Wasserbäch [Sat, 11 Feb 2023 17:10:08 +0000 (18:10 +0100)]
fix(FTBFS): gallivm: fix LLVM #include of Triple.h, moved to TargetParser
Upstream moved Triple.h from ADT to TargetParser in LLVM 17.
Reference: https://github.com/llvm/llvm-project/commit/
62c7f035b4392c1933550eead6ddab35122720bc
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>
Eric Engestrom [Thu, 15 Dec 2022 14:54:51 +0000 (14:54 +0000)]
u_pipe_screen_lookup_or_create: avoid re-querying the fd to have a consistent hash key
In every current driver, the fd we get back from the screen is the fd we
gave to screen_create() three lines above (or a dup() thereof, which we
consider to be the same since we look inside it for the file description
instead).
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Wed, 14 Dec 2022 22:20:57 +0000 (22:20 +0000)]
asahi: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Tue, 13 Dec 2022 15:49:57 +0000 (15:49 +0000)]
panfrost: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Thu, 8 Dec 2022 17:40:27 +0000 (17:40 +0000)]
vc4: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Thu, 1 Dec 2022 13:48:17 +0000 (13:48 +0000)]
v3d: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Tue, 13 Dec 2022 21:02:22 +0000 (21:02 +0000)]
lima: replace custom code with u_pipe_screen_lookup_or_create()
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Tue, 13 Dec 2022 20:52:22 +0000 (20:52 +0000)]
freedreno: replace custom code with u_pipe_screen_lookup_or_create()
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Fri, 9 Dec 2022 20:52:15 +0000 (20:52 +0000)]
gallium: move etnaviv screen_lookup_or_create function to common code
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Fri, 9 Dec 2022 20:52:15 +0000 (20:52 +0000)]
etnaviv: use simple_mtx to avoid breaking windows in the next commit
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Wed, 1 Feb 2023 17:58:02 +0000 (17:58 +0000)]
util: avoid calling kcmp on Android
On some combinations of Android version and kernel version, calling kcmp
results in seccomp killing the process.
As there doesn't seem to be a way to query for that in advance, skip
this check altogether on Android.
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Eric Engestrom [Mon, 12 Dec 2022 21:27:06 +0000 (21:27 +0000)]
gallium/u_screen.h: add missing stdint.h include
For uint64_t.
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
Hans-Kristian Arntzen [Sun, 12 Feb 2023 15:20:26 +0000 (16:20 +0100)]
radv: Implement VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 46e0c77 ("radv: implement VK_EXT_descriptor_buffer")
Co-authored-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
Hans-Kristian Arntzen [Sun, 12 Feb 2023 15:02:26 +0000 (16:02 +0100)]
radv: Fix missing VK_ACCESS_2_SHADER_SAMPLED_READ_BIT.
Cannot be used for SSBO, so ignore SCACHE invalidation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes:
8df17163c78 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
Hans-Kristian Arntzen [Sun, 12 Feb 2023 14:40:31 +0000 (15:40 +0100)]
radv: Fix invalid 64-bit shift.
For sync2 bits, overflow can happen.
Use BITFIELD64_BIT to align with ANV.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes:
8df17163c78 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
Michel Dänzer [Wed, 8 Feb 2023 16:36:35 +0000 (17:36 +0100)]
glsl/standalone: Do not pass memory allocated with ralloc_size to free
Pointed out by GCC:
In function ‘load_text_file’,
inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/compiler/glsl/standalone.cpp:358:17: error: ‘free’ called on pointer ‘block_195’ with nonzero offset 48 [-Werror=free-nonheap-object]
358 | free(text);
| ^
In function ‘ralloc_size’,
inlined from ‘load_text_file’ at ../src/compiler/glsl/standalone.cpp:352:31,
inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/util/ralloc.c:117:18: note: returned from ‘malloc’
117 | void *block = malloc(align64(size + sizeof(ralloc_header),
| ^
Fixes:
a9696e79fb3a ("main: Close memory leak of shader string from load_text_file.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
Michel Dänzer [Wed, 8 Feb 2023 15:48:43 +0000 (16:48 +0100)]
glsl/standalone: Fix up _mesa_reference_shader_program_data signature
Drop the unused ctx parameter, to match the main Mesa code.
Fixes ODR violation flagged by -Wodr with LTO enabled:
../src/mesa/main/shaderobj.h:74:1: error: ‘_mesa_reference_shader_program_data’ violates the C++ One Definition Rule [-Werror=odr]
74 | _mesa_reference_shader_program_data(struct gl_shader_program_data **ptr,
| ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: type mismatch in parameter 1
76 | _mesa_reference_shader_program_data(struct gl_context *ctx,
| ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: ‘_mesa_reference_shader_program_data’ was previously declared here
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
Fixes:
717a720e9c95 ("mesa: drop unused context parameter to shader program data reference.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
Rob Clark [Tue, 7 Feb 2023 17:17:00 +0000 (09:17 -0800)]
freedreno: Avoid screen lock when no rsc tracking needed
In case there is no dirty state that requires resource tracking we
can skip taking the screen lock. Indirect draw and index buffer are
a special case, but we can inexpensively check if they are already
referenced by the batch.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
Rob Clark [Tue, 7 Feb 2023 17:07:28 +0000 (09:07 -0800)]
freedreno: Add FD_DIRTY_QUERY
Replace update_active_queries, which was really just a dirty-bit in
disguise. This also lets us associate it with FD_DIRTY_RESOURCE so
we can skip the associated resource tracking when it isn't dirty.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
Rob Clark [Tue, 7 Feb 2023 16:48:50 +0000 (08:48 -0800)]
freedreno: Remove impossible NULL check
All gens implement query support now.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
Rob Clark [Sun, 5 Feb 2023 19:34:37 +0000 (11:34 -0800)]
freedreno: Move num_vertices calc to backend
Only used by a2xx and a3xx backends, so move it there.
Also make it more clear that fd6_emit::draw is only used in the
driver-params case.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
Rob Clark [Sun, 5 Feb 2023 19:15:14 +0000 (11:15 -0800)]
freedreno/a6xx: Move num_driver_params to program state
No need to re-calculate this at draw time.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
Bas Nieuwenhuizen [Tue, 10 Jan 2023 15:12:34 +0000 (16:12 +0100)]
nir: Apply a maximum stack depth to avoid stack overflows.
A stackless (or at least using allocated memory for stack) version
might be nice but for now this works around some games compiling
large shaders and hitting stack overflows.
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21231>
Jesse Natalie [Fri, 27 Jan 2023 21:15:46 +0000 (13:15 -0800)]
dzn: Enable 16bit types when supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Fri, 27 Jan 2023 21:15:11 +0000 (13:15 -0800)]
dzn: Get options4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Fri, 27 Jan 2023 21:06:39 +0000 (13:06 -0800)]
dzn: Delete unused extensions table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Fri, 27 Jan 2023 21:05:53 +0000 (13:05 -0800)]
dzn: Enable get_surface_capabilities2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 19:12:15 +0000 (11:12 -0800)]
spirv2dxil: Support 16bit types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 18:52:57 +0000 (10:52 -0800)]
spirv2dxil: Move shader model into runtime conf struct
We'll want to use it to control the shape of the nir that we generate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 23:17:16 +0000 (15:17 -0800)]
spirv2dxil: Lower unaligned loads and stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 19:03:52 +0000 (11:03 -0800)]
spirv2dxil: Set min UBO/SSBO alignments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 18:58:18 +0000 (10:58 -0800)]
microsoft/compiler: Support lowering SSBO accesses to 16bit vectors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 18:57:30 +0000 (10:57 -0800)]
microsoft/compiler: Support raw buffer load/store intrinsics with 16bit alignment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 17:06:55 +0000 (09:06 -0800)]
microsoft/compiler: Handle 48-bit stores to SSBO/shared
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 00:29:06 +0000 (16:29 -0800)]
microsoft/compiler: Pass an alignment to constant buffer load lowering
This means we can stop doing conditionals and shifts if we know the
alignment of a load for a small amount of data.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 00:26:58 +0000 (16:26 -0800)]
microsoft/compiler: Simplify bitpacking for load/store lowering with nir_extract_bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 00:40:30 +0000 (16:40 -0800)]
microsoft/compiler: Pass deref modes to unaligned pass and handle push const
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 22:08:45 +0000 (14:08 -0800)]
microsoft/compiler: Move unaligned load/store pass from CL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 19:11:58 +0000 (11:11 -0800)]
microsoft/compiler: Handle undef-rounding f2f16 as rtz
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 19:11:39 +0000 (11:11 -0800)]
microsoft/compiler: Ensure native_low_precision is set for 16-bit bitcasts/stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 19:11:04 +0000 (11:11 -0800)]
microsoft/compiler: Handle frcp for float16/float64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 19:10:34 +0000 (11:10 -0800)]
microsoft/compiler: Handle struct consts in DXIL module dumper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Mon, 30 Jan 2023 19:10:03 +0000 (11:10 -0800)]
nir_lower_fp16_casts: Allow opting out of lowering certain rounding modes
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Wed, 1 Feb 2023 00:20:31 +0000 (16:20 -0800)]
nir: Add alignment to load_push_constant
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
Jesse Natalie [Tue, 7 Feb 2023 17:21:07 +0000 (09:21 -0800)]
ci/windows: Update LLVM to 15
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
Jesse Natalie [Tue, 7 Feb 2023 19:17:03 +0000 (11:17 -0800)]
microsoft/clc: Set features that are used by CL tests
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
Jesse Natalie [Tue, 7 Feb 2023 19:16:11 +0000 (11:16 -0800)]
clc: Include opencl-c-base.h with LLVM 15 (using builtins)
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
Jonathan Marek [Fri, 10 Feb 2023 22:08:43 +0000 (17:08 -0500)]
turnip: fix use of align() instead of util_align_npot() with tile_align_w
tile_align_w isn't always a power of two.
Fixes:
aae679e22137
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21251>
Karol Herbst [Fri, 10 Feb 2023 16:01:37 +0000 (17:01 +0100)]
rusticl/icd: Make it work in case Rustc shuffles struct around
Nothing guarentees fields are in order or anything like that. So do proper offset math
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21242>
Karol Herbst [Fri, 10 Feb 2023 16:00:24 +0000 (17:00 +0100)]
rusticl/util: extract offset_of macro
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21242>
Faith Ekstrand [Fri, 10 Feb 2023 22:21:19 +0000 (16:21 -0600)]
nir/deref: Preserve alignments in opt_remove_cast_cast()
This also removes the loop so opt_remove_cast_cast() will only optimize
cast(cast(x)) and not cast(cast(cast(x))). However, since nir_opt_deref
walks instructions top-down, there will almost never be a tripple cast
because the parent cast will have opt_remove_cast_cast() run on it.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21252>
Sviatoslav Peleshko [Thu, 9 Feb 2023 15:56:32 +0000 (17:56 +0200)]
anv: Handle VkAccelerationStructureBuildRangeInfoKHR::transformOffset
Previously it was not actually handled. This meant that all geometries
with the same transform buffer were using the same (first) transformation
matrix.
Fixes:
f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7575
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21227>
Marcin Ślusarz [Wed, 25 Jan 2023 14:06:23 +0000 (15:06 +0100)]
intel/compiler/mesh: use U888X packed index format
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20910>
Danylo Piliaiev [Tue, 7 Feb 2023 15:52:53 +0000 (16:52 +0100)]
turnip: Disable draw states after dyn renderpass in all cases
Draw states were not disabled after a dynamic renderpass which
spans several command buffers, the next renderpass if started in
the same command buffer wouldn't emit the full draw state,
since TU_CMD_DIRTY_DRAW_STATE was not set by previous renderpass.
The issue could be observed when corrupting all regs at cmdbuf start in:
dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed7_geometry
Fixes:
cb0f414b2aed88f48b2593dad833844be2f5f42b
("tu: Add support for suspending and resuming renderpasses")
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
Danylo Piliaiev [Mon, 6 Feb 2023 19:38:41 +0000 (20:38 +0100)]
turnip: Ensure that there is no renderpass rotation in binning
It appears that A6XX_GRAS_SC_CNTL::rotation applies to the binning,
so we should ensure there is no unexpected rotations and apply with
A6XX_GRAS_SC_CNTL during the binning pass.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
Danylo Piliaiev [Mon, 6 Feb 2023 19:36:48 +0000 (20:36 +0100)]
freedreno: Document A6XX_GRAS_SC_CNTL::rotation field
Likely used for VK_QCOM_render_pass_transform.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
Danylo Piliaiev [Mon, 6 Feb 2023 13:56:35 +0000 (14:56 +0100)]
tu: Prevent using stale value of GRAS_SC_CNTL in sysmem clear
cc: mesa-stable
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
Danylo Piliaiev [Fri, 3 Feb 2023 16:02:52 +0000 (17:02 +0100)]
tu: Prevent using stale value of RB_UNKNOWN_88D0 on BLIT
Fixes:
def56b531c86f529bc32d1834ccb479457717db7
("tu: Support GMEM with layered rendering and multiview")
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
Amber [Tue, 7 Feb 2023 10:53:26 +0000 (11:53 +0100)]
freedreno: use blendcoherent to set FLUSH_PER_OVERLAP
FLUSH_PER_OVERLAP is only necessary for gmem if coherent blending is
enabled.
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
Amber [Tue, 7 Feb 2023 10:53:01 +0000 (11:53 +0100)]
gallium: make BlendCoherent usable from gallium drivers
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
Amber [Mon, 6 Feb 2023 13:39:19 +0000 (14:39 +0100)]
freedreno: use A6XX_GRAS_SC_CNTL_SINGLE_PRIM_MODE with fb readback
fixes:
dEQP-GLES31.functional.blend_equation_advanced.msaa.*
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
Mike Blumenkrantz [Fri, 10 Feb 2023 13:20:01 +0000 (08:20 -0500)]
zink: add newlines to some debug printfs
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21239>
Väinö Mäkelä [Thu, 8 Dec 2022 15:59:05 +0000 (17:59 +0200)]
hasvk: Tell spirv_to_nir float controls are always supported
This gets rid of the "Unsupported SPIR-V capability" warnings when
compiling shaders using float controls on gfx7.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
Väinö Mäkelä [Thu, 8 Dec 2022 15:53:03 +0000 (17:53 +0200)]
hasvk: Don't claim shaderDenormPreserveFloat32 on gfx7
From the Haswell PRM Vol. 7, "IEEE Floating Point Mode":
"Single precision (F, Float) denorms are flushed to sign-preserved
zero on input and output of any floating-point mathematical
operation."
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
Väinö Mäkelä [Thu, 8 Dec 2022 15:52:04 +0000 (17:52 +0200)]
intel/vec4: Don't optimize multiply by 1.0 away
The SPIR-V compiler's implementation of tanh generates a multiply by 1.0
to flush denorms to zero.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
Väinö Mäkelä [Thu, 8 Dec 2022 15:41:32 +0000 (17:41 +0200)]
intel/vec4: Set the rounding mode
The rounding mode only needs to be set once, because 16-bit floats or
preserving denorms aren't supported for the platforms where vec4 is
used.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
Eric Engestrom [Wed, 18 Jan 2023 18:50:39 +0000 (18:50 +0000)]
panfrost: drop no-longer-needed libglsl
Fixes:
551c2aadd4d85e922aa6 ("pan/bi: Remove standalone compiler")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21240>
Samuel Pitoiset [Thu, 2 Feb 2023 15:52:15 +0000 (16:52 +0100)]
radv: implement graphics shaders relocation for a RGP workaround
RGP requires shaders to be uploaded consecutively inside the same
buffer object. Otherwise, either it makes the driver generating
huge traces (ie. in GiB) or it fails to load traces at all. Hopefully,
this will be improved soon when AMDGPU drivers will have GPL support.
To workaround this, the driver relocates graphics shaders in the same
buffer object when a pipeline is created. Then at draw time, it
overwrites SPI_SHADER_PGM_xxx registers to make sure SQTT can match
between emitted and exported shaders. It's a bit suboptimal because
graphics shaders are uploaded twice but it's the best solution I found.
This will allow to implement GPL caching without breaking capturing
shaders with RGP.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
Samuel Pitoiset [Wed, 12 Oct 2022 12:26:39 +0000 (14:26 +0200)]
radv: restore uploading shaders individually instead of consecutively
The shaders were uploaded consecutively to fit a RGP constraint but
this was more like a workaround. This upload path doesn't work well for
graphics pipeline library and it was the main blocker for GPL caching.
This commit breaks capturing shaders with RGP if the offset between
shaders is too big. Next commit should fix it by using shaders reloc.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
Georg Lehmann [Fri, 3 Feb 2023 13:46:29 +0000 (14:46 +0100)]
aco: remove stale TODOs about v_interp opsel
These are already handled correctly according to the ISA docs.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21096>
Philipp Zabel [Wed, 8 Feb 2023 12:36:54 +0000 (13:36 +0100)]
vulkan/wsi/wayland: fix acquire_next_image to report timeouts properly
The Vulkan Specification states about possible return values from
vkAcquireNextImageKHR:
* VK_NOT_READY is returned if timeout is zero and no image was
available.
* VK_TIMEOUT is returned if timeout is greater than zero and less than
UINT64_MAX, and no image beae available within the time allowed.
That is, if info->timeout is larger than zero, the function must return
VK_TIMEOUT instead of VK_NOT_READY if no image became available before
the timeout elapsed.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21190>
Samuel Pitoiset [Thu, 9 Feb 2023 11:45:18 +0000 (12:45 +0100)]
radv/ci: bump the number of runners to 3 for vkcts-navi21-valve
RADV_PERFTEST=gpl increased execution time, so let's try with a 3d
runner.
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
seems reliably fixed now for some reasons.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21214>
Samuel Pitoiset [Wed, 8 Feb 2023 17:37:49 +0000 (18:37 +0100)]
radv/ci: set RADV_PERFTEST=GPL for all VKCTS jobs
The Vulkan CTS version in Mesa CI is so old that a bunch of tests
are broken, but it's expected.
This runs +283939 tests and the overall VKCTS execution time increased
from ~23 minutes to ~26 minutes (+~13%) on my Threadripper 1950X.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21214>
Pavel Ondračka [Tue, 31 Jan 2023 12:20:53 +0000 (13:20 +0100)]
nir: shrink phi nodes in nir_opt_shrink_vectors
While this change helps with few shaders, the main benefit is
that it allows to unroll loops comming from nine+ttn on vec4
backends. D3D9 REP ... ENDREP type loops are unrolled now already,
LOOP ... ENDLOOP need some nine changes that will come later.
r300 RV530 shader-db:
total instructions in shared programs: 132481 -> 132344 (-0.10%)
instructions in affected programs: 3532 -> 3395 (-3.88%)
helped: 13
HURT: 0
total temps in shared programs: 16961 -> 16957 (-0.02%)
temps in affected programs: 88 -> 84 (-4.55%)
helped: 4
HURT: 0
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8102
Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7222
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21038>
Samuel Pitoiset [Wed, 8 Feb 2023 14:47:55 +0000 (15:47 +0100)]
docs: stop reporting RADV_PERFTEST=gpl as experimental/suboptimal
The graphics pipeline library implementation in RADV has been
improved considerably lately.
There is still a bit of work for caching individual libraries
and optimized (LTO) pipelines but I think overall it seems good
enough to stop reporting it as experimental and suboptimal.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21213>
Yonggang Luo [Thu, 3 Nov 2022 15:48:31 +0000 (23:48 +0800)]
vulkan: Use static_assert for check HWVULKAN_DISPATCH_MAGIC == ICD_LOADER_MAGIC
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21210>
Chia-I Wu [Wed, 8 Feb 2023 23:14:55 +0000 (15:14 -0800)]
freedreno: avoid conditional ib in fd6_emit_tile
CP_REG_TEST (or any command that reads registers) is slow on a618
(gen1). Since SQE can early return, we don't necessarily need
emit_conditional_ib in fd6_emit_tile.
We still CP_REG_TEST twice for load and store when there is no clear.
Not sure if we can simply drop emit_conditional_ib instead?
glmark2 score goes from 943 to 1067.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21208>
Patrick Lerda [Wed, 8 Feb 2023 14:28:08 +0000 (15:28 +0100)]
mesa/st: fix possible crash related to arb invalid memory access
This invalid memory access is a consequence of wrong assumptions,
for instance:
"prog->sh.data is NULL if it's ARB_fragment_program"
This issue is triggered with piglit/fp-formats -auto -fbo:
==9747==ERROR: AddressSanitizer: heap-use-after-free on address 0x007f7c812d90 at pc 0x007f833c09f8 bp 0x007fd7eca750 sp 0x007fd7eca768
READ of size 4 at 0x007f7c812d90 thread T0
#0 0x7f833c09f4 in st_get_sampler_views ../src/mesa/state_tracker/st_atom_texture.c:109
#1 0x7f833c0b48 in update_textures ../src/mesa/state_tracker/st_atom_texture.c:266
#2 0x7f82b2d120 in st_validate_state ../src/mesa/state_tracker/st_util.h:128
#3 0x7f82b2d120 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88
#4 0x7f82b2de64 in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141
#5 0x7f83105940 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202
#6 0x7f8d5fa5cc in piglit_draw_rect_from_arrays piglit/tests/util/piglit-util-gl.c:711
#7 0x7f8d5fac34 in piglit_draw_rect_custom piglit/tests/util/piglit-util-gl.c:833
#8 0x4019e0 in piglit_display piglit/tests/shaders/fp-formats.c:67
#9 0x7f8d643fc4 in run_test piglit/tests/util/piglit-framework-gl/piglit_fbo_framework.c:52
#10 0x401624 in main piglit/tests/shaders/fp-formats.c:39
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21175>
Chia-I Wu [Wed, 8 Feb 2023 04:43:48 +0000 (20:43 -0800)]
freedreno/registers: document more bits of CP_REG_TEST
On gen3+, there are 32 predicate bits instead of 1.
I set out to see why CP_REG_TEST (and others commands that read
registers) is slower on gen1 but could not find anything. Since the
blob seems to use multiple predicate bits, let's keep them documented.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
Chia-I Wu [Wed, 8 Feb 2023 20:25:21 +0000 (12:25 -0800)]
turnip: skip unnecessary CP_REG_TEST for cond load/store
When no attachment allows conditional load/store, skip the unnecessary
CP_REG_TEST.
This is done to avoid a performance trap on a618 (gen1). CP_REG_TEST or
any command that reads a register is slow on a618.
glmark2 score goes from 830 to 1001.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8162
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
Chia-I Wu [Wed, 8 Feb 2023 20:25:17 +0000 (12:25 -0800)]
turnip: add a comment to tu_render_pass_cond_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
Mike Blumenkrantz [Thu, 9 Feb 2023 17:17:25 +0000 (12:17 -0500)]
zink: implement cross-program pipeline library sharing
some games/apps (e.g., DOOM2016) compile+link shaders in one context
and then use them in another, expecting that the compiled shaders
will be reused. vulkan has pipeline (library) objects, which are not
specific to shaders but are in theory representing the shaders being used
thus, pipeline (library) objects need to be reusable for any case where
a shader can be reused
to handle this:
* extract pipeline library cache to a refcounted object
* store these objects on the screen
* make them owned by shaders
separable programs are slightly different since they'll use their own
fastpath, thus making their library caches owned by the programs to avoid
polluting the optimized caches
fixes #8264
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
Mike Blumenkrantz [Thu, 9 Feb 2023 17:16:12 +0000 (12:16 -0500)]
zink: break out zink_gfx_program::libs into refcounted object
no functional changes yet, and these are still 1:1 with their programs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
Mike Blumenkrantz [Thu, 9 Feb 2023 17:12:16 +0000 (12:12 -0500)]
zink: store gfx_hash on zink_gfx_program
this avoids needing to reference ctx->gfx_hash in threads or recalc the hash
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
Ian Romanick [Fri, 3 Feb 2023 23:57:22 +0000 (15:57 -0800)]
nir/inline_uniforms: Add inot condition support
From the
96c19d23c95700 commit message:
Ever since
4246c2869c3c and
7d85dc4f350b loop unrolling can no
longer depend on inot being eliminated from the loop
terminator condition so we need to be able to handle it.
Support these conditions here too.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
Ian Romanick [Mon, 6 Feb 2023 20:32:48 +0000 (12:32 -0800)]
nir/inline_uniforms: Make add_inlinable_uniforms public
This is step 5 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
Ian Romanick [Mon, 6 Feb 2023 20:17:45 +0000 (12:17 -0800)]
nir/inline_uniforms: Make src_only_uses_uniforms public, change name
While making the function public, rename it to
nir_collect_src_uniforms. The old name makes it sound like it's just a
query that doesn't have side effects. That is, however, not the case.
This is step 4 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>