mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
Co-authored-by: Philip Rebohle <philip.rebohle@tu-dortmund.de> Co-authored-by: Robin Kertels <robin.kertels@gmail.com> Co-authored-by: pchome <pchome@users.noreply.github.com> Co-authored-by: Christopher Egert <cme3000@gmail.com> Co-authored-by: Derek Lesho <dereklesho52@Gmail.com> Co-authored-by: Luis Cáceres <lacaceres97@gmail.com> Co-authored-by: Nelson Chen <crazysim@gmail.com> Co-authored-by: Edmondo Tommasina <edmondo.tommasina@gmail.com> Co-authored-by: Riesi <riesi@opentrash.com> Co-authored-by: gbMichelle <gbmichelle.dev@gmail.com>
42 lines
1.6 KiB
C++
42 lines
1.6 KiB
C++
#include "dxso_options.h"
|
|
|
|
namespace dxvk {
|
|
|
|
DxsoOptions::DxsoOptions() {}
|
|
|
|
DxsoOptions::DxsoOptions(const Rc<DxvkDevice>& device, const D3D9Options& options) {
|
|
const Rc<DxvkAdapter> adapter = device->adapter();
|
|
|
|
const DxvkDeviceFeatures& devFeatures = device->features();
|
|
const DxvkDeviceInfo& devInfo = adapter->devicePropertiesExt();
|
|
|
|
useDemoteToHelperInvocation
|
|
= (devFeatures.extShaderDemoteToHelperInvocation.shaderDemoteToHelperInvocation);
|
|
|
|
useSubgroupOpsForEarlyDiscard
|
|
= (devInfo.coreSubgroup.subgroupSize >= 4)
|
|
&& (devInfo.coreSubgroup.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT)
|
|
&& (devInfo.coreSubgroup.supportedOperations & VK_SUBGROUP_FEATURE_BALLOT_BIT);
|
|
|
|
// Disable early discard on RADV (with LLVM) due to GPU hangs
|
|
// Disable early discard on Nvidia because it may hurt performance
|
|
bool isRadvAco = std::string(devInfo.core.properties.deviceName).find("RADV/ACO") != std::string::npos;
|
|
|
|
if ((adapter->matchesDriver(DxvkGpuVendor::Amd, VK_DRIVER_ID_MESA_RADV_KHR, 0, 0) && !isRadvAco)
|
|
|| (adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0)))
|
|
useSubgroupOpsForEarlyDiscard = false;
|
|
|
|
// Apply shader-related options
|
|
applyTristate(useSubgroupOpsForEarlyDiscard, device->config().useEarlyDiscard);
|
|
|
|
strictConstantCopies = options.strictConstantCopies;
|
|
|
|
strictPow = options.strictPow;
|
|
d3d9FloatEmulation = options.d3d9FloatEmulation;
|
|
|
|
shaderModel = options.shaderModel;
|
|
|
|
invariantPosition = options.invariantPosition;
|
|
}
|
|
|
|
} |