[dxbc] Remove workarounds for the old Nvidia shader compiler

This commit is contained in:
Philip Rebohle 2018-06-12 22:13:53 +02:00
parent 8d0af0a8fc
commit a607fe107f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 5 additions and 32 deletions

View File

@ -1410,16 +1410,14 @@ namespace dxvk {
case DxbcOpcode::Max:
case DxbcOpcode::DMax:
dst.id = m_options.test(DxbcOption::UseSimpleMinMaxClamp)
? m_module.opFMax(typeId, src.at(0).id, src.at(1).id)
: m_module.opNMax(typeId, src.at(0).id, src.at(1).id);
dst.id = m_module.opNMax(typeId,
src.at(0).id, src.at(1).id);
break;
case DxbcOpcode::Min:
case DxbcOpcode::DMin:
dst.id = m_options.test(DxbcOption::UseSimpleMinMaxClamp)
? m_module.opFMin(typeId, src.at(0).id, src.at(1).id)
: m_module.opNMin(typeId, src.at(0).id, src.at(1).id);
dst.id = m_module.opNMin(typeId,
src.at(0).id, src.at(1).id);
break;
case DxbcOpcode::Mul:
@ -3074,9 +3072,6 @@ namespace dxvk {
DxbcRegMask(true, false, false, false))
: DxbcRegisterValue();
if (isDepthCompare && m_options.test(DxbcOption::AddExtraDrefCoordComponent) && coord.type.ccount < 4)
coord = emitRegisterConcat(coord, referenceValue);
// Determine the sampled image type based on the opcode.
const uint32_t sampledImageType = isDepthCompare
? m_module.defSampledImageType(m_textures.at(textureId).depthTypeId)
@ -3186,9 +3181,6 @@ namespace dxvk {
? emitRegisterLoad(ins.src[3], DxbcRegMask(true, false, false, false))
: DxbcRegisterValue();
if (isDepthCompare && m_options.test(DxbcOption::AddExtraDrefCoordComponent) && coord.type.ccount < 4)
coord = emitRegisterConcat(coord, referenceValue);
// Load explicit gradients for sample operations that require them
const bool hasExplicitGradients = ins.op == DxbcOpcode::SampleD;
@ -4099,9 +4091,7 @@ namespace dxvk {
const DxbcRegisterValue vec0 = emitBuildConstVecf32(0.0f, 0.0f, 0.0f, 0.0f, mask);
const DxbcRegisterValue vec1 = emitBuildConstVecf32(1.0f, 1.0f, 1.0f, 1.0f, mask);
value.id = m_options.test(DxbcOption::UseSimpleMinMaxClamp)
? m_module.opFClamp(typeId, value.id, vec0.id, vec1.id)
: m_module.opNClamp(typeId, value.id, vec0.id, vec1.id);
value.id = m_module.opNClamp(typeId, value.id, vec0.id, vec1.id);
}
}

View File

@ -24,14 +24,6 @@ namespace dxvk {
const VkPhysicalDeviceProperties devProps = device->adapter()->deviceProperties();
const VkPhysicalDeviceFeatures devFeatures = device->features();
const DxvkGpuVendor vendor = static_cast<DxvkGpuVendor>(devProps.vendorID);
if (vendor == DxvkGpuVendor::Nvidia) {
flags.set(
DxbcOption::AddExtraDrefCoordComponent,
DxbcOption::UseSimpleMinMaxClamp);
}
if (devFeatures.shaderStorageImageReadWithoutFormat)
flags.set(DxbcOption::UseStorageImageReadWithoutFormat);

View File

@ -9,15 +9,6 @@ namespace dxvk {
/// Enabled by default on GPUs which support this.
UseStorageImageReadWithoutFormat,
/// Adds an extra component to the depth reference
/// vector for depth-compare operations. Workaround
/// for bugs in Nvidia drivers prior to 396.18.
AddExtraDrefCoordComponent,
/// Use FMin/FMax/FClamp instead of NMin/NMax/NClamp.
/// Workaround for bugs in older Nvidia drivers.
UseSimpleMinMaxClamp,
/// Defer kill operation to the end of the shader.
/// Fixes derivatives that are undefined due to
/// non-uniform control flow in fragment shaders.