mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[dxgi] Implement IDXGIFactory6
This commit is contained in:
parent
f81395c742
commit
a7de355646
@ -223,6 +223,33 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE DxgiFactory::EnumAdapterByGpuPreference(
|
||||||
|
UINT Adapter,
|
||||||
|
DXGI_GPU_PREFERENCE GpuPreference,
|
||||||
|
REFIID riid,
|
||||||
|
void** ppvAdapter) {
|
||||||
|
InitReturnPtr(ppvAdapter);
|
||||||
|
uint32_t adapterCount = m_instance->adapterCount();
|
||||||
|
|
||||||
|
if (Adapter >= adapterCount)
|
||||||
|
return DXGI_ERROR_NOT_FOUND;
|
||||||
|
|
||||||
|
// We know that the backend lists dedicated GPUs before
|
||||||
|
// any integrated ones, so just list adapters in reverse
|
||||||
|
// order. We have no other way to estimate performance.
|
||||||
|
if (GpuPreference == DXGI_GPU_PREFERENCE_MINIMUM_POWER)
|
||||||
|
Adapter = adapterCount - Adapter - 1;
|
||||||
|
|
||||||
|
Com<IDXGIAdapter> adapter;
|
||||||
|
HRESULT hr = this->EnumAdapters(Adapter, &adapter);
|
||||||
|
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
return adapter->QueryInterface(riid, ppvAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE DxgiFactory::EnumWarpAdapter(
|
HRESULT STDMETHODCALLTYPE DxgiFactory::EnumWarpAdapter(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppvAdapter) {
|
void** ppvAdapter) {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
class DxgiFactory : public DxgiObject<IDXGIFactory5> {
|
class DxgiFactory : public DxgiObject<IDXGIFactory6> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -70,6 +70,12 @@ namespace dxvk {
|
|||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppvAdapter) final;
|
void** ppvAdapter) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE EnumAdapterByGpuPreference(
|
||||||
|
UINT Adapter,
|
||||||
|
DXGI_GPU_PREFERENCE GpuPreference,
|
||||||
|
REFIID riid,
|
||||||
|
void** ppvAdapter);
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE EnumWarpAdapter(
|
HRESULT STDMETHODCALLTYPE EnumWarpAdapter(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppvAdapter) final;
|
void** ppvAdapter) final;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user