mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[dxgi] Create persistent DxgiOutput object
This commit is contained in:
parent
f13011f487
commit
ad7f0971cf
@ -16,6 +16,7 @@ namespace dxvk {
|
|||||||
const Rc<DxvkAdapter>& adapter)
|
const Rc<DxvkAdapter>& adapter)
|
||||||
: m_factory (factory),
|
: m_factory (factory),
|
||||||
m_adapter (adapter) {
|
m_adapter (adapter) {
|
||||||
|
SetupOutputs();
|
||||||
SetupFormatTable();
|
SetupFormatTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,14 +65,10 @@ namespace dxvk {
|
|||||||
if (ppOutput == nullptr)
|
if (ppOutput == nullptr)
|
||||||
return DXGI_ERROR_INVALID_CALL;
|
return DXGI_ERROR_INVALID_CALL;
|
||||||
|
|
||||||
if (Output > 0) {
|
if (Output > 0)
|
||||||
*ppOutput = nullptr;
|
|
||||||
return DXGI_ERROR_NOT_FOUND;
|
return DXGI_ERROR_NOT_FOUND;
|
||||||
}
|
|
||||||
|
|
||||||
// TODO support multiple monitors
|
*ppOutput = m_output.ref();
|
||||||
HMONITOR monitor = ::MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY);
|
|
||||||
*ppOutput = ref(new DxgiOutput(this, monitor));
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,6 +274,13 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DxgiAdapter::SetupOutputs() {
|
||||||
|
// TODO support multiple monitors
|
||||||
|
HMONITOR monitor = ::MonitorFromPoint({ 0, 0 }, MONITOR_DEFAULTTOPRIMARY);
|
||||||
|
m_output = new DxgiOutput(this, monitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void DxgiAdapter::SetupFormatTable() {
|
void DxgiAdapter::SetupFormatTable() {
|
||||||
/***********************************************************************************/
|
/***********************************************************************************/
|
||||||
/* C O L O R F O R M A T S */
|
/* C O L O R F O R M A T S */
|
||||||
|
@ -66,6 +66,7 @@ namespace dxvk {
|
|||||||
using FormatMap = std::unordered_map<DXGI_FORMAT, DxgiFormatInfo>;
|
using FormatMap = std::unordered_map<DXGI_FORMAT, DxgiFormatInfo>;
|
||||||
|
|
||||||
Com<DxgiFactory> m_factory;
|
Com<DxgiFactory> m_factory;
|
||||||
|
Com<DxgiOutput> m_output;
|
||||||
Rc<DxvkAdapter> m_adapter;
|
Rc<DxvkAdapter> m_adapter;
|
||||||
|
|
||||||
FormatMap m_colorFormats;
|
FormatMap m_colorFormats;
|
||||||
@ -91,6 +92,8 @@ namespace dxvk {
|
|||||||
VkFormat dstFormat,
|
VkFormat dstFormat,
|
||||||
VkImageAspectFlags srvAspect);
|
VkImageAspectFlags srvAspect);
|
||||||
|
|
||||||
|
void SetupOutputs();
|
||||||
|
|
||||||
void SetupFormatTable();
|
void SetupFormatTable();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user