diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-04-15 23:15:41 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-04-15 23:17:35 +0200 |
commit | 85cbff5b60c79731a583104a0c2b32ee149b8c8c (patch) | |
tree | b942b73c281023f3cdf41dd0a96eefc76dd6e82f /src/gallium/drivers/r300 | |
parent | a28ee4aa02429a1ece1172ec7765bc1621f13851 (diff) |
r300g: mask out the mirrored bit correctly in the registers
It was previously done wrong + now it shouldn't render garbage,
so that the NPOT fallback can get in.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index a36cff98c3..46c192eae1 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -514,22 +514,22 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300) * This prevents incorrect rendering. */ texstate->filter0 &= ~R300_TX_MIN_FILTER_MIP_MASK; - /* Set repeat or mirrored-repeat to clamp-to-edge. */ - /* Wrap S. */ + /* Mask out the mirrored flag. */ + if (texstate->filter0 & R300_TX_WRAP_S(R300_TX_MIRRORED)) { + texstate->filter0 &= ~R300_TX_WRAP_S(R300_TX_MIRRORED); + } + if (texstate->filter0 & R300_TX_WRAP_T(R300_TX_MIRRORED)) { + texstate->filter0 &= ~R300_TX_WRAP_T(R300_TX_MIRRORED); + } + + /* Change repeat to clamp-to-edge. + * (the repeat bit has a value of 0, no masking needed). */ if ((texstate->filter0 & R300_TX_WRAP_S_MASK) == - R300_TX_WRAP_S(R300_TX_REPEAT) || - (texstate->filter0 & R300_TX_WRAP_S_MASK) == - R300_TX_WRAP_S(R300_TX_MIRRORED)) { - texstate->filter0 &= ~R300_TX_WRAP_S_MASK; + R300_TX_WRAP_S(R300_TX_REPEAT)) { texstate->filter0 |= R300_TX_WRAP_S(R300_TX_CLAMP_TO_EDGE); } - - /* Wrap T. */ if ((texstate->filter0 & R300_TX_WRAP_T_MASK) == - R300_TX_WRAP_T(R300_TX_REPEAT) || - (texstate->filter0 & R300_TX_WRAP_T_MASK) == - R300_TX_WRAP_T(R300_TX_MIRRORED)) { - texstate->filter0 &= ~R300_TX_WRAP_T_MASK; + R300_TX_WRAP_T(R300_TX_REPEAT)) { texstate->filter0 |= R300_TX_WRAP_T(R300_TX_CLAMP_TO_EDGE); } } else { |