mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-14 22:29:15 +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)
|
if (componentCount > 1)
|
||||||
conditionType = m_module.defVectorType(conditionType, componentCount);
|
conditionType = m_module.defVectorType(conditionType, componentCount);
|
||||||
|
|
||||||
|
bool invert = false;
|
||||||
|
|
||||||
switch (ins.op) {
|
switch (ins.op) {
|
||||||
|
case DxbcOpcode::Ne:
|
||||||
|
case DxbcOpcode::DNe:
|
||||||
|
invert = true;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case DxbcOpcode::Eq:
|
case DxbcOpcode::Eq:
|
||||||
case DxbcOpcode::DEq:
|
case DxbcOpcode::DEq:
|
||||||
condition = m_module.opFOrdEqual(
|
condition = m_module.opFOrdEqual(
|
||||||
@ -1890,13 +1897,6 @@ namespace dxvk {
|
|||||||
conditionType, src.at(0).id, src.at(1).id);
|
conditionType, src.at(0).id, src.at(1).id);
|
||||||
break;
|
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:
|
case DxbcOpcode::IEq:
|
||||||
condition = m_module.opIEqual(
|
condition = m_module.opIEqual(
|
||||||
conditionType, src.at(0).id, src.at(1).id);
|
conditionType, src.at(0).id, src.at(1).id);
|
||||||
@ -1952,6 +1952,9 @@ namespace dxvk {
|
|||||||
sTrue = m_module.constComposite(typeId, componentCount, vTrue .data());
|
sTrue = m_module.constComposite(typeId, componentCount, vTrue .data());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (invert)
|
||||||
|
std::swap(sFalse, sTrue);
|
||||||
|
|
||||||
// Perform component-wise mask selection
|
// Perform component-wise mask selection
|
||||||
// based on the condition evaluated above.
|
// based on the condition evaluated above.
|
||||||
result.id = m_module.opSelect(
|
result.id = m_module.opSelect(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user