mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-13 19:29:14 +01:00
[dxbc] Swap OpSelect arguments for Ne/Dne, don't use OpLogicalNot
Saves one instruction.
This commit is contained in:
parent
b756c229a9
commit
8211225ad4
@ -1871,7 +1871,14 @@ namespace dxvk {
|
||||
if (componentCount > 1)
|
||||
conditionType = m_module.defVectorType(conditionType, componentCount);
|
||||
|
||||
bool invert = false;
|
||||
|
||||
switch (ins.op) {
|
||||
case DxbcOpcode::Ne:
|
||||
case DxbcOpcode::DNe:
|
||||
invert = true;
|
||||
/* fall through */
|
||||
|
||||
case DxbcOpcode::Eq:
|
||||
case DxbcOpcode::DEq:
|
||||
condition = m_module.opFOrdEqual(
|
||||
@ -1890,13 +1897,6 @@ namespace dxvk {
|
||||
conditionType, src.at(0).id, src.at(1).id);
|
||||
break;
|
||||
|
||||
case DxbcOpcode::Ne:
|
||||
case DxbcOpcode::DNe:
|
||||
// Avoid poorly supported FUnordNotEqual
|
||||
condition = m_module.opLogicalNot(conditionType,
|
||||
m_module.opFOrdEqual(conditionType, src.at(0).id, src.at(1).id));
|
||||
break;
|
||||
|
||||
case DxbcOpcode::IEq:
|
||||
condition = m_module.opIEqual(
|
||||
conditionType, src.at(0).id, src.at(1).id);
|
||||
@ -1952,6 +1952,9 @@ namespace dxvk {
|
||||
sTrue = m_module.constComposite(typeId, componentCount, vTrue .data());
|
||||
}
|
||||
|
||||
if (invert)
|
||||
std::swap(sFalse, sTrue);
|
||||
|
||||
// Perform component-wise mask selection
|
||||
// based on the condition evaluated above.
|
||||
result.id = m_module.opSelect(
|
||||
|
Loading…
x
Reference in New Issue
Block a user