[host] d12: implement initial RGB24 support

This commit is contained in:
Geoffrey McRae
2024-02-02 02:37:17 +11:00
parent 4076377820
commit 60b01566e1
10 changed files with 704 additions and 89 deletions

View File

@@ -24,6 +24,8 @@
#include "com_ref.h"
#include "interface/capture.h"
#include <d3d12.h>
extern ComScope * d12_comScope;
#define comRef_toGlobal(dst, src) \
_comRef_toGlobal(d12_comScope, dst, src)
@@ -33,4 +35,72 @@ extern ComScope * d12_comScope;
void d12_updatePointer(
CapturePointer * pointer, void * shape, size_t shapeSize);
// DirectX12 library functions
struct DX12
{
PFN_D3D12_CREATE_DEVICE D3D12CreateDevice;
PFN_D3D12_GET_DEBUG_INTERFACE D3D12GetDebugInterface;
PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE
D3D12SerializeVersionedRootSignature;
};
extern struct DX12 DX12;
#ifdef ID3D12Heap_GetDesc
#undef ID3D12Heap_GetDesc
static inline D3D12_HEAP_DESC ID3D12Heap_GetDesc(ID3D12Heap* This)
{
D3D12_HEAP_DESC __ret;
return *This->lpVtbl->GetDesc(This, &__ret);
}
#endif
#ifdef ID3D12Resource_GetDesc
#undef ID3D12Resource_GetDesc
static inline D3D12_RESOURCE_DESC ID3D12Resource_GetDesc(ID3D12Resource* This) {
D3D12_RESOURCE_DESC __ret;
return *This->lpVtbl->GetDesc(This,&__ret);
}
#endif
#ifndef ID3DBlob_GetBufferPointer
#define ID3DBlob_GetBufferPointer ID3D10Blob_GetBufferPointer
#endif
#ifndef ID3DBlob_GetBufferSize
#define ID3DBlob_GetBufferSize ID3D10Blob_GetBufferSize
#endif
#ifdef ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart
#undef ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart
static inline D3D12_CPU_DESCRIPTOR_HANDLE
ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(
ID3D12DescriptorHeap* This)
{
D3D12_CPU_DESCRIPTOR_HANDLE __ret;
return *This->lpVtbl->GetCPUDescriptorHandleForHeapStart(This,&__ret);
}
#endif
#ifdef ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart
#undef ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart
static inline D3D12_GPU_DESCRIPTOR_HANDLE
ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(
ID3D12DescriptorHeap* This)
{
D3D12_GPU_DESCRIPTOR_HANDLE __ret;
return *This->lpVtbl->GetGPUDescriptorHandleForHeapStart(This,&__ret);
}
#endif
#ifdef ID3D12Resource_GetDesc
#undef ID3D12Resource_GetDesc
static inline D3D12_RESOURCE_DESC ID3D12Resource_GetDesc(ID3D12Resource* This)
{
D3D12_RESOURCE_DESC __ret;
return *This->lpVtbl->GetDesc(This,&__ret);
}
#endif
#endif