You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Intel Extensions
- Updating ExtensionsFramework with newest version. - Integrating Intel App Discovery. - Initial integration provided by Adam Kunka from Intel. #jira UE-205378 #rb daniele.vettorel [CL 31264776 by christopher waters in ue5-main branch]
This commit is contained in:
@@ -96817,7 +96817,7 @@
|
||||
<File Name="Engine/Source/ThirdParty/Intel/Embree/Embree3122/Win64/lib/embree3.lib" Hash="535b56e3e9ce082b519fc9bf73ad991ec7195c75" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/Embree/Embree3122/Win64/lib/tbb.lib" Hash="f3e30978f123fe03b317866969876274c7f4e71b" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/Embree/Embree3122/Win64/lib/tbb12.dll" Hash="02e7599d684ec3fc732e33d07ef6943f68fbcc0b" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/ExtensionsFramework/igdext64.lib" Hash="1ef810547616efb992d4a379e480b7fdeb2c5961" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/ExtensionsFramework/igdext64.lib" Hash="1a996374967e6dfe77da35d9efa46a1124e3c552" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/ISPC/bin/Linux/ispc" Hash="d06289af1f1e2585f55046e4b3e4579684af950c" IsExecutable="true" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/ISPC/bin/Mac/ispc" Hash="42f4bad05234f5e3f75469ad9af33e86820af8d6" IsExecutable="true" />
|
||||
<File Name="Engine/Source/ThirdParty/Intel/ISPC/bin/Windows/ispc.exe" Hash="55d849ddcbf4dabfe58506e4682d187960d2d2bc" IsExecutable="true" />
|
||||
@@ -117244,6 +117244,7 @@
|
||||
<Blob Hash="1a952e5fcdc79be9c8e8fa1be021697743b508d3" Size="3843" PackHash="13686fed6d3e6ff022c7244d583ca4c08feb7bd9" PackOffset="243478" />
|
||||
<Blob Hash="1a981592d29567e37bc57085bbc3e7f200a07ed3" Size="665934" PackHash="d949a0ff6dd3fe08cea5e2bf2730a09e8af0c534" PackOffset="397659" />
|
||||
<Blob Hash="1a995440beb211b62a62df5b68e5dbc1b2ed5cd9" Size="375753" PackHash="83ca732ad87d72aeac7491dcbbd5b22cbffd2372" PackOffset="96964" />
|
||||
<Blob Hash="1a996374967e6dfe77da35d9efa46a1124e3c552" Size="134870" PackHash="29b636b37188e09b6c8c544c50a7585c7c298adc" PackOffset="8" />
|
||||
<Blob Hash="1a99e9b5c124259379d56ed79ea4fc56d3a56574" Size="2874" PackHash="7cb23efae159f6bbbee8c33c8900388f9da6948d" PackOffset="376854" />
|
||||
<Blob Hash="1a9a60bfe4f7c62991b7001d6325b5b37d779ae4" Size="338" PackHash="d15a801addf58d3cb9aa8be599b23e2329c4c27f" PackOffset="1448365" />
|
||||
<Blob Hash="1a9ac42690cf3b6337dc293e409748c385d50ab5" Size="25480" PackHash="03d5cd63c8fc494d6231b818459c7af407ddf690" PackOffset="1813024" />
|
||||
@@ -118324,7 +118325,6 @@
|
||||
<Blob Hash="1ef3d692327fd71b073ff8de8d42de887f49b8da" Size="1662" PackHash="221a36de373fff01ad946287bb1a17ba3f8513b7" PackOffset="1268833" />
|
||||
<Blob Hash="1ef5f7abfead53800d873c99a0fcd8f8ef004ccb" Size="1580" PackHash="0d1a8db8ecac47de71532ff5913a517c64111ce7" PackOffset="371809" />
|
||||
<Blob Hash="1ef6659f5b811d0c52ffe7be0367938f059b95a0" Size="2924" PackHash="22c1ca1b28cefe888df197da58df6fe961b364dd" PackOffset="904894" />
|
||||
<Blob Hash="1ef810547616efb992d4a379e480b7fdeb2c5961" Size="124158" PackHash="8ca8e1f2733e90b88701cdd73a6b9b16af54fff7" PackOffset="8" />
|
||||
<Blob Hash="1ef89103dd633d18433af2a2e4318c10aec4a06c" Size="136344" PackHash="9ce2f322faca0ae17a8b88ac392916fa1019094f" PackOffset="991824" />
|
||||
<Blob Hash="1efa0f878bd6c3afa8182fdb7dc5bd2724eb7cb4" Size="13144" PackHash="33df6631f51c8882def69e28d0964982d76e802f" PackOffset="2075073" />
|
||||
<Blob Hash="1efa84d248c200025c9d6d63dd176fd4d695ba8c" Size="899" PackHash="320c337fca2202b33d589de8cc832ad77bf826eb" PackOffset="778641" />
|
||||
@@ -178283,6 +178283,7 @@
|
||||
<Pack Hash="2981952302ae2d5c766054b24d77765d40ddd2f2" Size="39686" CompressedSize="37152" RemotePath="UnrealEngine-25328963" />
|
||||
<Pack Hash="29884542b2400b10f83a20c14c74e9e7768e111b" Size="3520768" CompressedSize="552109" RemotePath="UnrealEngine-30221548" />
|
||||
<Pack Hash="29b5e322771959ce4233c89497b290940c002441" Size="2096648" CompressedSize="924942" RemotePath="UnrealEngine-25357016" />
|
||||
<Pack Hash="29b636b37188e09b6c8c544c50a7585c7c298adc" Size="134878" CompressedSize="32330" RemotePath="UnrealEngine-31263717" />
|
||||
<Pack Hash="29cbedfbafc8b15c298c43403e7e5fa16b51b4a1" Size="3620112" CompressedSize="1161484" RemotePath="UnrealEngine-25357016" />
|
||||
<Pack Hash="29d3646117de06e120dc3143454b7ef8a7eff803" Size="422975" CompressedSize="69089" RemotePath="UnrealEngine-30298871" />
|
||||
<Pack Hash="29d421bacc8a75e2e99ea00ff58f0f7523c8ebf1" Size="6146819" CompressedSize="5695677" RemotePath="UnrealEngine-25328963" />
|
||||
@@ -181329,7 +181330,6 @@
|
||||
<Pack Hash="8c96b969ec6b99e5f5ef0fac376f4ad51d2eb26f" Size="894" CompressedSize="718" RemotePath="UnrealEngine-25357016" />
|
||||
<Pack Hash="8ca47820888978acc97165562710115fd3238151" Size="9269868" CompressedSize="1792648" RemotePath="UnrealEngine-25357016" />
|
||||
<Pack Hash="8ca4b5f1d91630106b11db5bead1daff3564a0ac" Size="413383" CompressedSize="411879" RemotePath="UnrealEngine-25328963" />
|
||||
<Pack Hash="8ca8e1f2733e90b88701cdd73a6b9b16af54fff7" Size="124166" CompressedSize="28933" RemotePath="UnrealEngine-28343409" />
|
||||
<Pack Hash="8cadee7b970e89462a8bd2854cb2da684a723757" Size="2034674" CompressedSize="848047" RemotePath="UnrealEngine-25328963" />
|
||||
<Pack Hash="8cb6fe6a0322dd97c18fcaa0fbd33155c2499dbd" Size="88877" CompressedSize="83033" RemotePath="UnrealEngine-25357016" />
|
||||
<Pack Hash="8cc36245070fcdb4a2f47857ec561a69a1f75bd1" Size="2364216" CompressedSize="477586" RemotePath="UnrealEngine-29872826" />
|
||||
|
||||
@@ -571,6 +571,14 @@ void FD3D12Adapter::CreateRootDevice(bool bWithDebug)
|
||||
|
||||
if (!bDeviceCreated)
|
||||
{
|
||||
#if INTEL_EXTENSIONS
|
||||
// Enable Intel App Discovery
|
||||
if (IsRHIDeviceIntel() && bAllowVendorDevice)
|
||||
{
|
||||
EnableIntelAppDiscovery(GRHIDeviceId);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Creating the Direct3D device.
|
||||
VERIFYD3D12RESULT(D3D12CreateDevice(
|
||||
GetAdapter(),
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
struct INTCExtensionContext;
|
||||
struct INTCExtensionInfo;
|
||||
|
||||
void DestroyIntelExtensionsContext(INTCExtensionContext* IntelExtensionContext);
|
||||
INTCExtensionContext* CreateIntelExtensionsContext(ID3D12Device* Device, INTCExtensionInfo& INTCExtensionInfo);
|
||||
void DestroyIntelExtensionsContext(INTCExtensionContext* IntelExtensionContext);
|
||||
|
||||
bool EnableIntelAtomic64Support(INTCExtensionContext* IntelExtensionContext, INTCExtensionInfo& INTCExtensionInfo);
|
||||
void EnableIntelAppDiscovery(uint32 DeviceId);
|
||||
|
||||
#endif //INTEL_EXTENSIONS
|
||||
|
||||
@@ -207,21 +207,25 @@ static D3D_SHADER_MODEL FindHighestShaderModel(ID3D12Device* Device)
|
||||
}
|
||||
|
||||
#if INTEL_EXTENSIONS
|
||||
void DestroyIntelExtensionsContext(INTCExtensionContext* IntelExtensionContext)
|
||||
static INTCExtensionAppInfo1 GetIntelApplicationInfo()
|
||||
{
|
||||
if (IntelExtensionContext)
|
||||
{
|
||||
const HRESULT hr = INTC_DestroyDeviceExtensionContext(&IntelExtensionContext);
|
||||
// CVar set to disable workload registration
|
||||
static TConsoleVariableData<int32>* CVarDisableEngineAndAppRegistration = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.DisableEngineAndAppRegistration"));
|
||||
|
||||
if (hr == S_OK)
|
||||
{
|
||||
UE_LOG(LogD3D12RHI, Log, TEXT("Intel Extensions Framework unloaded"));
|
||||
}
|
||||
else if (hr == E_INVALIDARG)
|
||||
{
|
||||
UE_LOG(LogD3D12RHI, Log, TEXT("Intel Extensions Framework error when unloading"));
|
||||
}
|
||||
INTCExtensionAppInfo1 AppInfo{};
|
||||
|
||||
if (!(CVarDisableEngineAndAppRegistration && CVarDisableEngineAndAppRegistration->GetValueOnAnyThread() != 0))
|
||||
{
|
||||
AppInfo.pApplicationName = FApp::HasProjectName() ? FApp::GetProjectName() : TEXT("");
|
||||
//AppInfo.ApplicationVersion = FApp::GetBuildVersion(); // Currently no support for version
|
||||
|
||||
AppInfo.pEngineName = TEXT("Unreal Engine");
|
||||
AppInfo.EngineVersion.major = FEngineVersion::Current().GetMajor();
|
||||
AppInfo.EngineVersion.minor = FEngineVersion::Current().GetMinor();
|
||||
AppInfo.EngineVersion.patch = FEngineVersion::Current().GetPatch();
|
||||
}
|
||||
|
||||
return AppInfo;
|
||||
}
|
||||
|
||||
INTCExtensionContext* CreateIntelExtensionsContext(ID3D12Device* Device, INTCExtensionInfo& INTCExtensionInfo)
|
||||
@@ -261,11 +265,8 @@ INTCExtensionContext* CreateIntelExtensionsContext(ID3D12Device* Device, INTCExt
|
||||
}
|
||||
|
||||
INTCExtensionContext* IntelExtensionContext = nullptr;
|
||||
INTCExtensionAppInfo1 AppInfo{};
|
||||
AppInfo.pEngineName = TEXT("Unreal Engine");
|
||||
AppInfo.EngineVersion.major = FEngineVersion::Current().GetMajor();
|
||||
AppInfo.EngineVersion.minor = FEngineVersion::Current().GetMinor();
|
||||
AppInfo.EngineVersion.patch = FEngineVersion::Current().GetPatch();
|
||||
// Fill in registration information for this workload (App name and Engine name)
|
||||
INTCExtensionAppInfo1 AppInfo = GetIntelApplicationInfo();
|
||||
|
||||
const HRESULT hr = INTC_D3D12_CreateDeviceExtensionContext1(Device, &IntelExtensionContext, &INTCExtensionInfo, &AppInfo);
|
||||
|
||||
@@ -303,6 +304,22 @@ INTCExtensionContext* CreateIntelExtensionsContext(ID3D12Device* Device, INTCExt
|
||||
return IntelExtensionContext;
|
||||
}
|
||||
|
||||
void DestroyIntelExtensionsContext(INTCExtensionContext* IntelExtensionContext)
|
||||
{
|
||||
if (IntelExtensionContext)
|
||||
{
|
||||
const HRESULT hr = INTC_DestroyDeviceExtensionContext(&IntelExtensionContext);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
UE_LOG(LogD3D12RHI, Log, TEXT("Intel Extensions Framework unloaded"));
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogD3D12RHI, Log, TEXT("Intel Extensions Framework error when unloading: 0x%08x"), hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool EnableIntelAtomic64Support(INTCExtensionContext* IntelExtensionContext, INTCExtensionInfo& INTCExtensionInfo)
|
||||
{
|
||||
if (IntelExtensionContext)
|
||||
@@ -341,7 +358,22 @@ bool EnableIntelAtomic64Support(INTCExtensionContext* IntelExtensionContext, INT
|
||||
|
||||
return GDX12INTCAtomicUInt64Emulation;
|
||||
}
|
||||
#endif
|
||||
|
||||
void EnableIntelAppDiscovery(uint32 DeviceId)
|
||||
{
|
||||
if (FAILED(INTC_LoadExtensionsLibrary(false, (uint32)EGpuVendorId::Intel, DeviceId)))
|
||||
{
|
||||
UE_LOG(LogD3D12RHI, Log, TEXT("Failed to load Intel Extensions Library (App Discovery)"));
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill in registration information for this workload (App name and Engine name)
|
||||
INTCExtensionAppInfo1 AppInfo = GetIntelApplicationInfo();
|
||||
|
||||
// Intel Application Discovery - registering UE5 application info in the driver
|
||||
INTC_D3D12_SetApplicationInfo(&AppInfo);
|
||||
}
|
||||
#endif // INTEL_EXTENSIONS
|
||||
|
||||
static bool CheckDeviceForEmulatedAtomic64Support(IDXGIAdapter* Adapter, ID3D12Device* Device)
|
||||
{
|
||||
@@ -827,6 +859,7 @@ void FD3D12DynamicRHIModule::FindAdapter()
|
||||
}
|
||||
|
||||
const EGpuVendorId PreferredVendor = RHIGetPreferredAdapterVendor();
|
||||
const bool bAllowVendorDevice = !FParse::Param(FCommandLine::Get(), TEXT("novendordevice"));
|
||||
|
||||
// Enumerate the DXGIFactory's adapters.
|
||||
for (uint32 AdapterIndex = 0; FD3D12AdapterDesc::EnumAdapters(AdapterIndex, GpuPreference, DXGIFactory4, DXGIFactory6, TempAdapter.GetInitReference()) != DXGI_ERROR_NOT_FOUND; ++AdapterIndex)
|
||||
@@ -835,14 +868,24 @@ void FD3D12DynamicRHIModule::FindAdapter()
|
||||
if (TempAdapter)
|
||||
{
|
||||
FD3D12DeviceBasicInfo DeviceInfo;
|
||||
// Log some information about the available D3D12 adapters.
|
||||
DXGI_ADAPTER_DESC AdapterDesc{};
|
||||
VERIFYD3D12RESULT(TempAdapter->GetDesc(&AdapterDesc));
|
||||
|
||||
#if INTEL_EXTENSIONS
|
||||
// Enable Intel App Discovery
|
||||
if (AdapterDesc.VendorId == (uint32)EGpuVendorId::Intel && bAllowVendorDevice)
|
||||
{
|
||||
// Intel's App information needs to be registered *before* device creation, so we have to do it here at the last second.
|
||||
// Even though it takes the device ID as an argument, we've been told by Intel that this isn't going to cause problems if multiple Intel devices are detected.
|
||||
EnableIntelAppDiscovery(AdapterDesc.DeviceId);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SafeTestD3D12CreateDevice(TempAdapter, MinRequiredFeatureLevel, DeviceInfo))
|
||||
{
|
||||
check(DeviceInfo.NumDeviceNodes > 0);
|
||||
|
||||
// Log some information about the available D3D12 adapters.
|
||||
DXGI_ADAPTER_DESC AdapterDesc{};
|
||||
VERIFYD3D12RESULT(TempAdapter->GetDesc(&AdapterDesc));
|
||||
|
||||
const uint32 OutputCount = CountAdapterOutputs(TempAdapter);
|
||||
|
||||
UE_LOG(LogD3D12RHI, Log,
|
||||
|
||||
@@ -20,10 +20,6 @@ public class IntelExtensionsFramework : ModuleRules
|
||||
|
||||
PublicSystemIncludePaths.Add(IncludeDir);
|
||||
PublicAdditionalLibraries.Add(Path.Combine(LibrariesDir, "igdext64.lib"));
|
||||
|
||||
PublicSystemLibraries.Add("shlwapi.lib");
|
||||
PublicSystemLibraries.Add("setupapi.lib");
|
||||
PublicSystemLibraries.Add("cfgmgr32.lib");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -151,6 +151,7 @@ extern "C" {
|
||||
HLSL = 5, // ??
|
||||
CL_BIN = 6, // CL FE/BE generated Binary
|
||||
ESIMD_SPIRV = 7, // input is ESIMD SPIRV
|
||||
ZEBIN_ELF = 8 // ZEBIN_ELF format shader binary
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -265,7 +266,8 @@ extern "C" {
|
||||
|
||||
// List of Intel D3D12 Features
|
||||
enum INTC_D3D12_FEATURES {
|
||||
INTC_D3D12_FEATURE_D3D12_OPTIONS1
|
||||
INTC_D3D12_FEATURE_D3D12_OPTIONS1,
|
||||
INTC_D3D12_FEATURE_D3D12_OPTIONS2
|
||||
};
|
||||
|
||||
struct INTC_D3D12_FEATURE_DATA_D3D12_OPTIONS1
|
||||
@@ -275,6 +277,13 @@ extern "C" {
|
||||
BOOL EmulatedTyped64bitAtomics;
|
||||
};
|
||||
|
||||
struct INTC_D3D12_FEATURE_DATA_D3D12_OPTIONS2
|
||||
{
|
||||
BOOL SIMD16Required;
|
||||
BOOL LSCSupported;
|
||||
BOOL LegacyTranslationRequired;
|
||||
};
|
||||
|
||||
#endif //INTC_IGDEXT_D3D12
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -710,6 +719,42 @@ extern "C" {
|
||||
void* pFeatureSupportData,
|
||||
UINT FeatureSupportDataSize );
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Sets a custom shader cache file path
|
||||
/// @param pExtensionContext A pointer to the extension context associated with the current Device.
|
||||
/// @param filePath path to a pre-built shader cache file
|
||||
/// @returns HRESULT S_OK if it was successful
|
||||
HRESULT INTC_D3D12_AddShaderCachePath(
|
||||
INTCExtensionContext* pExtensionContext,
|
||||
const wchar_t* filePath );
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Removes a custom shader cache file path
|
||||
/// @param pExtensionContext A pointer to the extension context associated with the current Device.
|
||||
/// @param filePath path to a pre-built shader cache file
|
||||
/// @returns HRESULT S_OK if it was successful
|
||||
HRESULT INTC_D3D12_RemoveShaderCachePath(
|
||||
INTCExtensionContext* pExtensionContext,
|
||||
const wchar_t* filePath );
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Register Application Info in the graphics driver
|
||||
/// @details
|
||||
/// This function needs to be invoked before a D3D12 device has been created.
|
||||
/// Prior to this function call, INTC_LoadExtensionsLibrary() has to be invoked with Vendor and Device ID information, to load the appropriate UMD dll.
|
||||
/// @param pExtensionAppInfo Application Info to be passed to the driver
|
||||
/// @returns HRESULT S_OK if it was successful
|
||||
HRESULT INTC_D3D12_SetApplicationInfo(
|
||||
INTCExtensionAppInfo1* pExtensionAppInfo );
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Internal use - Helps to retrieve previously set the Application Info
|
||||
/// @param pExtensionAppInfo Application Info returned the extension DLL
|
||||
/// @returns HRESULT S_OK if it was successful
|
||||
HRESULT INTC_D3D12_GetApplicationInfo(
|
||||
INTCExtensionAppInfo1* pExtensionAppInfo );
|
||||
|
||||
|
||||
#endif //INTC_IGDEXT_D3D12
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -728,14 +773,18 @@ extern "C" {
|
||||
/// @param useCurrentProcessDir If true, this function attempts to load the Extensions Framework DLL
|
||||
/// from the current process directory. If false, this fnction attempts to load the Extensions
|
||||
/// Framework DLL from the installed graphics driver directory.
|
||||
/// @param VendorID The Vendor ID of the graphics adapter
|
||||
/// @param DeviceID The Device ID of the graphics adapter
|
||||
/// NOTE: This function determines the path to the installed Intel graphics driver directory using
|
||||
/// Intel's D3D11 or D3D12 user mode driver DLL, which is expected to already be loaded by the
|
||||
/// current process. If this function is called before one of those DLLs is loaded (i.e. before
|
||||
/// the application has called CreateDevice(...)), then it will fail and return E_FAIL.
|
||||
/// current process. If this function is called before one of those DLLs is loaded, then the
|
||||
/// Vendor and Device ID need to be supplied.
|
||||
/// @returns HRESULT Returns S_OK if it was successful.
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
HRESULT INTC_LoadExtensionsLibrary(
|
||||
bool useCurrentProcessDir = false );
|
||||
bool useCurrentProcessDir = false,
|
||||
size_t VendorID = 0,
|
||||
size_t DeviceID = 0 );
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Extension library loading helper function.
|
||||
|
||||
Reference in New Issue
Block a user