From 484eeb762e02ee627f042cb23daac9757747de7e Mon Sep 17 00:00:00 2001 From: Silvio Vilerino Date: Sat, 25 Oct 2025 12:33:27 -0400 Subject: [PATCH] d3d12: Support d3d12_video_buffer_creation_mode::place_on_resource in d3d12_video_buffer_from_handle Reviewed-by: Pohsiang (John) Hsu Reviewed-by: Yubo Xie Part-of: --- src/gallium/drivers/d3d12/d3d12_video_buffer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp b/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp index 51bfab40a00..44aa326c637 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp @@ -160,6 +160,12 @@ d3d12_video_buffer_from_handle(struct pipe_context *pipe, struct winsys_handle *handle, unsigned usage) { + if (handle && handle->type == WINSYS_HANDLE_TYPE_D3D12_RES && handle->modifier == 2) // modifier==2 means "place on resource" + { + struct pipe_resource* resource = (struct pipe_resource*) handle->com_obj; + return d3d12_video_buffer_create_impl(pipe, tmpl, resource, d3d12_video_buffer_creation_mode::place_on_resource, NULL, 0); + } + struct pipe_video_buffer updated_template = {}; if ((handle->format == PIPE_FORMAT_NONE) || (tmpl == nullptr) || (tmpl->buffer_format == PIPE_FORMAT_NONE) || (tmpl->width == 0) || (tmpl->height == 0)) {