Compare commits

...
Author SHA1 Message Date
lightningterror cdc3fc4de2 GS: Update intel igpu/dgpu auto renderer.
Ivy Bridge and below default to Direct3D11.

Haswell/Broadwell default to OpenGL.

Skylake and above default to Direct3D12.
2026-09-11 08:47:47 +02:00
lightningterror a5fc5aefc9 GS/DX12: Enable dx12 support on haswell/broadwell if supported.
Could be useful for testing, also there's no need to lock it out even if it has issues as it can come in handy similar to Fermi.
2026-09-11 03:13:30 +02:00
2 changed files with 32 additions and 21 deletions
+29 -14
View File
@@ -374,6 +374,8 @@ GSRendererType D3D::GetPreferredRenderer()
Console.WriteLn("D3D11 feature level for autodetection: %x", static_cast<unsigned>(feature_level));
return feature_level;
};
/*
const auto get_d3d12_device = [&adapter]() {
wil::com_ptr_nothrow<ID3D12Device> device;
const HRESULT hr = D3D12CreateDevice(adapter.get(), D3D_FEATURE_LEVEL_12_0, IID_PPV_ARGS(device.put()));
@@ -381,6 +383,7 @@ GSRendererType D3D::GetPreferredRenderer()
Console.Error("D3D12CreateDevice() for automatic renderer failed: %08X", hr);
return device;
};
#ifdef ENABLE_VULKAN
static constexpr auto check_vulkan_supported = []() {
if (!GSDeviceVK::EnumerateGPUs().empty())
@@ -395,6 +398,7 @@ GSRendererType D3D::GetPreferredRenderer()
#else
static constexpr auto check_vulkan_supported = []() { return false; };
#endif
*/
switch (GetVendorID(adapter.get()))
{
@@ -432,26 +436,37 @@ GSRendererType D3D::GetPreferredRenderer()
// Sampler feedback Tier 0.9 is only present in Tiger Lake/Xe/Arc, so we can use that to
// differentiate between them. Unfortunately, that requires a D3D12 device.
const auto device12 = get_d3d12_device();
if (device12)
const std::optional<D3D_FEATURE_LEVEL> feature_level = get_d3d11_feature_level();
if (!feature_level.has_value())
return GSRendererType::DX11;
else if (feature_level == D3D_FEATURE_LEVEL_12_0)
{
D3D12_FEATURE_DATA_D3D12_OPTIONS7 opts = {};
if (SUCCEEDED(device12->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &opts, sizeof(opts))) &&
(opts.SamplerFeedbackTier >= D3D12_SAMPLER_FEEDBACK_TIER_0_9) &&
check_vulkan_supported())
return GSRendererType::DX12;
/*
// Keep the old code as a reference if we need it.
const auto device12 = get_d3d12_device();
if (device12)
{
Console.WriteLn("Sampler feedback tier 0.9 found for Intel GPU, defaulting to Vulkan.");
return GSRendererType::VK;
D3D12_FEATURE_DATA_D3D12_OPTIONS7 opts = {};
if (SUCCEEDED(device12->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &opts, sizeof(opts))) &&
(opts.SamplerFeedbackTier >= D3D12_SAMPLER_FEEDBACK_TIER_0_9) &&
check_vulkan_supported())
{
Console.WriteLn("Sampler feedback tier 0.9 found for Intel GPU, defaulting to Vulkan.");
return GSRendererType::VK;
}
else
return GSRendererType::OGL;
}
else
{
Console.WriteLn("Sampler feedback tier 0.9 or Vulkan not found for Intel GPU, using OpenGL.");
return GSRendererType::OGL;
}
*/
}
Console.WriteLn("Sampler feedback tier 0.9 or Direct3D 12 not found for Intel GPU, using Direct3D 11.");
return GSRendererType::DX11;
else if (feature_level == D3D_FEATURE_LEVEL_11_1)
return GSRendererType::OGL;
else
return GSRendererType::DX11;
}
break;
+3 -7
View File
@@ -289,16 +289,12 @@ bool GSDevice12::CreateDevice(u32& vendor_id)
// Create the actual device.
// Intel Haswell DX12 support is specific:
// Newerest drivers have dx12 support disabled so the last driver to support dx12 is 15.40.42.5063.
// Newer drivers have dx12 support disabled so the last driver to support dx12 is 15.40.42.5063.
// Shader cache must be also disabled, and make sure Debug Device option is disabled as well.
// Let's enable it on dev/debug for testing purposes so we don't have to change this all the time.
// Let's enable it for testing purposes so we don't have to change this all the time, and
// might be handy for the tweakers that want to run dx12.
// TODO: Find out the status of Broadwell.
#ifdef PCSX2_DEVBUILD
hr = D3D12CreateDevice(m_adapter.get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device));
#else
const bool isIntel = (vendor_id == 0x163C || vendor_id == 0x8086 || vendor_id == 0x8087);
hr = D3D12CreateDevice(m_adapter.get(), isIntel ? D3D_FEATURE_LEVEL_12_0 : D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device));
#endif
if (FAILED(hr))
{