1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +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.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 =
getVectorTypeId({ DxsoScalarType::Bool, texReg.type.ccount });
@ -2868,7 +2873,8 @@ void DxsoCompiler::emitControlFlowGenericLoop(
boolVecTypeId, texReg.id,
m_module.constfReplicant(0.0f, texReg.type.ccount));
result = m_module.opAny(m_module.defBoolType(), result);
if (texReg.type.ccount != 1)
result = m_module.opAny(m_module.defBoolType(), result);
if (m_ps.killState == 0) {
uint32_t labelIf = m_module.allocateId();