Commit Graph

1519 Commits

Author SHA1 Message Date
Rhys Perry
33f4e947d8 vulkan/wsi: fix win32 compilation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Fixes: d7938de8fe ("vulkan/wsi: don't support present with queues where blit is unsupported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26610>
2023-12-09 11:56:32 +00:00
Rhys Perry
d7938de8fe vulkan/wsi: don't support present with queues where blit is unsupported
Since we might have to perform a copy, video and sparse queues cannot be
used to present.

Attempting to create a command buffer on RADV for the sparse binding queue
causes a crash.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 748b7f80ef ("radv: Move sparse binding into a dedicated queue.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26523>
2023-12-09 07:37:44 +00:00
Eric Engestrom
40c82b5f67 vk/update-aliases.py: only apply renames for the vulkan api (not vulkansc)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
1b3fca1708 vk/update-aliases.py: enforce correct list order
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
2cf22af0a7 vk/update-aliases.py: handle more concatenated prefixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
04517193c5 vk/update-aliases.py: simplify addition of other concatenated prefixes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
3fe90f2957 vk/update-aliases.py: sort files when informing the user of the matches
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:01 +00:00
Eric Engestrom
d8b38ec4a3 vk/update-aliases.py: handle "no match" grep call
This was not necessary before because there was always at least the
vk.xml file itself in the `src/` search path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:00 +00:00
Eric Engestrom
c6ebf9d643 vk/update-aliases.py: allow specifying the files we want to update
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:00 +00:00
Eric Engestrom
e988b1975b vk/update-aliases.py: drop dead --check-only
This was introduced for when it was intended for this script to run as
part of the build tests, but that was dropped, and so should this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26484>
2023-12-07 19:52:00 +00:00
Yonggang Luo
e7c614bd20 util,vulkan,mesa,compiler: Generate source files with utf8 encoding from mako template
This is for fixes the following error:
FAILED: src/vulkan/runtime/vk_synchronization_helpers.c src/vulkan/runtime/vk_synchronization_helpers.h
"C:\CI-Tools\msys64\mingw64\bin/python3.EXE" "../../src/vulkan/util/vk_synchronization_helpers_gen.py" "--xml" "../../src/vulkan/registry/vk.xml" "--out-c" "src/vulkan/runtime/vk_synchronization_helpers.c" "--beta" "false"

Traceback (most recent call last):
  File "C:/work/xemu/mesa/src/vulkan/util/vk_synchronization_helpers_gen.py", line 213, in main
    f.write(TEMPLATE_C.render(**environment))
UnicodeEncodeError: 'gbk' codec can't encode character '\xa9' in position 15: illegal multibyte sequence

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26515>
2023-12-07 12:41:07 +00:00
Lionel Landwerlin
e8a96e6ba0 vulkan/runtime: retain video session creation flags
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26519>
2023-12-06 19:17:17 +00:00
Eric Engestrom
f5297208d0 vk/overlay-layer: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Eric Engestrom
d0df3834b4 vk/util: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Eric Engestrom
d6144ba88f vk/wsi: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Eric Engestrom
84c27ea42c vk/runtime: update symbols that have become aliases for newer ones
All of these have been renamed in the spec (usually by being promoted);
renamed them in our code too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26487>
2023-12-04 23:27:29 +00:00
Faith Ekstrand
00e88584af vulkan: Add helpers for access flags
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:51 +00:00
Faith Ekstrand
44add595af vulkan: Add helpers for pipeline stage flags
This adds hand-written helpers for detecting if a set of stage flags
contains shaders as well as expand helpers that properly handle
TOP/BOTTOM_OF_PIPE_BIT.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:51 +00:00
Faith Ekstrand
fe12c1c29e vulkan: Add some auto-generated synchronization helpers
These are helpful for drivers to implement synchronization rules

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:51 +00:00
Faith Ekstrand
9ad51980de vulkan: Move vk_synchronization2 to vk_synchronization
I'm about to add more stuff that isn't really for sync2 so it makes
sense to give it a slightly more generic name.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26407>
2023-12-01 17:59:50 +00:00
Faith Ekstrand
93acce99f3 vulkan: Default override patch version to VK_HEADER_VERSION
The patch version shouldn't matter but, on the off chance it does, we
don't want to be advertising non-existent versions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26383>
2023-11-28 23:52:27 +00:00
Hyunjun Ko
fbc9811241 vulkan/video: fix a typo
Fixes: d46162981a ("vulkan/video: add h264 headers encode")
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26139>
2023-11-17 00:45:55 +00:00
Friedrich Vock
8ffdad731c vulkan: Don't use set_foreach_remove when destroying pipeline caches
set_foreach_remove assumes no entries have been removed. That assumption
only holds if no errors occur, since pipeline cache objects can get
removed if an error occurs during deserialization.

This fixes
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
crashing on RADV.

Cc: mesa-stable
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
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/26164>
2023-11-13 20:09:31 +00:00
antonino
2d49f834b2 vulkan: use instance allocator for object_name in some objects
The allocator passed to VkDevice won't be available once it is destroyed
and thefore it cannot be used to allocate `object_name` for instance
level objects such as `VkInstance` or `VkPhysicalDevice` or else there
would be no way of deallocating it when those objects are destroyed.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26085>
2023-11-10 20:57:19 +00:00
Paulo Zanoni
17e135d3d4 vulkan: fix potential memory leak in create_rect_list_pipeline()
I was playing around with possible improvements to STACK_ARRAY(), and
one of my experiments made gcc point us that we were not freeing
'stages'.

Fixes: 514c10344e ("vulkan/meta: Add a concept of rect pipelines")
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26041>
2023-11-09 18:22:36 +00:00
Vitaliy Triang3l Kuzmin
054188bff8 vulkan: Fix pipeline layout allocation scope
The lifetime of Mesa's vk_pipeline_layout may exceed that of the
VkPipelineLayout object as other objects on the device may hold references
to it. In other places in vk_pipeline_layout and vk_descriptor_set_layout,
the device allocation scope is used with this pattern, but there was an
inconsistency in vk_pipeline_layout_zalloc, which is fixed by this commit.

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24794>
2023-11-07 10:09:52 +00:00
Connor Abbott
2e83aed8b3 vk/graphics_state: Add vk_pipeline_flags_feedback_loops helper
This will be useful for combining dynamic and static feedback loop
state.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
a02d1cfa9e vk/graphics_state: Support VK_EXT_attachment_feedback_loop_dynamic_state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
55f3f952aa vk/graphics_state, tu: Rewrite renderpass flags handling
Before this, the render pass code or the driver combined the pipeline
create flags and the implicit flags from the render pass, but the
pipeline create flags will need to be sanitized when they are dynamic
state, so we need to do it in vk_graphics_state where we know that
information.

We also weren't combining pipeline flags correctly when linking, which
on turnip was being hidden by the lack of sanitizing for driver-provided
flags. We can't combine them correctly if they're part of the render
pass state, so they need to be pulled out into the overall pipeline
state.

For drivers using emulated renderpasses or tracking feedback loop
information themselves, this won't make a difference, but we have to
adapt turnip to not pass pipeline flags. This also means that we can
drop all handling of feedback_loop_input_only in turnip and just set it
in the runtime.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
2b62d90158 vk/graphics_state: Support VK_KHR_maintenance5
Switch to using VkPipelineCreateFlags2KHR, and use the new common helper
to get the right flags.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Connor Abbott
e6f5d7222c vk,lvp,tu,radv,anv: Add common vk_*_pipeline_create_flags() helper
And replace the various homegrown or copy-pasted helpers in drivers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>
2023-11-06 14:33:51 +00:00
Dave Airlie
c8e39683da vulkan/video: add h265 header encoders.
Vulkan video has parameter overrides, where the	driver can override the
driver provided	parameters with	an encoded bitstream where it has made
changes.

This is	the support code to encode the bitstream headers for h265
from parameters	(vps/sps/pps).

Acked-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
d46162981a vulkan/video: add h264 headers encode
Vulkan video has parameter overrides, where the driver can override the
driver provided parameters with an encoded bitstream where it has made
changes.

This is the support code to encode the bitstream headers for h264
from parameters (sps/pps).

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
8243145f02 vulkan/video: add a h265 level translator.
This just converts the protocol level to the spec level encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
5542b51aff vulkan/video: add h264 level idc convertor utility
This converts vulkan level to the bitstream encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:37 +00:00
Dave Airlie
72f52329cd vulkan/video: add a nal_unit lookup for hevc
This is needed to by drivers to get a nal unit type
for the picture type.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
fee258de27 vulkan/video: add h264 nal enum
This will be used later for header encoding.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
8dd97080d8 vulkan/video: add h265 encode support
This just adds the session and parameter handling for h265 encode.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Dave Airlie
5cb46f1ce7 vulkan/video: add support for h264 encode to common code
This adds support for the h264 encode session and parameter storage.

Reviewed-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25874>
2023-11-03 22:59:36 +00:00
Jesse Natalie
67df2f29eb vulkan: Support loader interface v7
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Jesse Natalie
228329f4da vulkan: Consolidate common ICD methods
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25998>
2023-11-03 20:01:14 +00:00
Chia-I Wu
ef724ab695 vulkan, tu, pvr: remove vk_render_pass_state::render_pass
The spec says

  A VkRenderPass or VkPipelineLayout object passed as a parameter to
  create another object is not further accessed by that object after the
  duration of the command it is passed into.

The object could have been destroyed if we get the pointer from a
pipeline library.  Since it has no user now, let's remove it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26000>
2023-11-03 17:23:30 +00:00
Yonggang Luo
ce5475366e compiler,vulkan,drm-shim: Remove unused include directories from meson.build
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24462>
2023-10-27 01:35:10 +00:00
Jani Nikula
082e7d23e7 docs/vulkan: use hawkmoth instead of doxygen
Use the hawkmoth c:auto* directives to incorporate vulkan documentation.

Convert @param style parameter descriptions to rst info field lists.
Add static stubs for generated headers. Fix a lot of references, in
particular the symbols are now in the Sphinx C domain, not C++
domain. Tweak syntax here and there.

Based on the earlier work by Erik Faye-Lund <kusmabite@gmail.com>

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24507>
2023-10-26 16:13:26 +00:00
Mike Blumenkrantz
895c85ca8f vulkan/wsi: unify all the image usage flag caps
these should be the same for all wsi backends, so make a single
entrypoint to return the flags so it can be modified in a single place

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25291>
2023-10-26 00:08:57 +00:00
David Rosca
081f972eba util/vl: Fix vl_rbsp parser with bitstreams without emulation bytes
This is used for parsing VA packed headers and those can be without
emulation prevention bytes.
Add emulation_bytes argument to vl_rbsp_init and skip all emulation
bytes handling when set.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25565>
2023-10-25 01:03:58 +00:00
Faith Ekstrand
7fb561eff2 vulkan/wsi: Allow for larger linear images
For images of size 32768 × 32768 (which NVK allows), the linear image
ends up being 4GB which overflows the uint32_t size as well as some of
our alignment calculations.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25729>
2023-10-16 13:02:14 +00:00
Hannes Mann
7881874847 vulkan/wsi/wayland: Fix detection of tearing control protocol
Fixes: 5ceba97c2e ("vulkan/wsi/wayland: add support for IMMEDIATE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25689>
2023-10-16 09:06:24 +00:00
Karmjit Mahil
9b7d437653 vulkan: Add vk_subpass_dependency_is_fb_local() helper
Some tilers check for framebuffer local dependancy to determine if
they can rearrange or merge some sub-passes without breaking
their dependencies. Adding a helper for that.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25612>
2023-10-12 09:30:07 +00:00
Yogesh Mohan Marimuthu
09b574aa6c vulkan add 3D texture support for compute astc decoder
v2: use correct 2D/3D for view type (Chia-I Wu)

Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24672>
2023-10-11 19:28:40 +00:00