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);
|
2021-09-08 15:20:01 +02:00
|
|
|
this->ignoreGraphicsBarriers = config.getOption<bool>("d3d11.ignoreGraphicsBarriers", 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);
|
2021-01-28 20:09:10 +01:00
|
|
|
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);
|
2021-01-28 20:32:38 +01:00
|
|
|
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
|
2021-07-02 04:39:26 +02:00
|
|
|
this->disableMsaa = config.getOption<bool>("d3d11.disableMsaa", 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);
|
2021-06-09 03:46:12 +02:00
|
|
|
this->maxFrameRate = config.getOption<int32_t>("dxgi.maxFrameRate", 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
|
|
|
|
2022-02-14 04:11:36 +01:00
|
|
|
int32_t maxImplicitDiscardSize = config.getOption<int32_t>("d3d11.maxImplicitDiscardSize", 256);
|
|
|
|
this->maxImplicitDiscardSize = maxImplicitDiscardSize >= 0
|
|
|
|
? VkDeviceSize(maxImplicitDiscardSize) << 10
|
|
|
|
: VkDeviceSize(~0ull);
|
|
|
|
|
2022-02-22 04:58:42 +01:00
|
|
|
int32_t maxDynamicImageBufferSize = config.getOption<int32_t>("d3d11.maxDynamicImageBufferSize", -1);
|
|
|
|
this->maxDynamicImageBufferSize = maxDynamicImageBufferSize >= 0
|
|
|
|
? VkDeviceSize(maxDynamicImageBufferSize) << 10
|
|
|
|
: VkDeviceSize(~0ull);
|
|
|
|
|
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;
|
|
|
|
apitraceAttached = ::GetModuleHandle("dxgitrace.dll") != nullptr;
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
}
|