mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[d3d9] Implement d3d9.longMad option
This commit is contained in:
parent
93b4427a13
commit
c3cff09c4f
11
dxvk.conf
11
dxvk.conf
@ -304,3 +304,14 @@
|
||||
|
||||
# d3d9.forceSwapchainMSAA = -1
|
||||
|
||||
|
||||
# Long Mad
|
||||
#
|
||||
# Should we make our Mads a FFma or do it the long way with an FMul and an FAdd?
|
||||
# This solves some rendering bugs in games that have z-pass shaders which
|
||||
# don't match entirely to the regular vertex shader in this way.
|
||||
#
|
||||
# Supported values:
|
||||
# - True/False
|
||||
|
||||
# d3d9.longMad = False
|
@ -69,6 +69,7 @@ namespace dxvk {
|
||||
this->allowDoNotWait = config.getOption<bool> ("d3d9.allowDoNotWait", true);
|
||||
this->allowDiscard = config.getOption<bool> ("d3d9.allowDiscard", true);
|
||||
this->enumerateByDisplays = config.getOption<bool> ("d3d9.enumerateByDisplays", true);
|
||||
this->longMad = config.getOption<bool> ("d3d9.longMad", false);
|
||||
|
||||
// If we are not Nvidia, enable general hazards.
|
||||
this->generalHazards = adapter == nullptr || !adapter->matchesDriver(DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0);
|
||||
|
@ -138,6 +138,11 @@ namespace dxvk {
|
||||
|
||||
/// Enumerate adapters by displays
|
||||
bool enumerateByDisplays;
|
||||
|
||||
/// Should we make our Mads a FFma or do it the long way with an FMul and an FAdd?
|
||||
/// This solves some rendering bugs in games that have z-pass shaders which
|
||||
/// don't match entirely to the regular vertex shader in this way.
|
||||
bool longMad;
|
||||
};
|
||||
|
||||
}
|
@ -1774,10 +1774,21 @@ namespace dxvk {
|
||||
emitRegisterLoad(src[1], mask).id);
|
||||
break;
|
||||
case DxsoOpcode::Mad:
|
||||
result.id = m_module.opFFma(typeId,
|
||||
emitRegisterLoad(src[0], mask).id,
|
||||
emitRegisterLoad(src[1], mask).id,
|
||||
emitRegisterLoad(src[2], mask).id);
|
||||
if (!m_moduleInfo.options.longMad) {
|
||||
result.id = m_module.opFFma(typeId,
|
||||
emitRegisterLoad(src[0], mask).id,
|
||||
emitRegisterLoad(src[1], mask).id,
|
||||
emitRegisterLoad(src[2], mask).id);
|
||||
}
|
||||
else {
|
||||
result.id = m_module.opFMul(typeId,
|
||||
emitRegisterLoad(src[0], mask).id,
|
||||
emitRegisterLoad(src[1], mask).id);
|
||||
|
||||
result.id = m_module.opFAdd(typeId,
|
||||
result.id,
|
||||
emitRegisterLoad(src[2], mask).id);
|
||||
}
|
||||
break;
|
||||
case DxsoOpcode::Mul:
|
||||
result.id = m_module.opFMul(typeId,
|
||||
|
@ -45,6 +45,8 @@ namespace dxvk {
|
||||
forceSamplerTypeSpecConstants = options.forceSamplerTypeSpecConstants;
|
||||
|
||||
vertexConstantBufferAsSSBO = pDevice->GetVertexConstantLayout().totalSize() > devInfo.core.properties.limits.maxUniformBufferRange;
|
||||
|
||||
longMad = options.longMad;
|
||||
}
|
||||
|
||||
}
|
@ -45,6 +45,11 @@ namespace dxvk {
|
||||
|
||||
/// Should the VS constant buffer be an SSBO (swvp on NV)
|
||||
bool vertexConstantBufferAsSSBO;
|
||||
|
||||
/// Should we make our Mads a FFma or do it the long way with an FMul and an FAdd?
|
||||
/// This solves some rendering bugs in games that have z-pass shaders which
|
||||
/// don't match entirely to the regular vertex shader in this way.
|
||||
bool longMad;
|
||||
};
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user