Skip to content

Commit

Permalink
[dxgi] Allow HDR on UE4/D3D11 when NVAPI is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 authored and misyltoad committed Aug 25, 2023
1 parent 92dc61f commit 02db89a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/dxgi/dxgi_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ namespace dxvk {
}


static bool isNvapiEnabled() {
return env::getEnvVar("DXVK_ENABLE_NVAPI") == "1";
}


static bool isHDRDisallowed() {
#ifdef _WIN32
// Unreal Engine 4 titles use AGS/NVAPI to try and enable
Expand All @@ -53,7 +58,7 @@ namespace dxvk {
bool isUE4 = exeName.find("-Win64-Shipping") != std::string::npos;
bool hasD3D12 = GetModuleHandleA("d3d12") != nullptr;

if (isUE4 && !hasD3D12)
if (isUE4 && !hasD3D12 && !isNvapiEnabled())
return true;
#endif
return false;
Expand All @@ -74,7 +79,7 @@ namespace dxvk {
this->maxSharedMemory = VkDeviceSize(config.getOption<int32_t>("dxgi.maxSharedMemory", 0)) << 20;

// Expose Nvidia GPUs properly if NvAPI is enabled in environment
this->hideNvidiaGpu = env::getEnvVar("DXVK_ENABLE_NVAPI") != "1";
this->hideNvidiaGpu = !isNvapiEnabled();

Tristate hideNvidiaGpuOption = config.getOption<Tristate>("dxgi.hideNvidiaGpu", Tristate::Auto);

Expand Down

0 comments on commit 02db89a

Please sign in to comment.