mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 01:24:11 +01:00
[dxvk] Always disable exclusive fullscreen
This commit is contained in:
parent
9e1bc1db23
commit
15db475edf
@ -502,7 +502,6 @@ namespace dxvk {
|
||||
presenterDesc.imageExtent = { m_desc.Width, m_desc.Height };
|
||||
presenterDesc.imageCount = PickImageCount(m_desc.BufferCount + 1);
|
||||
presenterDesc.numFormats = PickFormats(m_desc.Format, presenterDesc.formats);
|
||||
presenterDesc.fullScreenExclusive = PickFullscreenMode();
|
||||
|
||||
VkResult vr = m_presenter->recreateSwapChain(presenterDesc);
|
||||
|
||||
@ -537,7 +536,6 @@ namespace dxvk {
|
||||
presenterDesc.imageExtent = { m_desc.Width, m_desc.Height };
|
||||
presenterDesc.imageCount = PickImageCount(m_desc.BufferCount + 1);
|
||||
presenterDesc.numFormats = PickFormats(m_desc.Format, presenterDesc.formats);
|
||||
presenterDesc.fullScreenExclusive = PickFullscreenMode();
|
||||
|
||||
m_presenter = new Presenter(m_device, m_frameLatencySignal, presenterDesc);
|
||||
m_presenter->setFrameRateLimit(m_targetFrameRate, GetActualFrameLatency());
|
||||
@ -758,13 +756,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
VkFullScreenExclusiveEXT D3D11SwapChain::PickFullscreenMode() {
|
||||
return m_desc.Flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
|
||||
? VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT
|
||||
: VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
||||
}
|
||||
|
||||
|
||||
std::string D3D11SwapChain::GetApiName() const {
|
||||
Com<IDXGIDXVKDevice> device;
|
||||
m_parent->QueryInterface(__uuidof(IDXGIDXVKDevice), reinterpret_cast<void**>(&device));
|
||||
|
@ -170,8 +170,6 @@ namespace dxvk {
|
||||
uint32_t PickImageCount(
|
||||
UINT Preferred);
|
||||
|
||||
VkFullScreenExclusiveEXT PickFullscreenMode();
|
||||
|
||||
std::string GetApiName() const;
|
||||
|
||||
};
|
||||
|
@ -952,7 +952,6 @@ namespace dxvk {
|
||||
presenterDesc.imageExtent = GetPresentExtent();
|
||||
presenterDesc.imageCount = PickImageCount(m_presentParams.BackBufferCount + 1);
|
||||
presenterDesc.numFormats = PickFormats(EnumerateFormat(m_presentParams.BackBufferFormat), presenterDesc.formats);
|
||||
presenterDesc.fullScreenExclusive = PickFullscreenMode();
|
||||
|
||||
VkResult vr = m_wctx->presenter->recreateSwapChain(presenterDesc);
|
||||
|
||||
@ -985,7 +984,6 @@ namespace dxvk {
|
||||
presenterDesc.imageExtent = GetPresentExtent();
|
||||
presenterDesc.imageCount = PickImageCount(m_presentParams.BackBufferCount + 1);
|
||||
presenterDesc.numFormats = PickFormats(EnumerateFormat(m_presentParams.BackBufferFormat), presenterDesc.formats);
|
||||
presenterDesc.fullScreenExclusive = PickFullscreenMode();
|
||||
|
||||
m_wctx->presenter = new Presenter(m_device, m_wctx->frameLatencySignal, presenterDesc);
|
||||
}
|
||||
@ -1406,13 +1404,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
VkFullScreenExclusiveEXT D3D9SwapChainEx::PickFullscreenMode() {
|
||||
return m_dialog
|
||||
? VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT
|
||||
: VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT;
|
||||
}
|
||||
|
||||
|
||||
std::string D3D9SwapChainEx::GetApiName() {
|
||||
if (m_apiName == nullptr) {
|
||||
return this->GetParent()->IsExtended() ? "D3D9Ex" : "D3D9";
|
||||
|
@ -247,8 +247,6 @@ namespace dxvk {
|
||||
|
||||
VkExtent2D GetPresentExtent();
|
||||
|
||||
VkFullScreenExclusiveEXT PickFullscreenMode();
|
||||
|
||||
std::string GetApiName();
|
||||
|
||||
const Com<D3D9Surface, false>& GetFrontBuffer() const {
|
||||
|
@ -171,7 +171,7 @@ namespace dxvk {
|
||||
return VK_ERROR_SURFACE_LOST_KHR;
|
||||
|
||||
VkSurfaceFullScreenExclusiveInfoEXT fullScreenExclusiveInfo = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT };
|
||||
fullScreenExclusiveInfo.fullScreenExclusive = desc.fullScreenExclusive;
|
||||
fullScreenExclusiveInfo.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
||||
|
||||
VkPhysicalDeviceSurfaceInfo2KHR surfaceInfo = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR };
|
||||
surfaceInfo.surface = m_surface;
|
||||
@ -211,13 +211,13 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
// Select format based on swap chain properties
|
||||
if ((status = getSupportedFormats(formats, desc.fullScreenExclusive)))
|
||||
if ((status = getSupportedFormats(formats)))
|
||||
return status;
|
||||
|
||||
m_info.format = pickFormat(formats.size(), formats.data(), desc.numFormats, desc.formats);
|
||||
|
||||
// Select a present mode for the current sync interval
|
||||
if ((status = getSupportedPresentModes(modes, desc.fullScreenExclusive)))
|
||||
if ((status = getSupportedPresentModes(modes)))
|
||||
return status;
|
||||
|
||||
m_info.presentMode = pickPresentMode(modes.size(), modes.data(), m_info.syncInterval);
|
||||
@ -300,7 +300,7 @@ namespace dxvk {
|
||||
m_info.imageCount = pickImageCount(minImageCount, maxImageCount, desc.imageCount);
|
||||
|
||||
VkSurfaceFullScreenExclusiveInfoEXT fullScreenInfo = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT };
|
||||
fullScreenInfo.fullScreenExclusive = desc.fullScreenExclusive;
|
||||
fullScreenInfo.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
||||
|
||||
VkSwapchainPresentModesCreateInfoEXT modeInfo = { VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODES_CREATE_INFO_EXT };
|
||||
modeInfo.presentModeCount = compatibleModes.size();
|
||||
@ -333,8 +333,7 @@ namespace dxvk {
|
||||
"\n Color space: ", m_info.format.colorSpace,
|
||||
"\n Present mode: ", m_info.presentMode, " (dynamic: ", (dynamicModes.empty() ? "no)" : "yes)"),
|
||||
"\n Buffer size: ", m_info.imageExtent.width, "x", m_info.imageExtent.height,
|
||||
"\n Image count: ", m_info.imageCount,
|
||||
"\n Exclusive FS: ", desc.fullScreenExclusive));
|
||||
"\n Image count: ", m_info.imageCount));
|
||||
|
||||
if ((status = m_vkd->vkCreateSwapchainKHR(m_vkd->device(),
|
||||
&swapInfo, nullptr, &m_swapchain)))
|
||||
@ -414,7 +413,7 @@ namespace dxvk {
|
||||
return false;
|
||||
|
||||
std::vector<VkSurfaceFormatKHR> surfaceFormats;
|
||||
getSupportedFormats(surfaceFormats, VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT);
|
||||
getSupportedFormats(surfaceFormats);
|
||||
|
||||
for (const auto& surfaceFormat : surfaceFormats) {
|
||||
if (surfaceFormat.colorSpace == colorspace)
|
||||
@ -454,11 +453,11 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
VkResult Presenter::getSupportedFormats(std::vector<VkSurfaceFormatKHR>& formats, VkFullScreenExclusiveEXT fullScreenExclusive) const {
|
||||
VkResult Presenter::getSupportedFormats(std::vector<VkSurfaceFormatKHR>& formats) const {
|
||||
uint32_t numFormats = 0;
|
||||
|
||||
VkSurfaceFullScreenExclusiveInfoEXT fullScreenInfo = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT };
|
||||
fullScreenInfo.fullScreenExclusive = fullScreenExclusive;
|
||||
fullScreenInfo.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
||||
|
||||
VkPhysicalDeviceSurfaceInfo2KHR surfaceInfo = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, &fullScreenInfo };
|
||||
surfaceInfo.surface = m_surface;
|
||||
@ -496,11 +495,11 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
VkResult Presenter::getSupportedPresentModes(std::vector<VkPresentModeKHR>& modes, VkFullScreenExclusiveEXT fullScreenExclusive) const {
|
||||
VkResult Presenter::getSupportedPresentModes(std::vector<VkPresentModeKHR>& modes) const {
|
||||
uint32_t numModes = 0;
|
||||
|
||||
VkSurfaceFullScreenExclusiveInfoEXT fullScreenInfo = { VK_STRUCTURE_TYPE_SURFACE_FULL_SCREEN_EXCLUSIVE_INFO_EXT };
|
||||
fullScreenInfo.fullScreenExclusive = fullScreenExclusive;
|
||||
fullScreenInfo.fullScreenExclusive = VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
||||
|
||||
VkPhysicalDeviceSurfaceInfo2KHR surfaceInfo = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SURFACE_INFO_2_KHR, &fullScreenInfo };
|
||||
surfaceInfo.surface = m_surface;
|
||||
|
@ -32,7 +32,6 @@ namespace dxvk {
|
||||
uint32_t imageCount;
|
||||
uint32_t numFormats;
|
||||
VkSurfaceFormatKHR formats[4];
|
||||
VkFullScreenExclusiveEXT fullScreenExclusive;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -262,12 +261,10 @@ namespace dxvk {
|
||||
const PresenterDesc& desc);
|
||||
|
||||
VkResult getSupportedFormats(
|
||||
std::vector<VkSurfaceFormatKHR>& formats,
|
||||
VkFullScreenExclusiveEXT fullScreenExclusive) const;
|
||||
std::vector<VkSurfaceFormatKHR>& formats) const;
|
||||
|
||||
VkResult getSupportedPresentModes(
|
||||
std::vector<VkPresentModeKHR>& modes,
|
||||
VkFullScreenExclusiveEXT fullScreenExclusive) const;
|
||||
std::vector<VkPresentModeKHR>& modes) const;
|
||||
|
||||
VkResult getSwapImages(
|
||||
std::vector<VkImage>& images);
|
||||
|
Loading…
Reference in New Issue
Block a user