[host] d12: pass frame information in a description structure

This commit is contained in:
Geoffrey McRae
2024-02-28 07:30:39 +11:00
parent c7f1aadb9e
commit 5c4540ed8b
3 changed files with 33 additions and 36 deletions

View File

@@ -29,6 +29,8 @@
typedef struct D12Backend D12Backend;
typedef struct D12FetchDesc D12FetchDesc;
struct D12Backend
{
// friendly name
@@ -58,12 +60,15 @@ struct D12Backend
CaptureResult (*sync)(D12Backend * instance,
ID3D12CommandQueue * commandQueue);
ID3D12Resource * (*fetch)(
D12Backend * instance,
unsigned frameBufferIndex,
RECT ** dirtyRects,
unsigned * nbDirtyRects,
CaptureRotation * rotation);
ID3D12Resource * (*fetch)(D12Backend * instance, unsigned frameBufferIndex,
D12FetchDesc * meta);
};
struct D12FetchDesc
{
CaptureRotation rotation;
RECT * dirtyRects;
unsigned nbDirtyRects;
};
static inline bool d12_backendCreate(const D12Backend * backend,
@@ -98,10 +103,8 @@ static inline CaptureResult d12_backendSync(D12Backend * instance,
{ return instance->sync(instance, commandQueue); }
static inline ID3D12Resource * d12_backendFetch(D12Backend * instance,
unsigned frameBufferIndex, RECT ** dirtyRects, unsigned * nbDirtyRects,
CaptureRotation * rotation)
{ return instance->fetch(instance, frameBufferIndex, dirtyRects,
nbDirtyRects, rotation); }
unsigned frameBufferIndex, D12FetchDesc * desc)
{ return instance->fetch(instance, frameBufferIndex, desc); }
// Backend defines