mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 16:00:24 +01:00
r300/compiler: fake equal/notequal for shadow samplers
This is actually better than a real implementation, which would be useless due to inaccuracy (I know because I've tried to implement it).
This commit is contained in:
parent
35a6df5730
commit
e812c0439c
1 changed files with 7 additions and 0 deletions
|
|
@ -162,6 +162,13 @@ int radeonTransformTEX(
|
|||
inst_mad->U.I.SrcReg[tex].Index = tmp_texsample;
|
||||
inst_mad->U.I.SrcReg[tex].Swizzle = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_swizzle;
|
||||
|
||||
/* Fake EQUAL/NOTEQUAL, it seems to pass some tests suprisingly. */
|
||||
if (comparefunc == RC_COMPARE_FUNC_EQUAL) {
|
||||
comparefunc = RC_COMPARE_FUNC_GEQUAL;
|
||||
} else if (comparefunc == RC_COMPARE_FUNC_NOTEQUAL) {
|
||||
comparefunc = RC_COMPARE_FUNC_LESS;
|
||||
}
|
||||
|
||||
/* Recall that SrcReg[0] is r, SrcReg[tex] is tex and:
|
||||
* LESS: r < tex <=> -tex+r < 0
|
||||
* GEQUAL: r >= tex <=> not (-tex+r < 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue