Revert "Merge branch 'master' of https://github.com/Vindicus999/WiVRn"

This reverts commit 6212dccc2b, reversing
changes made to 80e31b642a.
This commit is contained in:
Vindicus999
2025-08-24 09:56:21 -04:00
parent 6212dccc2b
commit ea45e9f91b
135 changed files with 2784 additions and 12225 deletions
-5
View File
@@ -9,11 +9,6 @@ if [ -d ".git" ] ; then
exec git am --committer-date-is-author-date "$@"
fi
if ! type patch 2> /dev/null ; then
echo "patch command not found" >&1
exit 1
fi
# There is no reliable way to apply a patch and succeed if it was
# already applied. Just ignore errors...
for f in "$@" ; do
@@ -1,7 +1,7 @@
From 483ce192460569020fa57522ee2bea99198dac2e Mon Sep 17 00:00:00 2001
From 18e184e504d9f55dbba3f02c87f96410b2ce04ab Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 22 Oct 2024 15:23:19 +0200
Subject: [PATCH 01/13] c/multi: early wake of compositor
Subject: [PATCH 01/10] c/multi: early wake of compositor
---
.../compositor/multi/comp_multi_compositor.c | 14 +++++++++
@@ -10,10 +10,10 @@ Subject: [PATCH 01/13] c/multi: early wake of compositor
3 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/src/xrt/compositor/multi/comp_multi_compositor.c b/src/xrt/compositor/multi/comp_multi_compositor.c
index 94cea110e..88347a092 100644
index 553565db4..789a2d042 100644
--- a/src/xrt/compositor/multi/comp_multi_compositor.c
+++ b/src/xrt/compositor/multi/comp_multi_compositor.c
@@ -236,7 +236,21 @@ wait_for_scheduled_free(struct multi_compositor *mc)
@@ -232,7 +232,21 @@ wait_for_scheduled_free(struct multi_compositor *mc)
os_mutex_lock(&mc->slot_lock);
slot_move_and_clear_locked(mc, &mc->scheduled, &mc->progress);
os_mutex_unlock(&mc->slot_lock);
@@ -1,7 +1,7 @@
From 642f328ff08872289082f591b393aa72cdfffe0a Mon Sep 17 00:00:00 2001
From b31b5aa4e7e890ae079ae2953a1ce3fc2e47b954 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 2 Apr 2024 17:14:42 +0200
Subject: [PATCH 02/13] ipc/server: Always listen to stdin
Subject: [PATCH 02/10] ipc/server: Always listen to stdin
---
src/xrt/ipc/server/ipc_server_mainloop_linux.c | 2 +-
@@ -1,7 +1,7 @@
From a06da2ceeddf3f7760501114efa35bd168ba74bc Mon Sep 17 00:00:00 2001
From 46cacda03c5552ffb70601dd89e0abe38e97c1d3 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 8 Oct 2024 22:13:15 +0200
Subject: [PATCH 03/13] Use extern socket fd
Subject: [PATCH 03/10] Use extern socket fd
---
src/xrt/ipc/server/ipc_server_mainloop_linux.c | 8 ++++++++
@@ -1,7 +1,7 @@
From 4efe5b0e12a92284e46fdeb225102dc63a7eda51 Mon Sep 17 00:00:00 2001
From 90c3842f38985e0f8f06bb51d0e58cccf437526f Mon Sep 17 00:00:00 2001
From: galister <3123227-galister@users.noreply.gitlab.com>
Date: Mon, 19 Aug 2024 18:51:45 +0900
Subject: [PATCH 04/13] c/render: Add storage usage to distortion mesh
Subject: [PATCH 04/10] c/render: Add storage usage to distortion mesh
---
src/xrt/compositor/render/render_distortion.c | 2 +-
@@ -1,7 +1,7 @@
From a28d3e6a3e85b7c04392137b30958e8b1d13c591 Mon Sep 17 00:00:00 2001
From 9e2288bc85a5be9bb0228a42dc5a9419c4357eb8 Mon Sep 17 00:00:00 2001
From: galister <85970-galister@users.noreply.gitlab.freedesktop.org>
Date: Sat, 23 Nov 2024 02:42:12 +0900
Subject: [PATCH 05/13] change environment blend mode selection logic
Subject: [PATCH 05/10] change environment blend mode selection logic
---
src/xrt/compositor/multi/comp_multi_system.c | 26 +++++++++++++-------
@@ -1,7 +1,7 @@
From ec28b5726922e300dc05085a30150223c6a2183a Mon Sep 17 00:00:00 2001
From 437469e6a4de72ab69719cce92b841e4de19156f Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Wed, 11 Sep 2024 22:56:29 +0200
Subject: [PATCH 06/13] Convert to YCbCr in Monado
Subject: [PATCH 06/10] Convert to YCbCr in Monado
---
src/xrt/compositor/main/comp_renderer.c | 6 +-
@@ -17,10 +17,10 @@ Subject: [PATCH 06/13] Convert to YCbCr in Monado
10 files changed, 184 insertions(+), 86 deletions(-)
diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c
index e45d33e22..d2518585c 100644
index c6f589466..0895ff694 100644
--- a/src/xrt/compositor/main/comp_renderer.c
+++ b/src/xrt/compositor/main/comp_renderer.c
@@ -936,7 +936,8 @@ dispatch_compute(struct comp_renderer *r,
@@ -933,7 +933,8 @@ dispatch_compute(struct comp_renderer *r,
// Target Vulkan resources..
VkImage target_image = r->c->target->images[r->acquired_buffer].handle;
@@ -30,7 +30,7 @@ index e45d33e22..d2518585c 100644
// Target view information.
struct render_viewport_data target_viewport_datas[XRT_MAX_VIEWS];
@@ -952,7 +953,8 @@ dispatch_compute(struct comp_renderer *r,
@@ -949,7 +950,8 @@ dispatch_compute(struct comp_renderer *r,
eye_poses, //
fovs, //
target_image, //
@@ -1,7 +1,7 @@
From 022835847793c2b97df20a1dc823512a36533d53 Mon Sep 17 00:00:00 2001
From 5a791919ce1e01f2cb0034e4055bf22767a41121 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Sun, 3 Nov 2024 13:40:00 +0100
Subject: [PATCH 07/13] store alpha channel in layer 1
Subject: [PATCH 07/10] store alpha channel in layer 1
---
src/xrt/compositor/shaders/clear.comp | 4 ++--
@@ -1,7 +1,7 @@
From 0d2ae2efb84f1479151c096e26f3295eded3b170 Mon Sep 17 00:00:00 2001
From 877709160be24c4bd504b8d8cd04197cc2bf2b69 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Thu, 27 Feb 2025 22:45:36 +0100
Subject: [PATCH 08/13] c/main: allow custom pacing app factory
Subject: [PATCH 08/10] c/main: allow custom pacing app factory
---
src/xrt/compositor/main/comp_compositor.c | 10 ++++++----
@@ -1,7 +1,7 @@
From 1a9b288475830fc1caf9bbf340ea370677b239a5 Mon Sep 17 00:00:00 2001
From 53d8509dff69caccecdc38b443864b1a755486dd Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Sat, 15 Mar 2025 22:19:48 +0100
Subject: [PATCH 09/13] st/oxr: forward 0 refresh rate
Subject: [PATCH 09/10] st/oxr: forward 0 refresh rate
---
src/xrt/state_trackers/oxr/oxr_api_session.c | 6 +-----
@@ -1,30 +1,21 @@
From 624849b80a893d073f2315eca909afa823c0a345 Mon Sep 17 00:00:00 2001
From 1bc74f74b613cce9d32c0f4bf16de70ddb7fb482 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Mon, 2 Jun 2025 14:51:11 +0200
Subject: [PATCH 10/13] Replace distortion with pixel-aligned foveation
Subject: [PATCH 10/10] Replace distortion with pixel-aligned foveation
---
src/xrt/compositor/CMakeLists.txt | 4 +-
src/xrt/compositor/render/render_compute.c | 185 ++-----------------
src/xrt/compositor/CMakeLists.txt | 2 +-
src/xrt/compositor/render/render_compute.c | 181 ++-----------------
src/xrt/compositor/render/render_interface.h | 33 ++--
src/xrt/compositor/render/render_resources.c | 71 +------
src/xrt/compositor/shaders/distortion.comp | 167 ++++++-----------
src/xrt/compositor/render/render_resources.c | 71 +-------
src/xrt/compositor/shaders/distortion.comp | 134 ++++----------
src/xrt/compositor/util/comp_render_cs.c | 33 +---
6 files changed, 101 insertions(+), 392 deletions(-)
6 files changed, 76 insertions(+), 378 deletions(-)
diff --git a/src/xrt/compositor/CMakeLists.txt b/src/xrt/compositor/CMakeLists.txt
index 1ba5ec438..eb068f5fc 100644
index 1ba5ec438..f1defe77a 100644
--- a/src/xrt/compositor/CMakeLists.txt
+++ b/src/xrt/compositor/CMakeLists.txt
@@ -105,7 +105,7 @@ if(XRT_HAVE_VULKAN)
spirv_shaders(
SHADER_HEADERS
SPIRV_VERSION
- 1.0 # Currently targeting Vulkan 1.0
+ 1.3 # Currently targeting Vulkan 1.3
SOURCES
${SHADERS}
)
@@ -115,7 +115,7 @@ if(XRT_HAVE_VULKAN)
${SHADER_HEADERS}
render/render_buffer.c
@@ -35,20 +26,9 @@ index 1ba5ec438..eb068f5fc 100644
render/render_interface.h
render/render_resources.c
diff --git a/src/xrt/compositor/render/render_compute.c b/src/xrt/compositor/render/render_compute.c
index fd04801d4..44c3f0aee 100644
index fd04801d4..5cd5a1726 100644
--- a/src/xrt/compositor/render/render_compute.c
+++ b/src/xrt/compositor/render/render_compute.c
@@ -66,8 +66,8 @@ calc_dispatch_dims_views(const struct render_viewport_data views[XRT_MAX_VIEWS],
#undef IMAX
// Power of two divide and round up.
- w = uint_divide_and_round_up(w, 16);
- h = uint_divide_and_round_up(h, 16);
+ w = uint_divide_and_round_up(w, 8);
+ h = uint_divide_and_round_up(h, 8);
*out_w = w;
*out_h = h;
@@ -167,8 +167,8 @@ update_compute_shared_descriptor_set(struct vk_bundle *vk,
VkSampler src_samplers[XRT_MAX_VIEWS],
VkImageView src_image_views[XRT_MAX_VIEWS],
@@ -498,15 +478,10 @@ index 5b9addd59..7d4d9cddb 100644
D(Pipeline, r->compute.clear.pipeline);
diff --git a/src/xrt/compositor/shaders/distortion.comp b/src/xrt/compositor/shaders/distortion.comp
index 9ce46fe6f..cd1828ac9 100644
index 9ce46fe6f..f3be617bd 100644
--- a/src/xrt/compositor/shaders/distortion.comp
+++ b/src/xrt/compositor/shaders/distortion.comp
@@ -4,20 +4,22 @@
#version 460
#extension GL_GOOGLE_include_directive : require
+#extension GL_KHR_shader_subgroup_basic: require
+#extension GL_KHR_shader_subgroup_shuffle: require
@@ -7,17 +7,17 @@
#include "srgb.inc.glsl"
@@ -532,7 +507,7 @@ index 9ce46fe6f..cd1828ac9 100644
layout(set = 0, binding = 2) uniform writeonly restrict image2DArray luma;
layout(set = 0, binding = 3, std140) uniform restrict Config
{
@@ -41,122 +43,59 @@ vec3 rgb_to_ycbcr(vec3 color)
@@ -41,109 +41,40 @@ vec3 rgb_to_ycbcr(vec3 color)
return transpose(color_space) * color + vec3(0, 0.5, 0.5);
}
@@ -618,13 +593,24 @@ index 9ce46fe6f..cd1828ac9 100644
ivec2 extent = ivec2(ubo.views[iz].zw);
- vec2 cbcrs[4];
- vec4 alpha;
- for (int k = 0; k < 2; k += 1) {
- uint iy = gl_GlobalInvocationID.y * 2 + k;
- for (int j = 0; j < 2; j += 1) {
- uint ix = gl_GlobalInvocationID.x * 2 + j;
-
+ vec3 cbcra = vec3(0);
for (int k = 0; k < 2; k += 1) {
uint iy = gl_GlobalInvocationID.y * 2 + k;
+ uint ymin = foveation.y[MAX_DIM * iz + iy];
+ uint ymax = foveation.y[MAX_DIM * iz + iy + 1];
+ if (ymin > ymax)
+ {
+ uint tmp = ymin;
+ ymin = ymax;
+ ymax = tmp;
+ }
for (int j = 0; j < 2; j += 1) {
uint ix = gl_GlobalInvocationID.x * 2 + j;
- vec2 dist_uv = position_to_uv(extent, ix, iy);
-
+ uint xmin = foveation.x[MAX_DIM * iz + ix];
+ uint xmax = foveation.x[MAX_DIM * iz + ix + 1];
- vec2 uv = texture(distortion[iz + 0], dist_uv).xy;
- vec2 lod = texture(distortion[iz + 2], dist_uv).xy;
-
@@ -635,68 +621,35 @@ index 9ce46fe6f..cd1828ac9 100644
- vec4 colour = textureLod(source[iz], uv, mix(lod.x, lod.y, 0.5));
-
- colour.rgb = rgb_to_ycbcr(from_linear_to_srgb(colour.rgb));
+ uint iy = gl_GlobalInvocationID.y;
+ uint ymin = foveation.y[MAX_DIM * iz + iy];
+ uint ymax = foveation.y[MAX_DIM * iz + iy + 1];
+ if (ymin == ymax)
+ return;
+ if (ymin > ymax)
+ {
+ uint tmp = ymin;
+ ymin = ymax;
+ ymax = tmp;
+ }
+ uint ix = gl_GlobalInvocationID.x;
+ vec4 colour = vec4(0);
+ for (uint y = ymin ; y < ymax; y += 1) {
+ for (uint x = xmin ; x < xmax; x += 1) {
+ colour += texelFetch(source[iz], ivec2(x, y), 0);
+ }
+ }
+ colour /= (xmax - xmin) * (ymax - ymin);
+ colour.xyz = rgb_to_ycbcr(from_linear_to_srgb(colour.rgb));
- int i = k * 2 + j;
- cbcrs[i] = colour.yz;
- alpha[i] = colour.a;
+ uint xmin = foveation.x[MAX_DIM * iz + ix];
+ uint xmax = foveation.x[MAX_DIM * iz + ix + 1];
+ if (xmin == xmax)
+ return;
+ cbcra.xy += colour.yz;
+ cbcra.z += colour.a;
- if (ix < extent.x && iy < extent.y) {
- imageStore(luma, ivec3(offset.x + ix, offset.y + iy, 0), vec4(colour.x));
- }
+ vec4 colour = vec4(0);
+ for (uint y = ymin ; y < ymax; y += 1) {
+ for (uint x = xmin ; x < xmax; x += 1) {
+ colour += texelFetch(source[iz], ivec2(x, y), 0);
}
}
- if (gl_GlobalInvocationID.x >= extent.x || gl_GlobalInvocationID.y >= extent.y) {
- return;
+ colour /= (xmax - xmin) * (ymax - ymin);
+ colour.xyz = rgb_to_ycbcr(from_linear_to_srgb(colour.rgb));
+
+ imageStore(luma, ivec3(offset.x + ix, offset.y + iy, 0), vec4(colour.x));
+
+ vec4 sum = colour;
+ for (uint i = 0 ; i < gl_SubgroupSize; ++i)
+ {
+ uvec3 other = subgroupShuffle(gl_GlobalInvocationID, i);
+ vec4 c = subgroupShuffle(colour, i);
+ if (
+ other == gl_GlobalInvocationID + uvec3(1, 0, 0)
+ || other == gl_GlobalInvocationID + uvec3(0, 1, 0)
+ || other == gl_GlobalInvocationID + uvec3(1, 1, 0))
+ {
+ sum += c;
+ }
if (ix < extent.x && iy < extent.y) {
imageStore(luma, ivec3(offset.x + ix, offset.y + iy, 0), vec4(colour.x));
@@ -153,10 +84,7 @@ void main()
if (gl_GlobalInvocationID.x >= extent.x || gl_GlobalInvocationID.y >= extent.y) {
return;
}
- vec2 cbcr = mix(mix(cbcrs[0], cbcrs[1], 0.5), mix(cbcrs[2], cbcrs[3], 0.5), 0.5);
- imageStore(chroma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 0), vec4(cbcr.x, cbcr.y, 0, 0));
- imageStore(chroma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 1), vec4(0.5, 0.5, 0, 0));
-
+ imageStore(chroma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 0), vec4(cbcra.x, cbcra.y, 0, 0) / 4);
+ imageStore(luma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 1), vec4(cbcra.z, 0, 0, 0) / 4);
imageStore(chroma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 1), vec4(0.5, 0.5, 0, 0));
- alpha = vec4(mix(mix(alpha[0], alpha[1], 0.5), mix(alpha[2], alpha[3], 0.5), 0.5));
- imageStore(luma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy, 1), alpha);
+ if (ix %2 == 0 && iy %2 == 0)
+ {
+ imageStore(chroma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy/2, 0), vec4(sum.y, sum.z, 0, 0) / 4);
+ imageStore(luma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy/2, 1), vec4(sum.w, 0, 0, 0) / 4);
+ imageStore(chroma, ivec3(offset.xy/2 + gl_GlobalInvocationID.xy/2, 1), vec4(0.5, 0.5, 0, 0));
+ }
}
diff --git a/src/xrt/compositor/util/comp_render_cs.c b/src/xrt/compositor/util/comp_render_cs.c
index b2d3ce10d..69429dc97 100644
@@ -1,64 +0,0 @@
From 34699c38c4ebb5c968b4e1053ddbf48b31dbe72d Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 5 Aug 2025 15:51:48 +0200
Subject: [PATCH 11/13] a/vk: Track VK_KHR_video_maintenance1
---
scripts/generate_vk_helpers.py | 1 +
src/xrt/auxiliary/vk/vk_bundle_init.c | 8 ++++++++
src/xrt/auxiliary/vk/vk_helpers.h | 1 +
3 files changed, 10 insertions(+)
diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py
index 330b1b05e..80902193a 100755
--- a/scripts/generate_vk_helpers.py
+++ b/scripts/generate_vk_helpers.py
@@ -307,6 +307,7 @@ DEVICE_EXTENSIONS_TO_CHECK = [
"VK_KHR_present_wait",
"VK_KHR_synchronization2",
"VK_KHR_timeline_semaphore",
+ "VK_KHR_video_maintenance1",
"VK_EXT_calibrated_timestamps",
"VK_EXT_display_control",
"VK_EXT_external_memory_dma_buf",
diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c
index f28f7591f..b435d73dd 100644
--- a/src/xrt/auxiliary/vk/vk_bundle_init.c
+++ b/src/xrt/auxiliary/vk/vk_bundle_init.c
@@ -754,6 +754,7 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li
vk->has_KHR_present_wait = false;
vk->has_KHR_synchronization2 = false;
vk->has_KHR_timeline_semaphore = false;
+ vk->has_KHR_video_maintenance1 = false;
vk->has_EXT_calibrated_timestamps = false;
vk->has_EXT_display_control = false;
vk->has_EXT_external_memory_dma_buf = false;
@@ -868,6 +869,13 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li
}
#endif // defined(VK_KHR_timeline_semaphore)
+#if defined(VK_KHR_video_maintenance1)
+ if (strcmp(ext, VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME) == 0) {
+ vk->has_KHR_video_maintenance1 = true;
+ continue;
+ }
+#endif // defined(VK_KHR_video_maintenance1)
+
#if defined(VK_EXT_calibrated_timestamps)
if (strcmp(ext, VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME) == 0) {
vk->has_EXT_calibrated_timestamps = true;
diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h
index 896b597d4..3b5cbb9c8 100644
--- a/src/xrt/auxiliary/vk/vk_helpers.h
+++ b/src/xrt/auxiliary/vk/vk_helpers.h
@@ -142,6 +142,7 @@ struct vk_bundle
bool has_KHR_present_wait;
bool has_KHR_synchronization2;
bool has_KHR_timeline_semaphore;
+ bool has_KHR_video_maintenance1;
bool has_EXT_calibrated_timestamps;
bool has_EXT_display_control;
bool has_EXT_external_memory_dma_buf;
--
2.50.1
@@ -1,134 +0,0 @@
From 2300c7509699db2a59e4bd0eee33890a2d906156 Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 5 Aug 2025 16:00:59 +0200
Subject: [PATCH 12/13] a/vk: Expose video_maintenance_1 device feature
---
src/xrt/auxiliary/vk/vk_bundle_init.c | 40 +++++++++++++++++++++++++--
src/xrt/auxiliary/vk/vk_helpers.h | 4 +++
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c
index b435d73dd..501cd6f3c 100644
--- a/src/xrt/auxiliary/vk/vk_bundle_init.c
+++ b/src/xrt/auxiliary/vk/vk_bundle_init.c
@@ -1098,6 +1098,13 @@ filter_device_features(struct vk_bundle *vk,
};
#endif
+#ifdef VK_KHR_video_maintenance1
+ VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maintenance_1_info = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR,
+ .pNext = NULL,
+ };
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ext_fmt_resolve_info = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID,
@@ -1148,6 +1155,13 @@ filter_device_features(struct vk_bundle *vk,
}
#endif
+#ifdef VK_KHR_video_maintenance1
+ if (vk->has_KHR_video_maintenance1) {
+ vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features,
+ (VkBaseInStructure *)&video_maintenance_1_info);
+ }
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
if (vk->has_ANDROID_external_format_resolve) {
vk_append_to_pnext_chain((VkBaseInStructure *)&physical_device_features,
@@ -1187,6 +1201,10 @@ filter_device_features(struct vk_bundle *vk,
CHECK(synchronization_2, synchronization_2_info.synchronization2);
#endif
+#ifdef VK_KHR_video_maintenance1
+ CHECK(video_maintenance_1, video_maintenance_1_info.videoMaintenance1);
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
CHECK(ext_fmt_resolve, ext_fmt_resolve_info.externalFormatResolve);
#endif
@@ -1207,14 +1225,16 @@ filter_device_features(struct vk_bundle *vk,
"\n\tshader_storage_image_write_without_format: %i"
"\n\tstorage_buffer_8bit_access: %i"
"\n\tsynchronization_2: %i"
- "\n\ttimeline_semaphore: %i", //
+ "\n\ttimeline_semaphore: %i"
+ "\n\tvideo_maintenance_1: %i", //
device_features->ext_fmt_resolve, //
device_features->null_descriptor, //
device_features->shader_image_gather_extended, //
device_features->shader_storage_image_write_without_format, //
device_features->storage_buffer_8bit_access, //
device_features->synchronization_2, //
- device_features->timeline_semaphore); //
+ device_features->timeline_semaphore, //
+ device_features->video_maintenance_1); //
}
@@ -1262,6 +1282,7 @@ vk_create_device(struct vk_bundle *vk,
vk->features.timeline_semaphore = device_features.timeline_semaphore;
vk->features.synchronization_2 = device_features.synchronization_2;
vk->features.present_wait = device_features.present_wait;
+ vk->features.video_maintenance_1 = device_features.video_maintenance_1;
/*
@@ -1384,6 +1405,14 @@ vk_create_device(struct vk_bundle *vk,
};
#endif
+#ifdef VK_KHR_video_maintenance1
+ VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maintenance_1_info = {
+ .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR,
+ .pNext = NULL,
+ .videoMaintenance1 = device_features.video_maintenance_1,
+ };
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
VkPhysicalDeviceExternalFormatResolveFeaturesANDROID ext_fmt_resolve_info = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FORMAT_RESOLVE_FEATURES_ANDROID,
@@ -1444,6 +1473,13 @@ vk_create_device(struct vk_bundle *vk,
}
#endif
+#ifdef VK_KHR_video_maintenance1
+ if (vk->has_KHR_video_maintenance1) {
+ vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info,
+ (VkBaseInStructure *)&video_maintenance_1_info);
+ }
+#endif
+
#ifdef VK_ANDROID_external_format_resolve
if (vk->has_ANDROID_external_format_resolve) {
vk_append_to_pnext_chain((VkBaseInStructure *)&device_create_info,
diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h
index 3b5cbb9c8..748c06dac 100644
--- a/src/xrt/auxiliary/vk/vk_helpers.h
+++ b/src/xrt/auxiliary/vk/vk_helpers.h
@@ -179,6 +179,9 @@ struct vk_bundle
//! Was KHR_present_wait requested, available, and enabled?
bool present_wait;
+
+ //! Was KHR_video_maintenance1 requested, available, and enabled?
+ bool video_maintenance_1;
} features;
//! Is the GPU a tegra device.
@@ -1030,6 +1033,7 @@ struct vk_device_features
bool ext_fmt_resolve;
bool storage_buffer_8bit_access;
bool present_wait;
+ bool video_maintenance_1;
};
/*!
--
2.50.1
@@ -1,26 +0,0 @@
From 8c874368dfaa363e088e91c05adf2a96f921671d Mon Sep 17 00:00:00 2001
From: Patrick Nicolas <patricknicolas@laposte.net>
Date: Tue, 5 Aug 2025 16:01:59 +0200
Subject: [PATCH 13/13] c/util: Request video_maintenance_1 feature
This will only be enabled if the VK_KHR_maintenance1 extension was
requested.
---
src/xrt/compositor/util/comp_vulkan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/xrt/compositor/util/comp_vulkan.c b/src/xrt/compositor/util/comp_vulkan.c
index 5618f4f78..9c719275c 100644
--- a/src/xrt/compositor/util/comp_vulkan.c
+++ b/src/xrt/compositor/util/comp_vulkan.c
@@ -282,6 +282,7 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args)
.timeline_semaphore = vk_args->timeline_semaphore,
.synchronization_2 = true,
.present_wait = true,
+ .video_maintenance_1 = true,
};
ret = vk_init_mutex(vk);
--
2.50.1