2018-11-23 15:11:46 +00:00
|
|
|
#include "../d3d11/d3d11_options.h"
|
2018-04-22 22:49:41 +01:00
|
|
|
|
2018-01-07 19:05:27 +00:00
|
|
|
#include "dxbc_options.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
2018-11-09 07:41:02 +00:00
|
|
|
DxbcOptions::DxbcOptions() {
|
|
|
|
|
2018-04-22 22:49:41 +01:00
|
|
|
}
|
2018-11-09 07:41:02 +00:00
|
|
|
|
|
|
|
|
2018-11-23 15:11:46 +00:00
|
|
|
DxbcOptions::DxbcOptions(const Rc<DxvkDevice>& device, const D3D11Options& options) {
|
2018-12-12 15:27:01 +00:00
|
|
|
const Rc<DxvkAdapter> adapter = device->adapter();
|
|
|
|
|
2018-07-31 15:58:25 +01:00
|
|
|
const DxvkDeviceFeatures& devFeatures = device->features();
|
2018-12-12 15:27:01 +00:00
|
|
|
const DxvkDeviceInfo& devInfo = adapter->devicePropertiesExt();
|
2018-11-07 10:57:36 +00:00
|
|
|
|
2019-02-19 13:27:21 +00:00
|
|
|
useDepthClipWorkaround
|
|
|
|
= !devFeatures.extDepthClipEnable.depthClipEnable;
|
2018-11-07 10:57:36 +00:00
|
|
|
useStorageImageReadWithoutFormat
|
|
|
|
= devFeatures.core.features.shaderStorageImageReadWithoutFormat;
|
|
|
|
useSubgroupOpsForEarlyDiscard
|
|
|
|
= (devInfo.coreSubgroup.subgroupSize >= 4)
|
|
|
|
&& (devInfo.coreSubgroup.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT)
|
2018-11-26 14:09:41 +00:00
|
|
|
&& (devInfo.coreSubgroup.supportedOperations & VK_SUBGROUP_FEATURE_BALLOT_BIT);
|
2018-12-13 11:17:09 +00:00
|
|
|
useRawSsbo
|
|
|
|
= (devInfo.core.properties.limits.minStorageBufferOffsetAlignment <= sizeof(uint32_t));
|
2019-03-09 18:59:56 +00:00
|
|
|
useSdivForBufferIndex
|
|
|
|
= adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0);
|
2018-11-23 11:28:48 +00:00
|
|
|
|
2019-04-05 19:24:08 +01:00
|
|
|
strictDivision = options.strictDivision;
|
|
|
|
constantBufferRangeCheck = options.constantBufferRangeCheck;
|
|
|
|
zeroInitWorkgroupMemory = options.zeroInitWorkgroupMemory;
|
2018-11-23 15:11:46 +00:00
|
|
|
|
2019-01-08 19:58:18 +00:00
|
|
|
// Disable early discard on RADV due to GPU hangs
|
2018-11-23 11:28:48 +00:00
|
|
|
// Disable early discard on Nvidia because it may hurt performance
|
2018-12-12 15:27:01 +00:00
|
|
|
if (adapter->matchesDriver(DxvkGpuVendor::Amd, VK_DRIVER_ID_MESA_RADV_KHR, 0, 0)
|
|
|
|
|| adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0))
|
2018-11-23 11:28:48 +00:00
|
|
|
useSubgroupOpsForEarlyDiscard = false;
|
2019-01-08 19:58:18 +00:00
|
|
|
|
|
|
|
// Apply shader-related options
|
|
|
|
applyTristate(useSubgroupOpsForEarlyDiscard, device->config().useEarlyDiscard);
|
|
|
|
applyTristate(useRawSsbo, device->config().useRawSsbo);
|
2018-01-07 19:05:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|