1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 07:29:17 +01:00

[dxso] Handle writemask in TexKill op

Turns out this actually applies to what is tested, despite docs saying otherwise and never ever seeing this before!

Fixes some broken ENB shaders which I assume have some manual hand edits because I can't get FXC to generate this code at all.
This commit is contained in:
Joshua Ashton 2020-01-29 17:22:38 +00:00
parent 3ab675c233
commit 201d508626

View File

@ -2860,6 +2860,11 @@ void DxsoCompiler::emitControlFlowGenericLoop(
texReg.id, texReg.id, texReg.id, texReg.id,
texReg.type.ccount, indices.data()); texReg.type.ccount, indices.data());
} }
else {
// The writemask actually applies and works here...
// (FXC doesn't generate this but it fixes broken ENB shaders)
texReg = emitRegisterSwizzle(texReg, IdentitySwizzle, ctx.dst.mask);
}
const uint32_t boolVecTypeId = const uint32_t boolVecTypeId =
getVectorTypeId({ DxsoScalarType::Bool, texReg.type.ccount }); getVectorTypeId({ DxsoScalarType::Bool, texReg.type.ccount });
@ -2868,6 +2873,7 @@ void DxsoCompiler::emitControlFlowGenericLoop(
boolVecTypeId, texReg.id, boolVecTypeId, texReg.id,
m_module.constfReplicant(0.0f, texReg.type.ccount)); m_module.constfReplicant(0.0f, texReg.type.ccount));
if (texReg.type.ccount != 1)
result = m_module.opAny(m_module.defBoolType(), result); result = m_module.opAny(m_module.defBoolType(), result);
if (m_ps.killState == 0) { if (m_ps.killState == 0) {