There is no code currently concatenating that string so it is not useful
to have it here, and it is triggering a loop because a substitution is
becoming itself if we remove this prefix.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28102>
vk_format_is_int() returns true for both signed and unsigned integers,
which means unsigned types will always be assigned a GLSL_TYPE_INT type,
which causes some backend compilers (like bifrost) to pick a wrong
register type.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28073>
Descriptors are updated with CmdPushDescriptorSet(), we need to reflect
that with a VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR when
the DescriptorSetLayout is created.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28073>
Summary:
- ensure headers used outside runtime are included in dependency source
- drop redundant idep_vulkan_common_entrypoints_h
- drop redundant icd side tricks for the order of header gen
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28066>
The generated "astc_spv.h" is for runtime internal use, so leave it
inside the runtime files to ensure the header is generated before being
used to compile.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28066>
Add the vk_rmv_misc_internal_description struct and list the misc_internal
member of that type in the vk_rmv_resource_create_token union, allowing
logging of different internal resources in RMV dumps.
The vk_rmv_common.h header also has the C-linkage block added in order to
enable its inclusion in C++ files.
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27631>
This change adds a new generated header dep to the runtime internal
library dependencies. This ensures the headers are generated before the
below libraries are compiled:
- libvulkan_lite_runtime (already satisfied due to file sources)
- libvulkan_lite_instance
- libvulkan_runtime
- libvulkan_instance
Fixes: fe2ec50844 ("vulkan: allow building venus without libcompiler")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28062>
This is done by introduce idep_vulkan_lite_runtime, and only venus
depends on idep_vulkan_lite_runtime.
Modify the meson and source files to allow building venus without
the compiler.
See details Venus build metrics at the MR description.
gfxstream-vulkan forwards the shader to the host, and doesn't
need to convert into NIR in the guest. This results in faster
builds and less parts of Mesa to build. Also venus does the
same thing too, that's what the build is keyed on right now
as an in-tree user.
v7: By Yonggang Luo <luoyonggang@gmail.com>
Add idep_vulkan_common_entrypoints_h into vulkan_lite_runtime_deps because
vk_instance.c depends on idep_vulkan_common_entrypoints_h but vk_common_entrypoints is
not compiled in library `vulkan_lite_instance`.
Rename idep_vulkan_runtime_headers to idep_vulkan_lite_runtime_headers because
both lite/full runtime library depends on this, but lite should not depends on full
vk_meta_private.h added into vulkan_runtime_files
v6: By Yonggang Luo <luoyonggang@gmail.com>
get vulkan_lite_runtime_files and vulkan_runtime_files sorted
v5: By Yiwei Zhang <zzyiwei@chromium.org>
both vk_sampler and vk_ycbcr_conversion can stay in the lite runtime
v4: By Yonggang Luo <luoyonggang@gmail.com>
only build vk_instance.(c|h) twice for reduce compiling time
v3: By Yiwei Zhang <zzyiwei@chromium.org>
less code changes by introduce libvulkan_lite_runtime
v2: By Yonggang Luo <luoyonggang@gmail.com>
allow building Vulkan without libcompiler without compiling flags, the
venus is always built without libcompiler
v1: By Gurchetan Singh <gurchetansingh@google.com>
allow building Vulkan without libcompiler
Signed-off-by: Gurchetan Singh <gurchetansingh@google.com>
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26574>
DebugMarkerSetObjectNameEXT is just a less powerful version of
SetDebugUtilsObjectNameEXT. Fixes the objectType cast warning as well.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27975>
vk_shader_init_cache_obj() is fast enough and the already-found case is
rare enough that there's no good reason to avoid the init. This allows
us to use vk_shader_unref instead of vk_shader_destroy which is probably
a touch safer over-all. It also fixes the assert that the two shaders
have matching keys.
Fixes: bb8b11d806 ("vulkan/pipeline: Handle fully compiled library shaders properly")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10752
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27993>
Some people seem to have systems with more than 8 GPUs installed at
once. 256 is the maximum number of devices returned by libdrm, so using
this seems like a good choice for now.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27901>
We can have multiple swapchains, and we can also have retired swap chains
that can continue to deliver events briefly after being replaced. It's
helpful to have both a surface id and a per surface swapchain id.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27852>
PresentWait can still be called on a retired swapchain, and pilfering
the WSI surface can cause issues. To avoid retired swapchains
interfering with non-retired swapchain event queue, flag a swapchain as
retired instead and immediately return OUT_OF_DATE from acquire and
present.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27851>
Instead of coding our own polling function, use the (new) wayland
wl_display_dispatch_queue_timeout() function instead.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27851>
If we want to use the new wl_display_dispatch_queue_timeout function
in libwayland we lose the ability to drop the lock while we poll
and pick it up again to dispatch.
That would cause other waiters to potentially block past their
timeouts while waiting for the dispatching thread's timeout.
Prepare for this change now by dropping the lock for the entire
dispatch, and reacquiring the lock in the functions being dispatched.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27851>
We do own the lock if there's a timeout, and the code is written with that
in mind - but the comment seems to imply otherwise.
Drop it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27851>
this is a bandaid fix that allows users (zink) to actually call the
functions intended to be called. the real fix would be to figure out
which extensions are enabled on the device and then only GPA the
functions associated with those extensions
that's too hard though so I'm slapping some flex tape on it
cc: mesa-stable
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27834>
In the fast-link case, we should just use the library shader and assume
that it's correct. We have to do this because we may not have a
precompiled shader in this case so we can't even generate the shader
hash.
In the link optimization case, we could still have a library shader
coming in from some library pipeline. That shader may happen to be
correct, in which case we can just use it and not even bother digging
around in the cache. In the more likely case, the keys won't match and
we should throw it away before we look up a different shader in the
cache and leak our reference.
Fixes: 9308e8d90d ("vulkan: Add generic graphics and compute VkPipeline implementation")
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27860>
These implementations are built on top of vk_shader. For the most part,
the driver shouldn't notice a difference between draws consuming
pipelines vs. draws consuming shaders. The only real difference is
that, when vk_driver_shader_ops::compile() is called for pipelines, a
struct vk_graphics_pipeline_state is provided. For shader objects, the
state object will be NULL indicating that all state is unknown. Besides
that, all the rest of the differences between Vulkan 1.0 pipelines,
VK_EXT_graphics_pipeline_library, and VK_EXT_shader_object are handled
by the Vulkan runtime code.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
We need to be able to thunk through a destroy callback if we want to
have different kinds of pipelines implemented in different parts of the
stack.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
This adds a new base vk_shader object along with vtables for creating,
binding, and working with shader objects.
Unlike other parts of the runtime, the new shader object code is a bit
more sanitized and opinionated than just handing you the Vulkan
entrypoints. For one thing, the create_shaders() calback takes a NIR
shader, not SPIR-V. Conversion of SPIR-V into NIR, handling of magic
meta NIR shaders, etc. is all done in common code. [De]serialization is
done via `struct blob` and the common code does a checksum of the binary
and handles rejecting invalid binaries based on shaderBinaryUUID and
shaderBinaryVersion. This should make life a bit easier for driver
authors as well as provides a bit nicer interface for building the
common pipeline implementation on top of shader objects.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
Because these functions were introduced by VK_EXT_shader_objects, we
technically have to expose them even though they have to do with NV
extensions that no one else supports.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
We're supposed to just ignore samples above what we support, and there's
no VU matching this assert. Fixes a crash in
dEQP-VK.pipeline.shader_object_unlinked_spirv.extended_dynamic_state.misc.sample_shading_dynamic_sample_count.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27024>
This is almost a 1:1 copy of the same function in libwayland. If the version
with the symbol propagates far enough the fallback can be removed again.
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27511>
wayland-client stores up to MAX_FDS_OUT (28) outgoing fds and
then release them in batch later through close_fds.
While this is not a problem in normal situation, because the
app would also have a reference to the same buffers, this is
an issue when these buffers are released (eg: because the
swapchain creation failed).
In this situation wayland-client owns the last ref to these
buffers and prevent their deletion.
This is an issue with dEQP-VK.wsi.wayland.swapchain.simulate_oom.image_extent
because it creates swapchains in a fast loop with a failing allocator
to fail the swapchain creation.
Without this change, on a 16GB dGPU the test peaks at 95% VRAM / 60% GTT and
completes in 1.5 sec.
With this change, the max usage is 65% VRAM / 10% GTT and completes it
in 0.3 sec.
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27592>