mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
d3d12: implementation for get_resources()
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23159>
This commit is contained in:
parent
e4389fe0ee
commit
025dcbea66
2 changed files with 35 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ d3d12_video_buffer_create_impl(struct pipe_context *pipe,
|
|||
|
||||
// Fill vtable
|
||||
pD3D12VideoBuffer->base.destroy = d3d12_video_buffer_destroy;
|
||||
pD3D12VideoBuffer->base.get_resources = d3d12_video_buffer_resources;
|
||||
pD3D12VideoBuffer->base.get_sampler_view_planes = d3d12_video_buffer_get_sampler_view_planes;
|
||||
pD3D12VideoBuffer->base.get_sampler_view_components = d3d12_video_buffer_get_sampler_view_components;
|
||||
pD3D12VideoBuffer->base.get_surfaces = d3d12_video_buffer_get_surfaces;
|
||||
|
|
@ -233,6 +234,32 @@ error:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* get an individual resource for each plane,
|
||||
* only returns existing resources by reference
|
||||
*/
|
||||
void
|
||||
d3d12_video_buffer_resources(struct pipe_video_buffer *buffer,
|
||||
struct pipe_resource **resources)
|
||||
{
|
||||
struct d3d12_video_buffer *pD3D12VideoBuffer = (struct d3d12_video_buffer *) buffer;
|
||||
assert(pD3D12VideoBuffer);
|
||||
|
||||
// pCurPlaneResource refers to the planar resource, not the overall resource.
|
||||
// in d3d12_resource this is handled by having a linked list of planes with
|
||||
// d3dRes->base.next ptr to next plane resource
|
||||
// starting with the plane 0 being the overall resource
|
||||
struct pipe_resource *pCurPlaneResource = &pD3D12VideoBuffer->texture->base.b;
|
||||
|
||||
for (uint i = 0; i < pD3D12VideoBuffer->num_planes; ++i) {
|
||||
assert(pCurPlaneResource); // the d3d12_resource has a linked list with the exact name of number of elements
|
||||
// as planes
|
||||
|
||||
resources[i] = pCurPlaneResource;
|
||||
pCurPlaneResource = pCurPlaneResource->next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get an individual sampler view for each plane
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -53,6 +53,14 @@ d3d12_video_buffer_from_handle( struct pipe_context *pipe,
|
|||
void
|
||||
d3d12_video_buffer_destroy(struct pipe_video_buffer *buffer);
|
||||
|
||||
/**
|
||||
* get an individual resource for each plane,
|
||||
* only returns existing resources by reference
|
||||
*/
|
||||
void
|
||||
d3d12_video_buffer_resources(struct pipe_video_buffer *buffer,
|
||||
struct pipe_resource **resources);
|
||||
|
||||
/**
|
||||
* get an individual sampler view for each plane
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue