[dxgi] Renamed private DXGI interfaces

This commit is contained in:
Philip Rebohle 2017-11-27 15:51:53 +01:00
parent c572a9c393
commit 0cdc13d785
13 changed files with 41 additions and 39 deletions

View File

@ -28,13 +28,14 @@ namespace dxvk {
D3D11_RESOURCE_DIMENSION *pResourceDimension) final;
void GetDesc(
D3D11_BUFFER_DESC *pDesc);
D3D11_BUFFER_DESC *pDesc) final;
private:
Com<D3D11Device> m_device;
D3D11_BUFFER_DESC m_desc;
Rc<DxvkBuffer> m_buffer;
Com<D3D11Device> m_device;
D3D11_BUFFER_DESC m_desc;
Rc<DxvkBuffer> m_buffer;
Rc<DxvkBuffer> createBuffer();

View File

@ -7,7 +7,7 @@
namespace dxvk {
D3D11Device::D3D11Device(
IDXVKDevice* dxgiDevice,
IDXGIDevicePrivate* dxgiDevice,
D3D_FEATURE_LEVEL featureLevel,
UINT featureFlags)
: m_dxgiDevice (dxgiDevice),
@ -29,7 +29,7 @@ namespace dxvk {
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
COM_QUERY_IFACE(riid, ppvObject, ID3D11Device);
if (riid == __uuidof(IDXVKDevice)
if (riid == __uuidof(IDXGIDevicePrivate)
|| riid == __uuidof(IDXGIDevice))
return m_dxgiDevice->QueryInterface(riid, ppvObject);

View File

@ -17,7 +17,7 @@ namespace dxvk {
public:
D3D11Device(
IDXVKDevice* dxgiDevice,
IDXGIDevicePrivate* dxgiDevice,
D3D_FEATURE_LEVEL featureLevel,
UINT featureFlags);
~D3D11Device();
@ -224,14 +224,14 @@ namespace dxvk {
private:
const Com<IDXVKDevice> m_dxgiDevice;
const D3D_FEATURE_LEVEL m_featureLevel;
const UINT m_featureFlags;
const Com<IDXGIDevicePrivate> m_dxgiDevice;
const D3D_FEATURE_LEVEL m_featureLevel;
const UINT m_featureFlags;
const Rc<DxvkDevice> m_dxvkDevice;
const Rc<DxvkAdapter> m_dxvkAdapter;
const Rc<DxvkDevice> m_dxvkDevice;
const Rc<DxvkAdapter> m_dxvkAdapter;
Com<ID3D11DeviceContext> m_context;
Com<ID3D11DeviceContext> m_context;
};

View File

@ -19,8 +19,8 @@ extern "C" {
ID3D11Device **ppDevice,
D3D_FEATURE_LEVEL *pFeatureLevel,
ID3D11DeviceContext **ppImmediateContext) {
Com<IDXGIAdapter> dxgiAdapter = pAdapter;
Com<IDXVKAdapter> dxvkAdapter = nullptr;
Com<IDXGIAdapter> dxgiAdapter = pAdapter;
Com<IDXGIAdapterPrivate> dxvkAdapter = nullptr;
if (dxgiAdapter == nullptr) {
// 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
// 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)))) {
Logger::err("D3D11CreateDevice: Adapter is not a DXVK adapter");
return E_FAIL;
@ -103,7 +103,7 @@ extern "C" {
// 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 (ppDevice != nullptr) {
Com<IDXVKDevice> dxvkDevice = nullptr;
Com<IDXGIDevicePrivate> dxvkDevice = nullptr;
if (FAILED(DXGICreateDXVKDevice(dxvkAdapter.ptr(), &dxvkDevice))) {
Logger::err("D3D11CreateDevice: Failed to create DXGI device");

View File

@ -3,6 +3,7 @@ d3d11_src = [
'd3d11_context.cpp',
'd3d11_device.cpp',
'd3d11_main.cpp',
'd3d11_texture.cpp',
]
d3d11_dll = shared_library('d3d11', d3d11_src,

View File

@ -28,7 +28,7 @@ namespace dxvk {
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter);
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");
return E_NOINTERFACE;

View File

@ -13,7 +13,7 @@ namespace dxvk {
class DxgiFactory;
class DxgiOutput;
class DxgiAdapter : public DxgiObject<IDXVKAdapter> {
class DxgiAdapter : public DxgiObject<IDXGIAdapterPrivate> {
public:

View File

@ -3,7 +3,7 @@
namespace dxvk {
DxgiDevice::DxgiDevice(IDXVKAdapter* adapter)
DxgiDevice::DxgiDevice(IDXGIAdapterPrivate* adapter)
: m_adapter(adapter) {
m_device = m_adapter->GetDXVKAdapter()->createDevice();
}
@ -18,7 +18,7 @@ namespace dxvk {
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevice);
COM_QUERY_IFACE(riid, ppvObject, IDXVKDevice);
COM_QUERY_IFACE(riid, ppvObject, IDXGIDevicePrivate);
if (m_layer != nullptr)
return m_layer->QueryInterface(riid, ppvObject);
@ -92,8 +92,8 @@ namespace dxvk {
extern "C" {
DLLEXPORT HRESULT __stdcall DXGICreateDXVKDevice(
IDXVKAdapter* pAdapter,
IDXVKDevice** ppDevice) {
IDXGIAdapterPrivate* pAdapter,
IDXGIDevicePrivate** ppDevice) {
try {
*ppDevice = dxvk::ref(new dxvk::DxgiDevice(pAdapter));
return S_OK;

View File

@ -9,11 +9,11 @@ namespace dxvk {
class DxgiFactory;
class DxgiDevice : public DxgiObject<IDXVKDevice> {
class DxgiDevice : public DxgiObject<IDXGIDevicePrivate> {
public:
DxgiDevice(IDXVKAdapter* adapter);
DxgiDevice(IDXGIAdapterPrivate* adapter);
~DxgiDevice();
HRESULT QueryInterface(
@ -52,10 +52,10 @@ namespace dxvk {
private:
Com<IDXVKAdapter> m_adapter;
Rc<DxvkDevice> m_device;
Com<IDXGIAdapterPrivate> m_adapter;
Rc<DxvkDevice> m_device;
IUnknown* m_layer = nullptr;
IUnknown* m_layer = nullptr;
};
@ -65,7 +65,7 @@ namespace dxvk {
extern "C" {
DLLEXPORT HRESULT __stdcall DXGICreateDXVKDevice(
IDXVKAdapter* pAdapter,
IDXVKDevice** ppDevice);
IDXGIAdapterPrivate* pAdapter,
IDXGIDevicePrivate** ppDevice);
}

View File

@ -16,7 +16,7 @@ namespace dxvk {
* this interface.
*/
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
IDXVKAdapter : public IDXGIAdapter1 {
IDXGIAdapterPrivate : public IDXGIAdapter1 {
static const GUID guid;
virtual dxvk::Rc<dxvk::DxvkAdapter> GetDXVKAdapter() = 0;
@ -31,7 +31,7 @@ IDXVKAdapter : public IDXGIAdapter1 {
* this interface.
*/
MIDL_INTERFACE("7a622cf6-627a-46b2-b52f-360ef3da831c")
IDXVKDevice : public IDXGIDevice {
IDXGIDevicePrivate : public IDXGIDevice {
static const GUID guid;
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<IDXVKDevice> () { return IDXVKDevice ::guid; }
template<> inline GUID const& __mingw_uuidof<IDXGIAdapterPrivate>() { return IDXGIAdapterPrivate::guid; }
template<> inline GUID const& __mingw_uuidof<IDXGIDevicePrivate> () { return IDXGIDevicePrivate ::guid; }

View File

@ -12,7 +12,7 @@ namespace dxvk {
// Retrieve a device pointer that allows us to
// communicate with the underlying D3D device
if (FAILED(pDevice->QueryInterface(__uuidof(IDXVKDevice),
if (FAILED(pDevice->QueryInterface(__uuidof(IDXGIDevicePrivate),
reinterpret_cast<void**>(&m_device))))
throw DxvkError("DxgiSwapChain::DxgiSwapChain: Invalid device");

View File

@ -78,8 +78,8 @@ namespace dxvk {
std::mutex m_mutex;
Com<DxgiFactory> m_factory;
Com<IDXVKDevice> m_device;
Com<DxgiFactory> m_factory;
Com<IDXGIDevicePrivate> m_device;
DXGI_SWAP_CHAIN_DESC m_desc;
DXGI_FRAME_STATISTICS m_stats;

View File

@ -2,8 +2,8 @@
#include "../../dxgi/dxgi_interfaces.h"
const GUID IDXVKAdapter::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 IDXGIAdapterPrivate::guid = {0x907bf281,0xea3c,0x43b4,{0xa8,0xe4,0x9f,0x23,0x11,0x07,0xb4,0xff}};
const GUID IDXGIDevicePrivate::guid = {0x7a622cf6,0x627a,0x46b2,{0xb5,0x2f,0x36,0x0e,0xf3,0xda,0x83,0x1c}};
std::ostream& operator << (std::ostream& os, REFIID guid) {
os.width(8);