"__ANDROID__ is defined by the compiler. It is defined for
all Android targets."
"ANDROID is set by some build systems, and not in any reliable
manner (in AOSP it actually just means that you're in AOSP; it's
set even when you're building host code for Windows, so it
doesn't mean much of anything)."
https://github.com/android/ndk/issues/407https://github.com/android/ndk/issues/807
Since the toolchain provides __ANDROID__ for actual Android
targets, standalone NDK and Soong builds should work.
The Mesa CI uses a combination of the NDK toolchain, internal
Android stubs and a Debian sysroot when compile testing Android.
Long-term, it should be possible to remove ANDROID and use
DETECT_OS_ANDROID everywhere.
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26874>
When receiving SUBOPTIMAL_COPY, we need to consider that it can be a
false positive. Xwayland may send this suboptimal copy if there are
pending DRM modifier feedbacks from compositor, but it's likely the
modifier lists are identical.
Hash the modifier lists and compare them against the newly queried
modifier list when SUBOPTIMAL_COPY is received to work around false
positives.
This fixes crashes in games that cannot handle SUBOPTIMAL correctly,
and avoid needless stutters when entering full-screen modes.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27035>
Ignoring asprintf() return value leads to the following compiler warning:
src/compiler/clc/liblibmesaclc.a.p/clc.c.o -MF src/compiler/clc/liblibmesaclc.a.p/clc.c.o.d -o src/compiler/clc/liblibmesaclc.a.p/clc.c.o -c ../src/compiler/clc/clc.c
In file included from ../src/compiler/clc/clc.c:28:
../src/compiler/clc/clc.c: In function ‘clc_libclc_new’:
../src/compiler/clc/clc_helpers.h:99:7: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
99 | asprintf(&_msg, fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/compiler/clc/clc_helpers.h:105:37: note: in expansion of macro ‘clc_log’
105 | #define clc_error(logger, fmt, ...) clc_log(logger, error, fmt, ##__VA_ARGS__)
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27140>
This register don't exist in Xe2 and there is no Bspec page with
another register to be programmed with L3 allocation layout so
intel_get_l3_config() can also always return NULL for Xe2.
Still allowing intel_get_l3_config() to return non-null because
intel_l3_config is used to calculate TBIMR parameters, see
intel_calculate_tile_dimensions().
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26742>
It is broken and clang uses fp32 for float constants if the fp64 extension
isn't enabled anyway. SPIRVs can't use fp64 constants with printf unless
they enable the Float64 cap, which also requires cl_khr_fp64 to be
supported.
So just remove it and rely on clang handling -cl-single-precision-constant
correctly, which at the moment doesn't seem to be the case, but we can
think about that once we plan to support cl_khr_fp64.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26541>
Currently driver side heap alloc obj ptr is used as object id, which is
used on the renderer side for actual vk obj mapping. However, this adds
an implicit dependency between any driver obj destroy/free and new obj
create/allocate because the heap obj freed up can be immediately
reallocated out.
With venus moving to multi-ring, the ordering between asynchronous obj
destroy/free and new obj create/allocate has to be guaranteed via driver
side non-primary ring submission always waiting for primary ring idle.
This can defeat the purpose of multi-ring in certain scenarios. So this
change adds a way to assign unique id to object.
Even before multi-ring, the unique object id can make device and queue
object alloc/free more robust without hidden ordering requirements. This
also fixes some oom cts which can intentionally fail the submission of
an object destroy (renderer side obj is still present) while the driver
side freed object ptr being reused for another object creating, causing
object id reuse at renderer side object table.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27083>
Since Vulkan 1.3.271, the spec allowed vkCmdBeginTransformFeedbackEXT
to be called without an active graphics pipeline bound when using
shader objects.
That means that the last VGT shader would be NULL once VKCTS is
updated accordingly. This change delays emitting streamout enable at
draw time to make sure the last VGT shader is present, regarldess if
ESO is enabled or not.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27075>
DOOM Eternal builds acceleration structures with inactive primitives and
tries to make them active in later AS updates. This is disallowed by the
spec and triggers a GPU hang. Fix the hang by working around the bug.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27034>
Commit 73eecffabd ("panvk: Use the vk_pipeline_layout base struct")
reworked the panvk logic to use vk_pipeline_layout, which contains the
number of descriptor set layout referenced by a pipeline layout, thus
deprecating panvk_pipeline_layout::num_sets.
Make panvk_fill_non_vs_attribs() use vk_pipeline_layout::set_count
instead of panvk_pipeline_layout::num_sets and kill the latter so we
can't introduce new users.
Fixes: 73eecffabd ("panvk: Use the vk_pipeline_layout base struct")
Cc: mesa-stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27107>