2018-04-22 23:49:41 +02:00
|
|
|
#include <unordered_map>
|
|
|
|
|
2018-01-07 20:05:27 +01:00
|
|
|
#include "dxbc_options.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2018-04-22 23:49:41 +02:00
|
|
|
const static std::unordered_map<std::string, DxbcOptions> g_dxbcAppOptions = {{
|
2018-04-23 00:46:27 +02:00
|
|
|
{ "ManiaPlanet.exe", DxbcOption::ForceTex2DArray },
|
2018-04-22 23:49:41 +02:00
|
|
|
}};
|
|
|
|
|
|
|
|
|
|
|
|
DxbcOptions getDxbcAppOptions(const std::string& appName) {
|
|
|
|
auto appOptions = g_dxbcAppOptions.find(appName);
|
|
|
|
|
|
|
|
return appOptions != g_dxbcAppOptions.end()
|
|
|
|
? appOptions->second
|
|
|
|
: DxbcOptions();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DxbcOptions getDxbcDeviceOptions(const Rc<DxvkDevice>& device) {
|
|
|
|
DxbcOptions flags;
|
|
|
|
|
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
|
|
|
const DxvkGpuVendor vendor = static_cast<DxvkGpuVendor>(devProps.vendorID);
|
2018-01-07 20:05:27 +01:00
|
|
|
|
2018-04-11 19:44:45 +02:00
|
|
|
if (vendor == DxvkGpuVendor::Nvidia) {
|
2018-04-22 23:49:41 +02:00
|
|
|
flags.set(
|
|
|
|
DxbcOption::AddExtraDrefCoordComponent,
|
|
|
|
DxbcOption::UseSimpleMinMaxClamp);
|
2018-01-07 20:05:27 +01:00
|
|
|
}
|
|
|
|
|
2018-04-22 23:49:41 +02:00
|
|
|
if (devFeatures.shaderStorageImageReadWithoutFormat)
|
|
|
|
flags.set(DxbcOption::UseStorageImageReadWithoutFormat);
|
|
|
|
|
|
|
|
return flags;
|
2018-01-07 20:05:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|