radv/video: Implement VK_VALVE_video_encode_rgb_conversion
This is used by Steam Link VR (driver_vrlink) to avoid doing YUV conversion itself. Signed-off-by: Autumn Ashton <misyl@froggi.es> Reviewed-by: David Rosca <david.rosca@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37500>
This commit is contained in:
@@ -108,6 +108,8 @@ vk_video_session_init(struct vk_device *device,
|
||||
vk_find_struct_const(create_info->pVideoProfile->pNext, VIDEO_ENCODE_USAGE_INFO_KHR);
|
||||
const struct VkVideoEncodeSessionIntraRefreshCreateInfoKHR *intra_refresh =
|
||||
vk_find_struct_const(create_info->pNext, VIDEO_ENCODE_SESSION_INTRA_REFRESH_CREATE_INFO_KHR);
|
||||
const struct VkVideoEncodeProfileRgbConversionInfoVALVE *rgb_profile_info =
|
||||
vk_find_struct_const(create_info->pVideoProfile->pNext, VIDEO_ENCODE_PROFILE_RGB_CONVERSION_INFO_VALVE);
|
||||
if (encode_usage_profile) {
|
||||
vid->enc_usage.video_usage_hints = encode_usage_profile->videoUsageHints;
|
||||
vid->enc_usage.video_content_hints = encode_usage_profile->videoContentHints;
|
||||
@@ -119,6 +121,16 @@ vk_video_session_init(struct vk_device *device,
|
||||
}
|
||||
if (intra_refresh)
|
||||
vid->intra_refresh_mode = intra_refresh->intraRefreshMode;
|
||||
if (rgb_profile_info && rgb_profile_info->performEncodeRgbConversion) {
|
||||
const struct VkVideoEncodeSessionRgbConversionCreateInfoVALVE *rgb_info =
|
||||
vk_find_struct_const(create_info->pNext, VIDEO_ENCODE_SESSION_RGB_CONVERSION_CREATE_INFO_VALVE);
|
||||
|
||||
vid->perform_rgb_conversion = true;
|
||||
vid->rgb_conv.rgb_model = rgb_info->rgbModel;
|
||||
vid->rgb_conv.rgb_range = rgb_info->rgbRange;
|
||||
vid->rgb_conv.x_chroma_offset = rgb_info->xChromaOffset;
|
||||
vid->rgb_conv.y_chroma_offset = rgb_info->yChromaOffset;
|
||||
}
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
||||
@@ -91,6 +91,14 @@ struct vk_video_session {
|
||||
uint32_t max_active_ref_pics;
|
||||
VkVideoEncodeIntraRefreshModeFlagBitsKHR intra_refresh_mode;
|
||||
|
||||
bool perform_rgb_conversion;
|
||||
struct {
|
||||
VkVideoEncodeRgbModelConversionFlagBitsVALVE rgb_model;
|
||||
VkVideoEncodeRgbRangeCompressionFlagBitsVALVE rgb_range;
|
||||
VkVideoEncodeRgbChromaOffsetFlagBitsVALVE x_chroma_offset;
|
||||
VkVideoEncodeRgbChromaOffsetFlagBitsVALVE y_chroma_offset;
|
||||
} rgb_conv;
|
||||
|
||||
struct {
|
||||
VkVideoEncodeUsageFlagsKHR video_usage_hints;
|
||||
VkVideoEncodeContentFlagsKHR video_content_hints;
|
||||
|
||||
Reference in New Issue
Block a user