-
-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux: Use Vulkan/CUDA interop in NVENC encoder (#1911)
It now does direct VkImage copy into CUDA memory instead of doing the transfer via system memory. Added FFmpeg patch to fix importing RGBx Vulkan frames, RGBx needs NumChannels = 4, but FFmpeg would use NumChannels = 1. Co-authored-by: Rafal Kolanski <[email protected]>
- Loading branch information
Showing
9 changed files
with
138 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
alvr/xtask/patches/0001-lavu-hwcontext_vulkan-Fix-importing-RGBx-frames-to-C.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From f867c4c56ee75d633db2300c0822bfa0020a056e Mon Sep 17 00:00:00 2001 | ||
From: David Rosca <[email protected]> | ||
Date: Tue, 28 Nov 2023 14:04:20 +0100 | ||
Subject: [PATCH] lavu/hwcontext_vulkan: Fix importing RGBx frames to CUDA | ||
|
||
RGBx formats needs NumChannels = 4, but the old code would set it to 1. | ||
--- | ||
libavutil/hwcontext_vulkan.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c | ||
index 204b57c011..e3bd6ace9b 100644 | ||
--- a/libavutil/hwcontext_vulkan.c | ||
+++ b/libavutil/hwcontext_vulkan.c | ||
@@ -2859,7 +2859,7 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc, | ||
.arrayDesc = { | ||
.Depth = 0, | ||
.Format = cufmt, | ||
- .NumChannels = 1 + ((planes == 2) && i), | ||
+ .NumChannels = desc->comp[i].step, | ||
.Flags = 0, | ||
}, | ||
.numLevels = 1, | ||
-- | ||
2.43.0 | ||
|