diff --git a/src/dxgi/dxgi_output.cpp b/src/dxgi/dxgi_output.cpp index 91fb5670..bee7c493 100644 --- a/src/dxgi/dxgi_output.cpp +++ b/src/dxgi/dxgi_output.cpp @@ -57,7 +57,8 @@ namespace dxvk { || riid == __uuidof(IDXGIOutput2) || riid == __uuidof(IDXGIOutput3) || riid == __uuidof(IDXGIOutput4) - || riid == __uuidof(IDXGIOutput5)) { + || riid == __uuidof(IDXGIOutput5) + || riid == __uuidof(IDXGIOutput6)) { *ppvObject = ref(this); return S_OK; } @@ -200,6 +201,26 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE DxgiOutput::GetDesc(DXGI_OUTPUT_DESC *pDesc) { if (pDesc == nullptr) return DXGI_ERROR_INVALID_CALL; + + DXGI_OUTPUT_DESC1 desc; + HRESULT hr = GetDesc1(&desc); + + if (SUCCEEDED(hr)) { + std::memcpy(pDesc->DeviceName, desc.DeviceName, sizeof(pDesc->DeviceName)); + pDesc->DesktopCoordinates = desc.DesktopCoordinates; + pDesc->AttachedToDesktop = desc.AttachedToDesktop; + pDesc->Rotation = desc.Rotation; + pDesc->Monitor = desc.Monitor; + } + + return hr; + } + + + HRESULT STDMETHODCALLTYPE DxgiOutput::GetDesc1( + DXGI_OUTPUT_DESC1* pDesc) { + if (pDesc == nullptr) + return DXGI_ERROR_INVALID_CALL; ::MONITORINFOEXW monInfo; monInfo.cbSize = sizeof(monInfo); @@ -215,10 +236,24 @@ namespace dxvk { pDesc->AttachedToDesktop = 1; pDesc->Rotation = DXGI_MODE_ROTATION_UNSPECIFIED; pDesc->Monitor = m_monitor; + pDesc->BitsPerColor = 8; + pDesc->ColorSpace = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; + + // We don't really have a way to get these + for (uint32_t i = 0; i < 2; i++) { + pDesc->RedPrimary[i] = 0.0f; + pDesc->GreenPrimary[i] = 0.0f; + pDesc->BluePrimary[i] = 0.0f; + pDesc->WhitePoint[i] = 0.0f; + } + + pDesc->MinLuminance = 0.0f; + pDesc->MaxLuminance = 0.0f; + pDesc->MaxFullFrameLuminance = 0.0f; return S_OK; } - - + + HRESULT STDMETHODCALLTYPE DxgiOutput::GetDisplayModeList( DXGI_FORMAT EnumFormat, UINT Flags, @@ -475,6 +510,15 @@ namespace dxvk { } + HRESULT STDMETHODCALLTYPE DxgiOutput::CheckHardwareCompositionSupport( + UINT* pFlags) { + Logger::warn("DxgiOutput: CheckHardwareCompositionSupport: Stub"); + + *pFlags = 0; + return S_OK; + } + + void DxgiOutput::FilterModesByDesc( std::vector& Modes, const DXGI_MODE_DESC1& TargetMode) { diff --git a/src/dxgi/dxgi_output.h b/src/dxgi/dxgi_output.h index 33e5447c..0dc30868 100644 --- a/src/dxgi/dxgi_output.h +++ b/src/dxgi/dxgi_output.h @@ -24,7 +24,7 @@ namespace dxvk { } - class DxgiOutput : public DxgiObject { + class DxgiOutput : public DxgiObject { public: @@ -56,6 +56,9 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE GetDesc( DXGI_OUTPUT_DESC* pDesc) final; + HRESULT STDMETHODCALLTYPE GetDesc1( + DXGI_OUTPUT_DESC1* pDesc) final; + HRESULT STDMETHODCALLTYPE GetDisplayModeList( DXGI_FORMAT EnumFormat, UINT Flags, @@ -121,6 +124,9 @@ namespace dxvk { IUnknown* pConcernedDevice, UINT* pFlags) final; + HRESULT STDMETHODCALLTYPE CheckHardwareCompositionSupport( + UINT* pFlags) final; + private: DxgiMonitorInfo* m_monitorInfo = nullptr;