Commit Graph

13 Commits

Author SHA1 Message Date
Eric Engestrom c3d8395a14 vulkan/runtime: use updated tokens from vk.xml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>
2022-07-12 15:53:11 +00:00
Boris Brezillon b78d3ebe72 vulkan/util: Fill VkPhysicalDeviceIDProperties::deviceNodeMask
This field copy was missing in
vk_get_physical_device_core_1_1_property_ext().

Fixes: 19ff5019b7 ("vulkan: Add helpers for filling exts for core features and properties.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
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/16926>
2022-06-14 22:44:42 +00:00
Jason Ekstrand 6899cd2b6e vulkan: Start collecting enabled features in vk_device
We're not trying to make this 100% complete.  For now, all we care about
is robustBufferAccess.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16276>
2022-05-12 10:53:16 +00:00
Jason Ekstrand 51077e821a vulkan: Allow the driver to manually enable threaded submit
This is useful for drivers that wish to be able to block inside their
vk_queue::driver_submit hook.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>
2022-03-30 23:17:56 +00:00
Jason Ekstrand 08512aea09 vulkan: Replace various uses of device->timeline_mode
What we really care about is if we're DEFERRED so we need to do a flush
and if there can be any other threads we might race against.  We don't
really care about the timeline mode itself.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>
2022-03-30 23:17:56 +00:00
Jason Ekstrand e0ffdc8ce0 vulkan/queue: Rework submit thread enabling
Now that we have a threading mode in the device, we can set that based
on the environment variable instead of delaying it to submit time.  This
allows us to avoid the static variable trickery we use to avoid reading
environment variables over and over again.  We also move the enabling of
the submit thread up a level or two and give it a bit more obvious
condition.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>
2022-03-30 23:17:56 +00:00
Jason Ekstrand 9ddab162b7 vulkan/queue: Add a submit mode enum
This encapsulates all three possible submit modes: immediate, deferred,
and threaded.  It's more clear than the has_thread boolean combined with
device-level checks.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15566>
2022-03-30 23:17:56 +00:00
Jason Ekstrand cc8eb6f5df vulkan/runtime: Implement 1.3 features/properties
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14707>
2022-01-25 15:57:53 +00:00
Jason Ekstrand 7b19c9d19b vulkan/device: Log the timeline mode when lost
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
2021-11-16 10:54:27 -06:00
Jason Ekstrand 9bffd81f1c vulkan: Add common implementations of vkQueueSubmit and vkQueueWaitIdle
This adds a new vk_queue_submit object which contains a list of command
buffers as well as wait and signal operations along with a driver hook
which takes a vk_queue and a vk_queue_submit and does the actual submit.
The common code then handles spawning a submit thread if needed, waiting
for timeline points to materialize, dealing with timeline semaphore
emulation via vk_timeline, etc.  All the driver sees are vk_queue.submit
calls with fully materialized vk_sync objects which it can wait on
unconditionally.

This implementation takes a page from RADV's book and only ever spawns
the submit thread if it sees a timeline wait on a time point that has
not yet materialized.  If this never happens, it calls vk_queue.submit
directly from vkQueueSubmit() and the thread is never spawned.

One other nicety of the new framework is that there is no longer a
distinction, from the driver's PoV, between fences and semaphores.  The
fence, if any, is included as just one more signal operation on the
final vk_queue_submit in the batch.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
2021-11-16 10:54:27 -06:00
Jason Ekstrand fdb636e3a6 vulkan/vk_device: Add a drm_fd field
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
2021-11-16 10:02:08 -06:00
Jason Ekstrand dd89ef96d7 vulkan: Pull the device lost framework from ANV
It's a bit on the over-complicated side but the objective is to make the
debug log messages show up in the same thread as the first
VK_ERROR_DEVICE_LOST so we don't massively confuse the app.  It's
unknown if this is actually ever a problem but, with submit happening
off on its own thread, logging errors from threads the client doesn't
know about doesn't seem like a massively great plan.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13427>
2021-11-16 10:02:08 -06:00
Jason Ekstrand 4108fda426 vulkan: Move all the common object code to runtime/
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Renamed from src/vulkan/util/vk_device.c (Browse further)