mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 05:52:11 +01:00
[dxgi] Renamed private DXGI interfaces
This commit is contained in:
parent
c572a9c393
commit
0cdc13d785
@ -28,13 +28,14 @@ namespace dxvk {
|
|||||||
D3D11_RESOURCE_DIMENSION *pResourceDimension) final;
|
D3D11_RESOURCE_DIMENSION *pResourceDimension) final;
|
||||||
|
|
||||||
void GetDesc(
|
void GetDesc(
|
||||||
D3D11_BUFFER_DESC *pDesc);
|
D3D11_BUFFER_DESC *pDesc) final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Com<D3D11Device> m_device;
|
Com<D3D11Device> m_device;
|
||||||
D3D11_BUFFER_DESC m_desc;
|
|
||||||
Rc<DxvkBuffer> m_buffer;
|
D3D11_BUFFER_DESC m_desc;
|
||||||
|
Rc<DxvkBuffer> m_buffer;
|
||||||
|
|
||||||
Rc<DxvkBuffer> createBuffer();
|
Rc<DxvkBuffer> createBuffer();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
D3D11Device::D3D11Device(
|
D3D11Device::D3D11Device(
|
||||||
IDXVKDevice* dxgiDevice,
|
IDXGIDevicePrivate* dxgiDevice,
|
||||||
D3D_FEATURE_LEVEL featureLevel,
|
D3D_FEATURE_LEVEL featureLevel,
|
||||||
UINT featureFlags)
|
UINT featureFlags)
|
||||||
: m_dxgiDevice (dxgiDevice),
|
: m_dxgiDevice (dxgiDevice),
|
||||||
@ -29,7 +29,7 @@ namespace dxvk {
|
|||||||
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, ID3D11Device);
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Device);
|
||||||
|
|
||||||
if (riid == __uuidof(IDXVKDevice)
|
if (riid == __uuidof(IDXGIDevicePrivate)
|
||||||
|| riid == __uuidof(IDXGIDevice))
|
|| riid == __uuidof(IDXGIDevice))
|
||||||
return m_dxgiDevice->QueryInterface(riid, ppvObject);
|
return m_dxgiDevice->QueryInterface(riid, ppvObject);
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ namespace dxvk {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
D3D11Device(
|
D3D11Device(
|
||||||
IDXVKDevice* dxgiDevice,
|
IDXGIDevicePrivate* dxgiDevice,
|
||||||
D3D_FEATURE_LEVEL featureLevel,
|
D3D_FEATURE_LEVEL featureLevel,
|
||||||
UINT featureFlags);
|
UINT featureFlags);
|
||||||
~D3D11Device();
|
~D3D11Device();
|
||||||
@ -224,14 +224,14 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
const Com<IDXVKDevice> m_dxgiDevice;
|
const Com<IDXGIDevicePrivate> m_dxgiDevice;
|
||||||
const D3D_FEATURE_LEVEL m_featureLevel;
|
const D3D_FEATURE_LEVEL m_featureLevel;
|
||||||
const UINT m_featureFlags;
|
const UINT m_featureFlags;
|
||||||
|
|
||||||
const Rc<DxvkDevice> m_dxvkDevice;
|
const Rc<DxvkDevice> m_dxvkDevice;
|
||||||
const Rc<DxvkAdapter> m_dxvkAdapter;
|
const Rc<DxvkAdapter> m_dxvkAdapter;
|
||||||
|
|
||||||
Com<ID3D11DeviceContext> m_context;
|
Com<ID3D11DeviceContext> m_context;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ extern "C" {
|
|||||||
ID3D11Device **ppDevice,
|
ID3D11Device **ppDevice,
|
||||||
D3D_FEATURE_LEVEL *pFeatureLevel,
|
D3D_FEATURE_LEVEL *pFeatureLevel,
|
||||||
ID3D11DeviceContext **ppImmediateContext) {
|
ID3D11DeviceContext **ppImmediateContext) {
|
||||||
Com<IDXGIAdapter> dxgiAdapter = pAdapter;
|
Com<IDXGIAdapter> dxgiAdapter = pAdapter;
|
||||||
Com<IDXVKAdapter> dxvkAdapter = nullptr;
|
Com<IDXGIAdapterPrivate> dxvkAdapter = nullptr;
|
||||||
|
|
||||||
if (dxgiAdapter == nullptr) {
|
if (dxgiAdapter == nullptr) {
|
||||||
// We'll treat everything as hardware, even if the
|
// We'll treat everything as hardware, even if the
|
||||||
@ -55,7 +55,7 @@ extern "C" {
|
|||||||
|
|
||||||
// The adapter must obviously be a DXVK-compatible adapter so
|
// The adapter must obviously be a DXVK-compatible adapter so
|
||||||
// that we can create a DXVK-compatible DXGI device from it.
|
// that we can create a DXVK-compatible DXGI device from it.
|
||||||
if (FAILED(dxgiAdapter->QueryInterface(__uuidof(IDXVKAdapter),
|
if (FAILED(dxgiAdapter->QueryInterface(__uuidof(IDXGIAdapterPrivate),
|
||||||
reinterpret_cast<void**>(&dxvkAdapter)))) {
|
reinterpret_cast<void**>(&dxvkAdapter)))) {
|
||||||
Logger::err("D3D11CreateDevice: Adapter is not a DXVK adapter");
|
Logger::err("D3D11CreateDevice: Adapter is not a DXVK adapter");
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
@ -103,7 +103,7 @@ extern "C" {
|
|||||||
// does not hold a strong reference to the device that owns it, so
|
// does not hold a strong reference to the device that owns it, so
|
||||||
// if we cannot write back the device, it would be destroyed.
|
// if we cannot write back the device, it would be destroyed.
|
||||||
if (ppDevice != nullptr) {
|
if (ppDevice != nullptr) {
|
||||||
Com<IDXVKDevice> dxvkDevice = nullptr;
|
Com<IDXGIDevicePrivate> dxvkDevice = nullptr;
|
||||||
|
|
||||||
if (FAILED(DXGICreateDXVKDevice(dxvkAdapter.ptr(), &dxvkDevice))) {
|
if (FAILED(DXGICreateDXVKDevice(dxvkAdapter.ptr(), &dxvkDevice))) {
|
||||||
Logger::err("D3D11CreateDevice: Failed to create DXGI device");
|
Logger::err("D3D11CreateDevice: Failed to create DXGI device");
|
||||||
|
@ -3,6 +3,7 @@ d3d11_src = [
|
|||||||
'd3d11_context.cpp',
|
'd3d11_context.cpp',
|
||||||
'd3d11_device.cpp',
|
'd3d11_device.cpp',
|
||||||
'd3d11_main.cpp',
|
'd3d11_main.cpp',
|
||||||
|
'd3d11_texture.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
d3d11_dll = shared_library('d3d11', d3d11_src,
|
d3d11_dll = shared_library('d3d11', d3d11_src,
|
||||||
|
@ -28,7 +28,7 @@ namespace dxvk {
|
|||||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter1);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter1);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IDXVKAdapter);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapterPrivate);
|
||||||
|
|
||||||
Logger::warn("DxgiAdapter::QueryInterface: Unknown interface query");
|
Logger::warn("DxgiAdapter::QueryInterface: Unknown interface query");
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
@ -13,7 +13,7 @@ namespace dxvk {
|
|||||||
class DxgiFactory;
|
class DxgiFactory;
|
||||||
class DxgiOutput;
|
class DxgiOutput;
|
||||||
|
|
||||||
class DxgiAdapter : public DxgiObject<IDXVKAdapter> {
|
class DxgiAdapter : public DxgiObject<IDXGIAdapterPrivate> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
DxgiDevice::DxgiDevice(IDXVKAdapter* adapter)
|
DxgiDevice::DxgiDevice(IDXGIAdapterPrivate* adapter)
|
||||||
: m_adapter(adapter) {
|
: m_adapter(adapter) {
|
||||||
m_device = m_adapter->GetDXVKAdapter()->createDevice();
|
m_device = m_adapter->GetDXVKAdapter()->createDevice();
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ namespace dxvk {
|
|||||||
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IDXVKDevice);
|
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevicePrivate);
|
||||||
|
|
||||||
if (m_layer != nullptr)
|
if (m_layer != nullptr)
|
||||||
return m_layer->QueryInterface(riid, ppvObject);
|
return m_layer->QueryInterface(riid, ppvObject);
|
||||||
@ -92,8 +92,8 @@ namespace dxvk {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
DLLEXPORT HRESULT __stdcall DXGICreateDXVKDevice(
|
DLLEXPORT HRESULT __stdcall DXGICreateDXVKDevice(
|
||||||
IDXVKAdapter* pAdapter,
|
IDXGIAdapterPrivate* pAdapter,
|
||||||
IDXVKDevice** ppDevice) {
|
IDXGIDevicePrivate** ppDevice) {
|
||||||
try {
|
try {
|
||||||
*ppDevice = dxvk::ref(new dxvk::DxgiDevice(pAdapter));
|
*ppDevice = dxvk::ref(new dxvk::DxgiDevice(pAdapter));
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -9,11 +9,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
class DxgiFactory;
|
class DxgiFactory;
|
||||||
|
|
||||||
class DxgiDevice : public DxgiObject<IDXVKDevice> {
|
class DxgiDevice : public DxgiObject<IDXGIDevicePrivate> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DxgiDevice(IDXVKAdapter* adapter);
|
DxgiDevice(IDXGIAdapterPrivate* adapter);
|
||||||
~DxgiDevice();
|
~DxgiDevice();
|
||||||
|
|
||||||
HRESULT QueryInterface(
|
HRESULT QueryInterface(
|
||||||
@ -52,10 +52,10 @@ namespace dxvk {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Com<IDXVKAdapter> m_adapter;
|
Com<IDXGIAdapterPrivate> m_adapter;
|
||||||
Rc<DxvkDevice> m_device;
|
Rc<DxvkDevice> m_device;
|
||||||
|
|
||||||
IUnknown* m_layer = nullptr;
|
IUnknown* m_layer = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ namespace dxvk {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
DLLEXPORT HRESULT __stdcall DXGICreateDXVKDevice(
|
DLLEXPORT HRESULT __stdcall DXGICreateDXVKDevice(
|
||||||
IDXVKAdapter* pAdapter,
|
IDXGIAdapterPrivate* pAdapter,
|
||||||
IDXVKDevice** ppDevice);
|
IDXGIDevicePrivate** ppDevice);
|
||||||
|
|
||||||
}
|
}
|
@ -16,7 +16,7 @@ namespace dxvk {
|
|||||||
* this interface.
|
* this interface.
|
||||||
*/
|
*/
|
||||||
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
|
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
|
||||||
IDXVKAdapter : public IDXGIAdapter1 {
|
IDXGIAdapterPrivate : public IDXGIAdapter1 {
|
||||||
static const GUID guid;
|
static const GUID guid;
|
||||||
|
|
||||||
virtual dxvk::Rc<dxvk::DxvkAdapter> GetDXVKAdapter() = 0;
|
virtual dxvk::Rc<dxvk::DxvkAdapter> GetDXVKAdapter() = 0;
|
||||||
@ -31,7 +31,7 @@ IDXVKAdapter : public IDXGIAdapter1 {
|
|||||||
* this interface.
|
* this interface.
|
||||||
*/
|
*/
|
||||||
MIDL_INTERFACE("7a622cf6-627a-46b2-b52f-360ef3da831c")
|
MIDL_INTERFACE("7a622cf6-627a-46b2-b52f-360ef3da831c")
|
||||||
IDXVKDevice : public IDXGIDevice {
|
IDXGIDevicePrivate : public IDXGIDevice {
|
||||||
static const GUID guid;
|
static const GUID guid;
|
||||||
|
|
||||||
virtual void SetDeviceLayer(
|
virtual void SetDeviceLayer(
|
||||||
@ -41,5 +41,5 @@ IDXVKDevice : public IDXGIDevice {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<> inline GUID const& __mingw_uuidof<IDXVKAdapter>() { return IDXVKAdapter::guid; }
|
template<> inline GUID const& __mingw_uuidof<IDXGIAdapterPrivate>() { return IDXGIAdapterPrivate::guid; }
|
||||||
template<> inline GUID const& __mingw_uuidof<IDXVKDevice> () { return IDXVKDevice ::guid; }
|
template<> inline GUID const& __mingw_uuidof<IDXGIDevicePrivate> () { return IDXGIDevicePrivate ::guid; }
|
||||||
|
@ -12,7 +12,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
// Retrieve a device pointer that allows us to
|
// Retrieve a device pointer that allows us to
|
||||||
// communicate with the underlying D3D device
|
// communicate with the underlying D3D device
|
||||||
if (FAILED(pDevice->QueryInterface(__uuidof(IDXVKDevice),
|
if (FAILED(pDevice->QueryInterface(__uuidof(IDXGIDevicePrivate),
|
||||||
reinterpret_cast<void**>(&m_device))))
|
reinterpret_cast<void**>(&m_device))))
|
||||||
throw DxvkError("DxgiSwapChain::DxgiSwapChain: Invalid device");
|
throw DxvkError("DxgiSwapChain::DxgiSwapChain: Invalid device");
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
std::mutex m_mutex;
|
std::mutex m_mutex;
|
||||||
|
|
||||||
Com<DxgiFactory> m_factory;
|
Com<DxgiFactory> m_factory;
|
||||||
Com<IDXVKDevice> m_device;
|
Com<IDXGIDevicePrivate> m_device;
|
||||||
|
|
||||||
DXGI_SWAP_CHAIN_DESC m_desc;
|
DXGI_SWAP_CHAIN_DESC m_desc;
|
||||||
DXGI_FRAME_STATISTICS m_stats;
|
DXGI_FRAME_STATISTICS m_stats;
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#include "../../dxgi/dxgi_interfaces.h"
|
#include "../../dxgi/dxgi_interfaces.h"
|
||||||
|
|
||||||
const GUID IDXVKAdapter::guid = {0x907bf281,0xea3c,0x43b4,{0xa8,0xe4,0x9f,0x23,0x11,0x07,0xb4,0xff}};
|
const GUID IDXGIAdapterPrivate::guid = {0x907bf281,0xea3c,0x43b4,{0xa8,0xe4,0x9f,0x23,0x11,0x07,0xb4,0xff}};
|
||||||
const GUID IDXVKDevice::guid = {0x7a622cf6,0x627a,0x46b2,{0xb5,0x2f,0x36,0x0e,0xf3,0xda,0x83,0x1c}};
|
const GUID IDXGIDevicePrivate::guid = {0x7a622cf6,0x627a,0x46b2,{0xb5,0x2f,0x36,0x0e,0xf3,0xda,0x83,0x1c}};
|
||||||
|
|
||||||
std::ostream& operator << (std::ostream& os, REFIID guid) {
|
std::ostream& operator << (std::ostream& os, REFIID guid) {
|
||||||
os.width(8);
|
os.width(8);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user