mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +01:00
[dxgi] Add app-specific DXGI options
This commit is contained in:
parent
a43025294a
commit
f087016e77
20
src/dxgi/dxgi_options.cpp
Normal file
20
src/dxgi/dxgi_options.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include "dxgi_options.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
const static std::unordered_map<std::string, DxgiOptions> g_dxgiAppOptions = {{
|
||||
{ "Frostpunk.exe", DxgiOptions(DxgiOption::DeferSurfaceCreation) },
|
||||
}};
|
||||
|
||||
|
||||
DxgiOptions getDxgiAppOptions(const std::string& appName) {
|
||||
auto appOptions = g_dxgiAppOptions.find(appName);
|
||||
|
||||
return appOptions != g_dxgiAppOptions.end()
|
||||
? appOptions->second
|
||||
: DxgiOptions();
|
||||
}
|
||||
|
||||
}
|
30
src/dxgi/dxgi_options.h
Normal file
30
src/dxgi/dxgi_options.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "dxgi_include.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
/**
|
||||
* \brief DXGI options
|
||||
*
|
||||
* Per-app options that control the
|
||||
* behaviour of some DXGI classes.
|
||||
*/
|
||||
enum class DxgiOption : uint64_t {
|
||||
/// Defer surface creation until first present call. This
|
||||
/// fixes issues with games that create multiple swap chains
|
||||
/// for a single window that may interfere with each other.
|
||||
DeferSurfaceCreation,
|
||||
};
|
||||
|
||||
using DxgiOptions = Flags<DxgiOption>;
|
||||
|
||||
/**
|
||||
* \brief Gets app-specific DXGI options
|
||||
*
|
||||
* \param [in] appName Application name
|
||||
* \returns DXGI options for this application
|
||||
*/
|
||||
DxgiOptions getDxgiAppOptions(const std::string& appName);
|
||||
|
||||
}
|
@ -10,6 +10,7 @@ dxgi_src = [
|
||||
'dxgi_factory.cpp',
|
||||
'dxgi_format.cpp',
|
||||
'dxgi_main.cpp',
|
||||
'dxgi_options.cpp',
|
||||
'dxgi_output.cpp',
|
||||
'dxgi_presenter.cpp',
|
||||
'dxgi_swapchain.cpp',
|
||||
|
Loading…
Reference in New Issue
Block a user