sdl2_frt/src/render/opengles2
Andreas M?ller 87bc1fb552 GLES2: Get sin/cos out of vertex shader
The only place angle is activated and causes effect is RenderCopyEx. All other
methods which use vertex shader, leave angle disabled and cause useless sin/cos
calculation in shader.

To get around shader's interface is changed to a vector that contains results
of sin and cos. To behave properly when disabled, cos value is set with offset
-1.0 making 0.0 default when deactivated.

As nice side effect it simplifies GLES2_UpdateVertexBuffer: All attributes are
vectors now.

Additional background:

* On RaspberryPi it gives a performace win for operations. Tested with
  [1] numbers go down for 5-10% (not easy to estimate due to huge variation).
* SDL_RenderCopyEx was tested with [2]
* It works around left rotated display caused by low accuracy sin implemetation
  in RaspberryPi/VC4 [3]

[1] https://github.com/schnitzeltony/sdl2box
[2] https://github.com/schnitzeltony/sdl2rendercopyex
[3] https://github.com/anholt/mesa/issues/110

Signed-off-by: Andreas M?ller <schnitzeltony@gmail.com>
2018-08-28 12:57:51 -07:00
..
SDL_gles2funcs.h Backed out changeset 6c8521d53507 2018-02-21 22:53:52 -05:00
SDL_render_gles2.c GLES2: Get sin/cos out of vertex shader 2018-08-28 12:57:51 -07:00
SDL_shaders_gles2.c GLES2: Get sin/cos out of vertex shader 2018-08-28 12:57:51 -07:00
SDL_shaders_gles2.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00