#include #include "d3d11_options.h" namespace dxvk { D3D11Options::D3D11Options(const Config& config, const Rc& device) { const DxvkDeviceInfo& devInfo = device->properties(); this->dcSingleUseMode = config.getOption("d3d11.dcSingleUseMode", true); this->enableRtOutputNanFixup = config.getOption("d3d11.enableRtOutputNanFixup", false); this->zeroInitWorkgroupMemory = config.getOption("d3d11.zeroInitWorkgroupMemory", false); this->forceTgsmBarriers = config.getOption("d3d11.forceTgsmBarriers", false); this->relaxedBarriers = config.getOption("d3d11.relaxedBarriers", false); this->ignoreGraphicsBarriers = config.getOption("d3d11.ignoreGraphicsBarriers", false); this->maxTessFactor = config.getOption("d3d11.maxTessFactor", 0); this->samplerAnisotropy = config.getOption("d3d11.samplerAnisotropy", -1); this->invariantPosition = config.getOption("d3d11.invariantPosition", true); this->floatControls = config.getOption("d3d11.floatControls", true); this->disableMsaa = config.getOption("d3d11.disableMsaa", false); this->deferSurfaceCreation = config.getOption("dxgi.deferSurfaceCreation", false); this->numBackBuffers = config.getOption("dxgi.numBackBuffers", 0); this->maxFrameLatency = config.getOption("dxgi.maxFrameLatency", 0); this->maxFrameRate = config.getOption("dxgi.maxFrameRate", 0); this->syncInterval = config.getOption("dxgi.syncInterval", -1); this->tearFree = config.getOption("dxgi.tearFree", Tristate::Auto); int32_t maxImplicitDiscardSize = config.getOption("d3d11.maxImplicitDiscardSize", 256); this->maxImplicitDiscardSize = maxImplicitDiscardSize >= 0 ? VkDeviceSize(maxImplicitDiscardSize) << 10 : VkDeviceSize(~0ull); int32_t maxDynamicImageBufferSize = config.getOption("d3d11.maxDynamicImageBufferSize", -1); this->maxDynamicImageBufferSize = maxDynamicImageBufferSize >= 0 ? VkDeviceSize(maxDynamicImageBufferSize) << 10 : VkDeviceSize(~0ull); this->constantBufferRangeCheck = config.getOption("d3d11.constantBufferRangeCheck", false) && DxvkGpuVendor(devInfo.core.properties.vendorID) != DxvkGpuVendor::Amd; bool apitraceAttached = false; apitraceAttached = ::GetModuleHandle("dxgitrace.dll") != nullptr; this->apitraceMode = config.getOption("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!"); } }