Fix DX12 build on older MSVC versions, fix missing PIX include.
This commit is contained in:
parent
26b1fd0d84
commit
2893c0b475
2 changed files with 16 additions and 6 deletions
|
@ -55,12 +55,11 @@
|
||||||
#include <guiddef.h>
|
#include <guiddef.h>
|
||||||
|
|
||||||
#include <dxguids.h>
|
#include <dxguids.h>
|
||||||
#ifndef CLSID_D3D12DeviceFactory
|
|
||||||
// Note: symbol is not available in MinGW import library.
|
|
||||||
const CLSID CLSID_D3D12DeviceFactory = __uuidof(ID3D12DeviceFactory);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Note: symbol is not available in MinGW and old MSVC import libraries.
|
||||||
|
const CLSID CLSID_D3D12DeviceFactoryGodot = __uuidof(ID3D12DeviceFactory);
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
char godot_nir_arch_name[32];
|
char godot_nir_arch_name[32];
|
||||||
}
|
}
|
||||||
|
@ -825,9 +824,9 @@ void D3D12Context::_init_device_factory() {
|
||||||
ID3D12SDKConfiguration1 *sdk_config1 = nullptr;
|
ID3D12SDKConfiguration1 *sdk_config1 = nullptr;
|
||||||
if (SUCCEEDED(sdk_config->QueryInterface(&sdk_config1))) {
|
if (SUCCEEDED(sdk_config->QueryInterface(&sdk_config1))) {
|
||||||
if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, agility_sdk_path.ascii().get_data(), IID_PPV_ARGS(device_factory.GetAddressOf())))) {
|
if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, agility_sdk_path.ascii().get_data(), IID_PPV_ARGS(device_factory.GetAddressOf())))) {
|
||||||
d3d_D3D12GetInterface(CLSID_D3D12DeviceFactory, IID_PPV_ARGS(device_factory.GetAddressOf()));
|
d3d_D3D12GetInterface(CLSID_D3D12DeviceFactoryGodot, IID_PPV_ARGS(device_factory.GetAddressOf()));
|
||||||
} else if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, ".\\", IID_PPV_ARGS(device_factory.GetAddressOf())))) {
|
} else if (SUCCEEDED(sdk_config1->CreateDeviceFactory(agility_sdk_version, ".\\", IID_PPV_ARGS(device_factory.GetAddressOf())))) {
|
||||||
d3d_D3D12GetInterface(CLSID_D3D12DeviceFactory, IID_PPV_ARGS(device_factory.GetAddressOf()));
|
d3d_D3D12GetInterface(CLSID_D3D12DeviceFactoryGodot, IID_PPV_ARGS(device_factory.GetAddressOf()));
|
||||||
}
|
}
|
||||||
sdk_config1->Release();
|
sdk_config1->Release();
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,17 @@ extern "C" {
|
||||||
#undef UNUSED
|
#undef UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PIX_ENABLED
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#define _MSC_VER 1800
|
||||||
|
#endif
|
||||||
|
#define USE_PIX
|
||||||
|
#include "WinPixEventRuntime/pix3.h"
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#undef _MSC_VER
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
static const D3D12_RANGE VOID_RANGE = {};
|
static const D3D12_RANGE VOID_RANGE = {};
|
||||||
|
|
||||||
static const uint32_t ROOT_CONSTANT_SPACE = RDD::MAX_UNIFORM_SETS + 1;
|
static const uint32_t ROOT_CONSTANT_SPACE = RDD::MAX_UNIFORM_SETS + 1;
|
||||||
|
|
Loading…
Reference in a new issue