mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 04:41:42 +00:00
PixelShaderGen: Use bitwise AND for wrapping indirect texture coordinates
(x % y) is not defined in GLSL when sign(x) != sign(y). This also has the added benefit of behaving the same as sampler wrapping modes, in regards to negative inputs.
This commit is contained in:
parent
87464d432b
commit
edebadc093
2 changed files with 7 additions and 7 deletions
|
@ -374,15 +374,15 @@ static inline s32 WrapIndirectCoord(s32 coord, int wrapMode)
|
|||
case ITW_OFF:
|
||||
return coord;
|
||||
case ITW_256:
|
||||
return (coord % (256 << 7));
|
||||
return (coord & ((256 << 7) - 1));
|
||||
case ITW_128:
|
||||
return (coord % (128 << 7));
|
||||
return (coord & ((128 << 7) - 1));
|
||||
case ITW_64:
|
||||
return (coord % (64 << 7));
|
||||
return (coord & ((64 << 7) - 1));
|
||||
case ITW_32:
|
||||
return (coord % (32 << 7));
|
||||
return (coord & ((32 << 7) - 1));
|
||||
case ITW_16:
|
||||
return (coord % (16 << 7));
|
||||
return (coord & ((16 << 7) - 1));
|
||||
case ITW_0:
|
||||
return 0;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue