Closed fjtrujy closed 2 years ago
I have also added the STQ way, and performance for the previous example is even better, I suppose because I avoid some floating operations
INFO: 547.89 frames per second
Please @F0bes could you take a look?
When you set TEX0, you're setting TFX (The texture function) to MODULATE. Which may have unintended side effects.
The valid TFX values are defined here
I would either expose this in the GSTEXTURE structure, or force it to 1 (Decal). Decal simply keeps the input texture colour and outputs as is.
Also both functions are named Gouraud, which is the shading method defined by IIP in PRIM. This might be confusing if I were to want a flat shaded textured triangle. Of course, if you force DECAL, this has no meaning.
Don’t forget about -Wdeclaration-after-statement, since SDL has that enabled and would probably include gsInline.h
I have used a specific SDL example to test performance increase,
Before:
INFO: 469.61 frames per second
After: UV ->INFO: 520.80 frames per second
ST ->INFO: 547.89 frames per second