mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-18 04:54:15 +01:00
[dxbc] Implement option to split up fma
This commit is contained in:
parent
c613078ba8
commit
e7d14e97de
@ -499,6 +499,7 @@
|
||||
# Supported values:
|
||||
# - True/False
|
||||
|
||||
# d3d11.longMad = False
|
||||
# d3d9.longMad = False
|
||||
|
||||
# Device Local Constant Buffers
|
||||
|
@ -32,6 +32,7 @@ namespace dxvk {
|
||||
this->maxFrameLatency = config.getOption<int32_t>("dxgi.maxFrameLatency", 0);
|
||||
this->maxFrameRate = config.getOption<int32_t>("dxgi.maxFrameRate", 0);
|
||||
this->exposeDriverCommandLists = config.getOption<bool>("d3d11.exposeDriverCommandLists", true);
|
||||
this->longMad = config.getOption<bool>("d3d11.longMad", false);
|
||||
|
||||
// Clamp LOD bias so that people don't abuse this in unintended ways
|
||||
this->samplerLodBias = dxvk::fclamp(this->samplerLodBias, -2.0f, 1.0f);
|
||||
|
@ -120,6 +120,9 @@ namespace dxvk {
|
||||
|
||||
/// Shader dump path
|
||||
std::string shaderDumpPath;
|
||||
|
||||
/// Should we make our Mads a FFma or do it the long way with an FMul and an FAdd?
|
||||
bool longMad;
|
||||
};
|
||||
|
||||
}
|
@ -1623,8 +1623,13 @@ namespace dxvk {
|
||||
|
||||
case DxbcOpcode::Mad:
|
||||
case DxbcOpcode::DFma:
|
||||
dst.id = m_module.opFFma(typeId,
|
||||
src.at(0).id, src.at(1).id, src.at(2).id);
|
||||
if (likely(!m_moduleInfo.options.longMad)) {
|
||||
dst.id = m_module.opFFma(typeId,
|
||||
src.at(0).id, src.at(1).id, src.at(2).id);
|
||||
} else {
|
||||
dst.id = m_module.opFMul(typeId, src.at(0).id, src.at(1).id);
|
||||
dst.id = m_module.opFAdd(typeId, dst.id, src.at(2).id);
|
||||
}
|
||||
break;
|
||||
|
||||
case DxbcOpcode::Max:
|
||||
|
@ -38,6 +38,7 @@ namespace dxvk {
|
||||
disableMsaa = options.disableMsaa;
|
||||
forceSampleRateShading = options.forceSampleRateShading;
|
||||
enableSampleShadingInterlock = device->features().extFragmentShaderInterlock.fragmentShaderSampleInterlock;
|
||||
longMad = options.longMad;
|
||||
|
||||
// Figure out float control flags to match D3D11 rules
|
||||
if (options.floatControls) {
|
||||
|
@ -54,6 +54,9 @@ namespace dxvk {
|
||||
|
||||
/// Minimum storage buffer alignment
|
||||
VkDeviceSize minSsboAlignment = 0;
|
||||
|
||||
/// Should we make our Mads a FFma or do it the long way with an FMul and an FAdd?
|
||||
bool longMad;
|
||||
};
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user