* [FFmpeg-devel] [PATCH 1/3] lavu/hwcontext_vulkan: check for encode/decode queue extensions
@ 2023-02-04 23:17 rcombs
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 2/3] configure: check for vulkan beta extension support rcombs
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present rcombs
0 siblings, 2 replies; 4+ messages in thread
From: rcombs @ 2023-02-04 23:17 UTC (permalink / raw)
To: ffmpeg-devel
These are currently beta features, and aren't always present.
---
libavutil/hwcontext_vulkan.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 2a9b5f4aac..589a7a7d9a 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -954,8 +954,16 @@ static int setup_queue_families(AVHWDeviceContext *ctx, VkDeviceCreateInfo *cd)
((qf[i].queueFlags) & VK_QUEUE_GRAPHICS_BIT) ? " graphics" : "",
((qf[i].queueFlags) & VK_QUEUE_COMPUTE_BIT) ? " compute" : "",
((qf[i].queueFlags) & VK_QUEUE_TRANSFER_BIT) ? " transfer" : "",
+#ifdef VK_KHR_video_encode_queue
((qf[i].queueFlags) & VK_QUEUE_VIDEO_ENCODE_BIT_KHR) ? " encode" : "",
+#else
+ "",
+#endif
+#ifdef VK_KHR_video_decode_queue
((qf[i].queueFlags) & VK_QUEUE_VIDEO_DECODE_BIT_KHR) ? " decode" : "",
+#else
+ "",
+#endif
((qf[i].queueFlags) & VK_QUEUE_SPARSE_BINDING_BIT) ? " sparse" : "",
((qf[i].queueFlags) & VK_QUEUE_PROTECTED_BIT) ? " protected" : "",
qf[i].queueCount);
@@ -969,8 +977,16 @@ static int setup_queue_families(AVHWDeviceContext *ctx, VkDeviceCreateInfo *cd)
graph_index = pick_queue_family(qf, num, VK_QUEUE_GRAPHICS_BIT);
comp_index = pick_queue_family(qf, num, VK_QUEUE_COMPUTE_BIT);
tx_index = pick_queue_family(qf, num, VK_QUEUE_TRANSFER_BIT);
+#ifdef VK_KHR_video_encode_queue
enc_index = pick_queue_family(qf, num, VK_QUEUE_VIDEO_ENCODE_BIT_KHR);
+#else
+ enc_index = -1;
+#endif
+#ifdef VK_KHR_video_decode_queue
dec_index = pick_queue_family(qf, num, VK_QUEUE_VIDEO_DECODE_BIT_KHR);
+#else
+ dec_index = -1;
+#endif
/* Signalling the transfer capabilities on a queue family is optional */
if (tx_index < 0) {
--
2.39.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH 2/3] configure: check for vulkan beta extension support
2023-02-04 23:17 [FFmpeg-devel] [PATCH 1/3] lavu/hwcontext_vulkan: check for encode/decode queue extensions rcombs
@ 2023-02-04 23:17 ` rcombs
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present rcombs
1 sibling, 0 replies; 4+ messages in thread
From: rcombs @ 2023-02-04 23:17 UTC (permalink / raw)
To: ffmpeg-devel
Some systems (e.g. android) provide vulkan.h, but not vulkan_beta.h.
In that case, compiling vulkan.h with VK_ENABLE_BETA_EXTENSIONS enabled
will result in a preprocessor error. We can check for this up-front.
---
configure | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure b/configure
index d67855c729..8c7311ce74 100755
--- a/configure
+++ b/configure
@@ -2408,6 +2408,7 @@ HAVE_LIST="
perl
pod2man
texi2html
+ vulkan_beta
xmllint
zlib_gzip
"
@@ -7008,6 +7009,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.
if enabled vulkan; then
check_pkg_config_header_only vulkan "vulkan >= 1.2.189" "vulkan/vulkan.h" "defined VK_VERSION_1_2" ||
check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_3) || (defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 189)"
+ test_cflags_cc "-DVK_ENABLE_BETA_EXTENSIONS" "vulkan/vulkan.h" "1" &&
+ enable vulkan_beta
fi
if enabled x86; then
--
2.39.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present
2023-02-04 23:17 [FFmpeg-devel] [PATCH 1/3] lavu/hwcontext_vulkan: check for encode/decode queue extensions rcombs
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 2/3] configure: check for vulkan beta extension support rcombs
@ 2023-02-04 23:17 ` rcombs
2023-02-05 5:38 ` Lynne
1 sibling, 1 reply; 4+ messages in thread
From: rcombs @ 2023-02-04 23:17 UTC (permalink / raw)
To: ffmpeg-devel
Fixes build on systems where vulkan_beta.h is absent (e.g. Android)
---
libavutil/hwcontext_vulkan.c | 5 ++++-
libavutil/vulkan_functions.h | 4 ++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 589a7a7d9a..67802a850d 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -16,8 +16,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+
#define VK_NO_PROTOTYPES
+#if HAVE_VULKAN_BETA
#define VK_ENABLE_BETA_EXTENSIONS
+#endif
#ifdef _WIN32
#include <windows.h> /* Included to prevent conflicts with CreateSemaphore */
@@ -29,7 +33,6 @@
#include <unistd.h>
-#include "config.h"
#include "pixdesc.h"
#include "avstring.h"
#include "imgutils.h"
diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h
index d15a5d9a42..4d80322540 100644
--- a/libavutil/vulkan_functions.h
+++ b/libavutil/vulkan_functions.h
@@ -19,8 +19,12 @@
#ifndef AVUTIL_VULKAN_FUNCTIONS_H
#define AVUTIL_VULKAN_FUNCTIONS_H
+#include "config.h"
+
#define VK_NO_PROTOTYPES
+#if HAVE_VULKAN_BETA
#define VK_ENABLE_BETA_EXTENSIONS
+#endif
#include "hwcontext.h"
#include "hwcontext_vulkan.h"
--
2.39.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present rcombs
@ 2023-02-05 5:38 ` Lynne
0 siblings, 0 replies; 4+ messages in thread
From: Lynne @ 2023-02-05 5:38 UTC (permalink / raw)
To: FFmpeg development discussions and patches
5 Feb 2023, 00:17 by rcombs@rcombs.me:
> Fixes build on systems where vulkan_beta.h is absent (e.g. Android)
> ---
> libavutil/hwcontext_vulkan.c | 5 ++++-
> libavutil/vulkan_functions.h | 4 ++++
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
> index 589a7a7d9a..67802a850d 100644
> --- a/libavutil/hwcontext_vulkan.c
> +++ b/libavutil/hwcontext_vulkan.c
> @@ -16,8 +16,12 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> +#include "config.h"
> +
> #define VK_NO_PROTOTYPES
> +#if HAVE_VULKAN_BETA
> #define VK_ENABLE_BETA_EXTENSIONS
> +#endif
>
> #ifdef _WIN32
> #include <windows.h> /* Included to prevent conflicts with CreateSemaphore */
> @@ -29,7 +33,6 @@
>
> #include <unistd.h>
>
> -#include "config.h"
> #include "pixdesc.h"
> #include "avstring.h"
> #include "imgutils.h"
> diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h
> index d15a5d9a42..4d80322540 100644
> --- a/libavutil/vulkan_functions.h
> +++ b/libavutil/vulkan_functions.h
> @@ -19,8 +19,12 @@
> #ifndef AVUTIL_VULKAN_FUNCTIONS_H
> #define AVUTIL_VULKAN_FUNCTIONS_H
>
> +#include "config.h"
> +
> #define VK_NO_PROTOTYPES
> +#if HAVE_VULKAN_BETA
> #define VK_ENABLE_BETA_EXTENSIONS
> +#endif
>
> #include "hwcontext.h"
> #include "hwcontext_vulkan.h"
> --
> 2.39.1
>
I've fixed this and a few other issues in my vulkan branch.
Could this wait a little longer until it's merged?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-05 5:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 23:17 [FFmpeg-devel] [PATCH 1/3] lavu/hwcontext_vulkan: check for encode/decode queue extensions rcombs
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 2/3] configure: check for vulkan beta extension support rcombs
2023-02-04 23:17 ` [FFmpeg-devel] [PATCH 3/3] lavu/vulkan: only request beta extensions if we detected they're present rcombs
2023-02-05 5:38 ` Lynne
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git