2018-01-07 20:05:27 +01:00
|
|
|
#include "dxbc_options.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
DxbcOptions::DxbcOptions(const Rc<DxvkDevice>& device) {
|
2018-03-21 12:47:53 +01:00
|
|
|
const VkPhysicalDeviceProperties devProps = device->adapter()->deviceProperties();
|
|
|
|
const VkPhysicalDeviceFeatures devFeatures = device->features();
|
2018-01-07 20:05:27 +01:00
|
|
|
|
2018-03-21 12:47:53 +01:00
|
|
|
// Apply driver-specific workarounds
|
|
|
|
const DxvkGpuVendor vendor = static_cast<DxvkGpuVendor>(devProps.vendorID);
|
2018-01-07 20:05:27 +01:00
|
|
|
|
2018-04-11 00:20:24 +02:00
|
|
|
if (vendor == DxvkGpuVendor::Nvidia
|
2018-04-11 00:26:42 +02:00
|
|
|
&& (devProps.driverVersion < VK_MAKE_VERSION(396, 18, 0)
|
2018-04-11 01:49:39 +02:00
|
|
|
|| env::getEnvVar(L"__GL_NextGenCompiler") == "0")) {
|
2018-03-21 12:47:53 +01:00
|
|
|
// Older versions of the driver expect the
|
|
|
|
// coordinate vector to have an extra component
|
2018-03-01 10:11:15 +01:00
|
|
|
this->addExtraDrefCoordComponent = true;
|
|
|
|
|
2018-03-21 12:47:53 +01:00
|
|
|
// From vkd3d: NMin/NMax/NClamp may crash the driver.
|
2018-01-07 20:05:27 +01:00
|
|
|
this->useSimpleMinMaxClamp = true;
|
|
|
|
}
|
|
|
|
|
2018-03-21 12:47:53 +01:00
|
|
|
// Enable certain features if they are supported by the device
|
|
|
|
this->useStorageImageReadWithoutFormat = devFeatures.shaderStorageImageReadWithoutFormat;
|
2018-01-07 20:05:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|