(07-16-2015, 12:51 AM)Ōkami Amaterasu Wrote: I thought both opengl and directx 10 could do integer math. The dolphin team said it was one of the main reasons they dropped dx9.
Quoting myself
Quote:Except upscaling which is a hack anyway. The only real issue is speed, otherwise lots of things can be fixed. You can do a kind of SW renderer in the shader directly
I never said it was not possible. I don't know if Dolphin uses integer for color or only the coordinate (or both). Anyway I try to replace float color computation with integer computation => speed hit 10% on SotC (4x/6x). To be fair, float uses native (therefore bad) rounding.
A basic shader are only 4/5 instructions.
Float shader
1/ no texture color conversion
2/ Clamp(x, 0.0f, 1.0f) is 0 instructions in HW (yes 0!)
3/ you can directly output the color
Vs integer shader
1/ float to int conversion (1/2 instructions)
2/ clamp(x, 0, 255) is 2 instructions.
3/ you need to convert back the integer to float (1/2 instructions)
In short a float shader is 4/5 instructions, the equivalent is 8/9 instructions. It seems small but you need to multiply those extra instructions by the number of time the shader are executed (hundred of millions of times by seconds).
Edit: Oh, forget to say, using integer (at least correct rounding) help to fix suikoden bug.