From 03d4ec7321c89ae3388601c86d3ec79c9311843f Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 25 Jun 2024 09:56:06 +0200 Subject: [PATCH] gallium: Add is_video_target_buffer_supported This will be used to replace PIPE_VIDEO_CAP_EFC_SUPPORTED. Reviewed-by: Thong Thai Part-of: --- src/gallium/include/pipe/p_screen.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index ff2253f2a30..1f8a956f724 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -66,6 +66,7 @@ struct driOptionCache; struct u_transfer_helper; struct pipe_screen; struct util_queue_fence; +struct pipe_video_buffer; typedef struct pipe_vertex_state * (*pipe_create_vertex_state_func)(struct pipe_screen *screen, @@ -843,6 +844,24 @@ struct pipe_screen { bool (*is_compression_modifier)(struct pipe_screen *screen, enum pipe_format format, uint64_t modifier, uint32_t *rate); + + /** + * Check if the given \p target buffer is supported as output (or input for + * encode) for this \p profile and \p entrypoint. + * + * If \p format is different from target->buffer_format this function + * checks if the \p target buffer can be converted to \p format as part + * of the given operation (eg. encoder accepts RGB input and converts + * it to YUV). + * + * \return true if the buffer is supported for given operation, false + * otherwise. + */ + bool (*is_video_target_buffer_supported)(struct pipe_screen *screen, + enum pipe_format format, + struct pipe_video_buffer *target, + enum pipe_video_profile profile, + enum pipe_video_entrypoint entrypoint); };