mirror of
https://codeberg.org/WinDurango/WinDurango.git
synced 2026-04-18 02:23:34 -04:00
D3D11.X stubs and init
This commit is contained in:
@@ -9,13 +9,14 @@ set(FILES
|
||||
src/IGraphicsUnknown.cpp
|
||||
src/IIDExports.cpp
|
||||
include/WinDurango.D3D11X/d3d11.x.h
|
||||
include/WinDurango.D3D11X/d3d11_x.g.h
|
||||
include/WinDurango.D3D11X/unknown.g.h
|
||||
include/WinDurango.D3D11X/IGraphicsUnknown.h
|
||||
include/WinDurango.D3D11X/IIDExports.h
|
||||
Exports.def
|
||||
)
|
||||
|
||||
add_library(WinDurango.D3D11X SHARED ${FILES})
|
||||
add_library(WinDurango.D3D11X SHARED ${FILES} "include/WinDurango.D3D11X/ID3D11DeviceChild.h" "src/ID3D11DeviceChild.cpp" "include/WinDurango.D3D11X/ID3D11Resource.h" "src/ID3D11Resource.cpp" "include/WinDurango.D3D11X/ID3D11Shader.h" "src/ID3D11Shader.cpp" "include/WinDurango.D3D11X/ID3D11State.h" "src/ID3D11State.cpp" "include/WinDurango.D3D11X/ID3D11View.h" "src/ID3D11View.cpp" "include/WinDurango.D3D11X/ID3D11DeviceContext.h" "src/ID3D11DeviceContext.cpp" "include/WinDurango.D3D11X/ID3D11DMAEngineContext.h" "src/ID3D11DMAEngineContext.cpp" "include/WinDurango.D3D11X/ID3D11Device.h" "src/ID3D11Device.cpp" "include/WinDurango.D3D11X/ID3D11Runtime.h" "src/dllmain.cpp")
|
||||
|
||||
target_link_libraries(WinDurango.D3D11X PRIVATE WinDurango.Common)
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
#include "d3d11_x.g.h"
|
||||
|
||||
template <abi_t ABI> class D3D11DMAEngineContextX : public gfx::ID3D11DMAEngineContextX<ABI>
|
||||
{
|
||||
public:
|
||||
//
|
||||
// IUnknown
|
||||
//
|
||||
HRESULT QueryInterface(REFIID riid, void **ppvObject);
|
||||
ULONG AddRef();
|
||||
ULONG Release();
|
||||
|
||||
//
|
||||
// ID3D11DeviceChild
|
||||
//
|
||||
void GetDevice(gfx::ID3D11Device<ABI> **ppDevice);
|
||||
HRESULT GetPrivateData(_GUID const &guid, uint32_t *pDataSize, void *pData);
|
||||
HRESULT SetPrivateData(_GUID const &guid, uint32_t DataSize, void const *pData);
|
||||
HRESULT SetPrivateDataInterface(_GUID const &guid, IUnknown const *pData);
|
||||
HRESULT SetPrivateDataInterfaceGraphics(_GUID const &guid, xbox::IGraphicsUnknown<ABI> const *pData);
|
||||
|
||||
//
|
||||
// ID3D11DMAEngineContextX
|
||||
//
|
||||
D3D11_DEVICE_CONTEXT_TYPE GetType();
|
||||
void CopyResource(gfx::ID3D11Resource<ABI> *v1, gfx::ID3D11Resource<ABI> *v2, uint32_t v3);
|
||||
void CopySubresourceRegion(gfx::ID3D11Resource<ABI> *v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5,
|
||||
gfx::ID3D11Resource<ABI> *v6, uint32_t v7, D3D11_BOX const *v8, uint32_t v9);
|
||||
HRESULT LZDecompressBuffer(gfx::ID3D11Buffer<ABI> *v1, uint32_t v2, gfx::ID3D11Buffer<ABI> *v3, uint32_t v4,
|
||||
uint32_t v5, uint32_t v6);
|
||||
HRESULT LZDecompressTexture(gfx::ID3D11Resource<ABI> *v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5,
|
||||
gfx::ID3D11Buffer<ABI> *v6, uint32_t v7);
|
||||
HRESULT LZCompressBuffer(gfx::ID3D11Buffer<ABI> *v1, uint32_t v2, gfx::ID3D11Buffer<ABI> *v3, uint32_t v4,
|
||||
uint32_t v5, uint32_t v6);
|
||||
HRESULT LZCompressTexture(gfx::ID3D11Buffer<ABI> *v1, gfx::ID3D11Resource<ABI> *v2, uint32_t v3,
|
||||
D3D11_BOX const *v4, uint32_t v5);
|
||||
HRESULT JPEGDecode(gfx::ID3D11Resource<ABI> *v1, uint32_t v2, uint32_t v3, uint32_t v4, uint32_t v5,
|
||||
gfx::ID3D11Buffer<ABI> *v6, uint32_t v7);
|
||||
uint64_t InsertFence(uint32_t v1);
|
||||
void InsertWaitOnFence(uint32_t v1, uint64_t v2);
|
||||
HRESULT Submit();
|
||||
void CopyLastErrorCodeToMemory(void *v1);
|
||||
void CopyLastErrorCodeToBuffer(gfx::ID3D11Buffer<ABI> *v1, uint32_t v2);
|
||||
void CopyMemoryToMemory(void *v1, void *v2, uint64_t v3);
|
||||
void FillMemoryWithValue(void *v1, uint64_t v2, uint32_t v3);
|
||||
void FillResourceWithValue(gfx::ID3D11Resource<ABI> *v1, uint32_t v2);
|
||||
HRESULT LZDecompressMemory(void *v1, void *v2, uint32_t v3, uint32_t v4);
|
||||
HRESULT LZCompressMemory(void *v1, void *v2, uint32_t v3, uint32_t v4);
|
||||
void WriteTimestampToMemory(void *v1);
|
||||
void WriteTimestampToBuffer(gfx::ID3D11Buffer<ABI> *v1, uint32_t v2);
|
||||
void WriteValueBottomOfPipe(void *v1, uint32_t v2);
|
||||
void InsertWaitOnMemory(void const *v1, uint32_t v2, D3D11_COMPARISON_FUNC v3, uint32_t v4, uint32_t v5);
|
||||
};
|
||||
|
||||
#undef ABI_INTERFACE
|
||||
#define ABI_INTERFACE(ABI) D3D11DMAEngineContextX<ABI>
|
||||
D3D11_DECLARE_ABI_TEMPLATES(extern);
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "d3d11.x.h"
|
||||
#include "IIDExports.h"
|
||||
#include "d3d11_x.g.h"
|
||||
#include "ID3D11Runtime.h"
|
||||
|
||||
EXTERN_C HRESULT __stdcall EraD3D10CreateBlob()
|
||||
{
|
||||
@@ -12,8 +14,10 @@ EXTERN_C HRESULT __stdcall EraD3D11CreateDevice(void *pAdapter, D3D_DRIVER_TYPE
|
||||
UINT SDKVersion, void **ppDevice, D3D_FEATURE_LEVEL *pFeatureLevel,
|
||||
void **ppImmediateContext)
|
||||
{
|
||||
IMPLEMENT_STUB();
|
||||
return E_NOTIMPL;
|
||||
ID3D11Runtime *pRuntime;
|
||||
d3d11CreateInstance<D3D11Runtime>(g_ABI, (void **)&pRuntime);
|
||||
auto hr = pRuntime->CreateDevice((void **)ppDevice, (void **)ppImmediateContext);
|
||||
return hr;
|
||||
}
|
||||
|
||||
EXTERN_C HRESULT __stdcall EraD3D11CreateDeviceAndSwapChain()
|
||||
@@ -38,8 +42,10 @@ struct D3D11X_CREATE_DEVICE_PARAMETERS
|
||||
EXTERN_C HRESULT __stdcall D3D11XCreateDeviceX(const D3D11X_CREATE_DEVICE_PARAMETERS *pParameters, void **ppDevice,
|
||||
void **ppImmediateContext)
|
||||
{
|
||||
IMPLEMENT_STUB();
|
||||
return E_NOTIMPL;
|
||||
ID3D11Runtime *pRuntime;
|
||||
d3d11CreateInstance<D3D11Runtime>(g_ABI, (void **)&pRuntime);
|
||||
auto hr = pRuntime->CreateDevice((void **)ppDevice, (void **)ppImmediateContext);
|
||||
return hr;
|
||||
}
|
||||
|
||||
EXTERN_C HRESULT __stdcall D3D11XCreateDeviceXAndSwapChain1(const D3D11X_CREATE_DEVICE_PARAMETERS *pParameters,
|
||||
|
||||
Reference in New Issue
Block a user