In AHB importing flow, the format is known at vkCreateImage step,
but buffer layout itself is not yet known. Buffer layout and modifier
must be updated later in vkBindImageMemory.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
Both vk_image_init and vk_image_view_init are smarter about format
settings and respect AHB extension needs.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
Rework it to use the existing VkImageDrmFormatModifierExplicitCreateInfoEXT
logic to set the image's explicit layout.
The code turned out to be generic enough so it could be integrated into
vk_image.c in the future and removed from the v3dv code.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
The function extracts buffer information from the gralloc and fills
the VkImageDrmFormatModifierExplicitCreateInfoEXT structure.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14195>
While both clang and gcc can handle designated initializers in C++,
MSVC only does with the C++20 support enabled. So move the initialization
of builtins to a C file.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
Remove constructors from glsl_type so it can be used as a
POD ("plain old data") struct, allowing the builtins to be
initialized directly in memory.
For other types, we now allocate them from glsl_type_cache's mem_ctx,
instead of using the global allocator.
As a side-effect of how the new helpers work, we can completely
create the mock key types for struct/interface lookup without
allocating any memory.
Note there's no `make_sampler_type` since all the sampler types
are created through direct initialization.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
Since now all the data referenced by it is allocated with the cache's
mem_ctx, it is sufficient to just free it, and then reset the cache
state to be ready for a next initialization if it happens.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
These are used only by types created at runtime. Since those will follow
the lifetime of the glsl_type_cache, we can use its mem_ctx for all the types.
Without a mem_ctx, there's nothing to be done in the destructor, so remove it.
Note some keys are calculated by building a mock type, so we need to create
a tmp_ctx in some cases. We'll get rid of them in a later commit.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
For now we use a temporary glsl_type_params struct, we will be able to
use the glsl_type directly once we make it a POD ("plain old data")
struct by getting rid of its constructors and destructors.
Note that since the name is statically allocated, there's no need to
strdup() it, deallocate it and also no need to have a mem_ctx.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
Unlike for simpler types, struct types have a runtime cache, that's used to
ensure same type can be compared to same pointer. The existing code was bypassing
it, potentially breaking that invariant. One potential issue would be when
decoding/encoding types, the resulting type would be pointer-different than what
was stored.
This hasn't caused a visible issue, but the (incomplete) special handling for struct
builtins is in the way of other changes.
Change the code to use get_struct_instance(), and also only ever load those if the
parser need the types, since some of them are deprecated types that we might never
want to load.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25006>
There's a bunch of noise over time in the anv-tgl-fails.txt from the set
of tests run changing and catching more of the failures. If we have a
nightly full run, we can keep things up to date more easily (as seen here,
where I finish filling out the modifiers crashes and drop a stale xfail).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25155>
The translator recently unmapped where const info gets stored,
and you can ask for the metadata to be passed through instead, do that
for now, until it's all resolved.
Fixes: api get_kernel_arg_info
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13449>
We don't need to carry this value around, its only used a single time in
the linker. Instead simply extract it from gl_shader when we need it.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25105>
llvm16 + opaque pointers uses a ptr to event for the opaque type,
llvm 17 fixes this properly, but the fix doesn't look too backportable.
Cc: mesa-stable
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25165>
GLSL doesn't use that type. SPIR-V used for a while but later started
relying on its own data structures and stopped using it.
See ca62e849d3 ("nir/spirv: Stop using glsl_type for function types")
If we were ever to add this one again, would be better to have a way to
grab a key for lookup that did not require allocations, right now that's
needed to inject return type as the first element in params array.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
We can use the static version of the empty string. There's no worry
about freeing that string incorrectly since what is being deallocated
later is the whole mem_ctx.
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25160>
I don't know if these can be done properly, but for now just don't
emit the standard cp stuff since it hangs the GPU.
"Fixes" dEQP-VK.video.synchronizat*
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25170>
If present ID is 0, we should consider it to be ignored.
Avoids a theoretical problem when using IMMEDIATE mode with present ID
where some images don't set present ID.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25178>
If we observe IDLE before COMPLETE, another queued image may have
presented with present ID 0 which would break the check fixed in this
commit. The original fix for present_id / signal_present_id split
forgot to take this into account.
Fixes: 32f7ff2c20 ("Fix present ID signal when IDLE comes before
COMPLETE").
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25178>
This reverts commit 12a4f2c132.
With PIPE_MAP_READ_WRITE and derived image, the encoder will copy
to and from staging buffer for each frame, which caused performance
degradation, even worse than putImage.
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25128>