SDL OpenGL ES2 autobatching patch


#22

I’d have to experiment; my thinking is that it reduces bandwidth to only send the color as a uniform if it changes, instead of having to send it 4+ times for each primitive, but maybe in practice changing uniforms causes more stalls than just sending a larger vertex buffer once.

Some of the render backends (Direct3D 9 and 11) already do this as per-vertex data, though, since they have more-strict requirements on vertex format, but I don’t know which is better in terms of performance.

–ryan.


#23

Ryan, consider it somewhat tested with no obvious problems so far. Good job!

What needs to be added is anisotropic filtering scale quality. Currently only “nearest” and “linear” have an effect and inistotropic reverts to linear. I assume that’s what’s needed for textured quads to be antialiased so that they fall between pixels? I only looked at the Direct3D renderer. I guess the equivalent applies to the OpenGL renderers.

While there, you could swap the scale x & y and rotation calculations in the CopyEx methods pretty please. Currently it applies the global scale before rotating, which I believe is undesired in all cases. Needs to rotate the quad, then scale.

Thanks,

-Anthony


#24

I could observe this too for the Direct3D renderer. Software, GL and GLES work just fine for me.
I am on win10 x64; sdl2 is built with visual studio from the latest upstream (12421 (144400e4630d))

Increasing the size of the window does not increase the size of the renderer/viewport (even if i set viewport manually after the resize event); Decreasing the size of the window decreases the renderer viewport too, but it will stay at that smaller size no mater how big i resize the window afterwards. The window itself resizes, the rest just stays black.

~mkalte


#25

I think someone opened this in Bugzilla; I’ll try to look at it this week.


#26

Someone’s already posted a suggested patch for this on Bugzilla. Give it a try Ryan:

https://bugzilla.libsdl.org/show_bug.cgi?id=4358

I just had a quick test of the software renderer and noticed TextureBlendMode, TextureColorMod, and probably TextureAlphaMod are being ignored in HG2.0.


#27

Hi
So how about moving color and alpha from uniform to the vertex attributes for opengles2?