d3d12: Support d3d12_video_buffer_creation_mode::place_on_resource in d3d12_video_buffer_from_handle

Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Reviewed-by: Yubo Xie <yuboxie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38144>
This commit is contained in:
Silvio Vilerino 2025-10-25 12:33:27 -04:00 committed by Marge Bot
parent e55b2b5064
commit 484eeb762e

View file

@ -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)) {