2018-03-24 18:54:00 +01:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2018-03-24 17:29:13 +01:00
|
|
|
#include "d3d11_options.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2019-10-30 10:57:36 +01:00
|
|
|
D3D11Options::D3D11Options(const Config& config, const Rc<DxvkDevice>& device) {
|
|
|
|
const DxvkDeviceInfo& devInfo = device->properties();
|
|
|
|
|
2019-01-14 18:28:53 +01:00
|
|
|
this->dcSingleUseMode = config.getOption<bool>("d3d11.dcSingleUseMode", true);
|
2019-11-30 17:01:44 +01:00
|
|
|
this->enableRtOutputNanFixup = config.getOption<bool>("d3d11.enableRtOutputNanFixup", false);
|
2019-04-05 20:24:08 +02:00
|
|
|
this->zeroInitWorkgroupMemory = config.getOption<bool>("d3d11.zeroInitWorkgroupMemory", false);
|
2020-02-07 22:47:06 +01:00
|
|
|
this->forceTgsmBarriers = config.getOption<bool>("d3d11.forceTgsmBarriers", false);
|
2019-02-07 00:57:21 +01:00
|
|
|
this->relaxedBarriers = config.getOption<bool>("d3d11.relaxedBarriers", false);
|
2019-01-14 18:28:53 +01:00
|
|
|
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
|
|
|
|
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
|
2020-01-23 01:28:19 +01:00
|
|
|
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", false);
|
2019-01-14 18:28:53 +01:00
|
|
|
this->deferSurfaceCreation = config.getOption<bool>("dxgi.deferSurfaceCreation", false);
|
2018-10-22 22:41:54 +02:00
|
|
|
this->numBackBuffers = config.getOption<int32_t>("dxgi.numBackBuffers", 0);
|
2019-01-14 18:28:53 +01:00
|
|
|
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
|
2018-10-22 22:41:54 +02:00
|
|
|
this->syncInterval = config.getOption<int32_t>("dxgi.syncInterval", -1);
|
2020-05-02 10:18:13 +02:00
|
|
|
this->tearFree = config.getOption<Tristate>("dxgi.tearFree", Tristate::Auto);
|
2019-10-26 22:56:47 +02:00
|
|
|
|
2019-10-30 10:57:36 +01:00
|
|
|
this->constantBufferRangeCheck = config.getOption<bool>("d3d11.constantBufferRangeCheck", false)
|
|
|
|
&& DxvkGpuVendor(devInfo.core.properties.vendorID) != DxvkGpuVendor::Amd;
|
|
|
|
|
2019-10-26 22:56:47 +02:00
|
|
|
bool apitraceAttached = false;
|
|
|
|
#ifndef __WINE__
|
|
|
|
apitraceAttached = ::GetModuleHandle("dxgitrace.dll") != nullptr;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
this->apitraceMode = config.getOption<bool>("d3d11.apitraceMode", apitraceAttached);
|
|
|
|
|
|
|
|
// Inform user in case they have the option enabled or a game
|
|
|
|
// ships a file called dxgitrace.dll for whatever reason.
|
|
|
|
if (this->apitraceMode)
|
|
|
|
Logger::warn("D3D11: Apitrace mode enabled, may affect performance!");
|
2018-03-24 17:29:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|