#pragma once
#include "IUnityInterface.h"
#ifndef __cplusplus
#include <stdbool.h>
#endif
struct RenderSurfaceBase;
typedef struct RenderSurfaceBase* UnityRenderBuffer;
typedef struct UnityGraphicsD3D12ResourceState UnityGraphicsD3D12ResourceState;
struct UnityGraphicsD3D12ResourceState
{
ID3D12Resource* resource; D3D12_RESOURCE_STATES expected; D3D12_RESOURCE_STATES current; };
struct UnityGraphicsD3D12RecordingState
{
ID3D12GraphicsCommandList* commandList; };
enum UnityD3D12GraphicsQueueAccess
{
kUnityD3D12GraphicsQueueAccess_DontCare,
kUnityD3D12GraphicsQueueAccess_Allow,
};
enum UnityD3D12EventConfigFlagBits
{
kUnityD3D12EventConfigFlag_EnsurePreviousFrameSubmission = (1 << 0), kUnityD3D12EventConfigFlag_FlushCommandBuffers = (1 << 1), kUnityD3D12EventConfigFlag_SyncWorkerThreads = (1 << 2), kUnityD3D12EventConfigFlag_ModifiesCommandBuffersState = (1 << 3), };
struct UnityD3D12PluginEventConfig
{
UnityD3D12GraphicsQueueAccess graphicsQueueAccess;
UINT32 flags; bool ensureActiveRenderTextureIsBound; };
typedef struct UnityGraphicsD3D12PhysicalVideoMemoryControlValues UnityGraphicsD3D12PhysicalVideoMemoryControlValues;
struct UnityGraphicsD3D12PhysicalVideoMemoryControlValues {
UINT64 reservation; UINT64 systemMemoryThreshold; UINT64 residencyHysteresisThreshold; float nonEvictableRelativeThreshold; };
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v7)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
IDXGISwapChain* (UNITY_INTERFACE_API * GetSwapChain)();
UINT32(UNITY_INTERFACE_API * GetSyncInterval)();
UINT(UNITY_INTERFACE_API * GetPresentFlags)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
UINT64(UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList * commandList, int stateCount, UnityGraphicsD3D12ResourceState * states);
void(UNITY_INTERFACE_API * SetPhysicalVideoMemoryControlValues)(const UnityGraphicsD3D12PhysicalVideoMemoryControlValues * memInfo);
ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)();
ID3D12Resource* (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer rb);
ID3D12Resource* (UNITY_INTERFACE_API * TextureFromNativeTexture)(UnityTextureID texture);
void(UNITY_INTERFACE_API * ConfigureEvent)(int eventID, const UnityD3D12PluginEventConfig * pluginEventConfig);
bool(UNITY_INTERFACE_API * CommandRecordingState)(UnityGraphicsD3D12RecordingState * outCommandRecordingState);
};
UNITY_REGISTER_INTERFACE_GUID(0x4624B0DA41B64AACULL, 0x915AABCB9BC3F0D3ULL, IUnityGraphicsD3D12v7)
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v6)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
UINT64(UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList * commandList, int stateCount, UnityGraphicsD3D12ResourceState * states);
void(UNITY_INTERFACE_API * SetPhysicalVideoMemoryControlValues)(const UnityGraphicsD3D12PhysicalVideoMemoryControlValues * memInfo);
ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)();
ID3D12Resource* (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer rb);
ID3D12Resource* (UNITY_INTERFACE_API * TextureFromNativeTexture)(UnityTextureID texture);
void(UNITY_INTERFACE_API * ConfigureEvent)(int eventID, const UnityD3D12PluginEventConfig * pluginEventConfig);
bool(UNITY_INTERFACE_API * CommandRecordingState)(UnityGraphicsD3D12RecordingState* outCommandRecordingState);
};
UNITY_REGISTER_INTERFACE_GUID(0xA396DCE58CAC4D78ULL, 0xAFDD9B281F20B840ULL, IUnityGraphicsD3D12v6)
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v5)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
UINT64(UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList * commandList, int stateCount, UnityGraphicsD3D12ResourceState * states);
void(UNITY_INTERFACE_API * SetPhysicalVideoMemoryControlValues)(const UnityGraphicsD3D12PhysicalVideoMemoryControlValues * memInfo);
ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)();
ID3D12Resource* (UNITY_INTERFACE_API * TextureFromRenderBuffer)(UnityRenderBuffer rb);
};
UNITY_REGISTER_INTERFACE_GUID(0xF5C8D8A37D37BC42ULL, 0xB02DFE93B5064A27ULL, IUnityGraphicsD3D12v5)
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v4)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
UINT64(UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList * commandList, int stateCount, UnityGraphicsD3D12ResourceState * states);
void(UNITY_INTERFACE_API * SetPhysicalVideoMemoryControlValues)(const UnityGraphicsD3D12PhysicalVideoMemoryControlValues * memInfo);
ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)();
};
UNITY_REGISTER_INTERFACE_GUID(0X498FFCC13EC94006ULL, 0XB18F8B0FF67778C8ULL, IUnityGraphicsD3D12v4)
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v3)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
UINT64(UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList * commandList, int stateCount, UnityGraphicsD3D12ResourceState * states);
void(UNITY_INTERFACE_API * SetPhysicalVideoMemoryControlValues)(const UnityGraphicsD3D12PhysicalVideoMemoryControlValues * memInfo);
};
UNITY_REGISTER_INTERFACE_GUID(0x57C3FAFE59E5E843ULL, 0xBF4F5998474BB600ULL, IUnityGraphicsD3D12v3)
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12v2)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
UINT64(UNITY_INTERFACE_API * ExecuteCommandList)(ID3D12GraphicsCommandList * commandList, int stateCount, UnityGraphicsD3D12ResourceState * states);
};
UNITY_REGISTER_INTERFACE_GUID(0xEC39D2F18446C745ULL, 0xB1A2626641D6B11FULL, IUnityGraphicsD3D12v2)
UNITY_DECLARE_INTERFACE(IUnityGraphicsD3D12)
{
ID3D12Device* (UNITY_INTERFACE_API * GetDevice)();
ID3D12CommandQueue* (UNITY_INTERFACE_API * GetCommandQueue)();
ID3D12Fence* (UNITY_INTERFACE_API * GetFrameFence)();
UINT64(UNITY_INTERFACE_API * GetNextFrameFenceValue)();
bool(UNITY_INTERFACE_API * GetResourceState)(ID3D12Resource * resource, D3D12_RESOURCE_STATES * outState);
void(UNITY_INTERFACE_API * SetResourceState)(ID3D12Resource * resource, D3D12_RESOURCE_STATES state);
};
UNITY_REGISTER_INTERFACE_GUID(0xEF4CEC88A45F4C4CULL, 0xBD295B6F2A38D9DEULL, IUnityGraphicsD3D12)