1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-14 18:23:52 +01:00
dxvk/src/dxbc/dxbc_options.cpp

27 lines
993 B
C++
Raw Normal View History

#include "dxbc_options.h"
namespace dxvk {
DxbcOptions::DxbcOptions(const Rc<DxvkDevice>& device) {
const VkPhysicalDeviceProperties devProps = device->adapter()->deviceProperties();
const VkPhysicalDeviceFeatures devFeatures = device->features();
// Apply driver-specific workarounds
const DxvkGpuVendor vendor = static_cast<DxvkGpuVendor>(devProps.vendorID);
if (vendor == DxvkGpuVendor::Nvidia
&& (devProps.driverVersion < VK_MAKE_VERSION(396, 18, 0)
|| getEnvVar(L"__GL_NextGenCompiler") != "0")) {
// Older versions of the driver expect the
// coordinate vector to have an extra component
this->addExtraDrefCoordComponent = true;
// From vkd3d: NMin/NMax/NClamp may crash the driver.
this->useSimpleMinMaxClamp = true;
}
// Enable certain features if they are supported by the device
this->useStorageImageReadWithoutFormat = devFeatures.shaderStorageImageReadWithoutFormat;
}
}