This is done by:
* Not considering the texture pointer when looking up a generated shader, only type
* Not requiring different shaders based on RescaleNormalAttrib
* Not looking at AlphaTestAttrib unless it is going to be relevant
This should dramatically reduce the number of shaders that are being generated for many scenes, especially since the only thing that differs from object to object is often just the texture.
These changes are also necessary to make b781995ef1 more usable, since prepare_scene may see a slightly different state than is encountered at render time due to code in CullResult adding in an AlphaTestAttrib or RescaleNormalAttrib.
The new implementation stores elements contiguously and keeps a separate sparse array of indices, similar to the new PyPy and CPython implementations. This vastly improves performance when iterating over the individual elements, such as when garbage collecting states, and decreases memory usage.
* Fix random number generator on Windows (LP 1663895)
* Assert instead of crash when passing in non-Camera to begin() (LP 1663900)
* Prevent repeated calls to generator()/set_budget() from leaking GeomNodes (LP 1663903)
* Make the generator more efficient
This is a squashed commit of the following, as well as my own (rdb's) revisions:
commit 80662759a18607743316f75ee6aa4a63c3f8d8e6
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Thu Dec 1 15:07:29 2016 +0100
Removed some useless fixed pipeline checks
commit 563b5dbe93b451006ddbf3797aabdda7482ef3de
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Thu Dec 1 14:19:21 2016 +0100
Improved the LUMINANCE check system
commit 596036a8bb59d627f703bccfdc399dc31e1723a9
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Thu Dec 1 13:30:45 2016 +0100
Removed some useless fixed pipeline checks
commit 0f7fa7cd33860c3cde1b4594731271170301b42d
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Thu Dec 1 13:26:07 2016 +0100
Don't try to check if fixed pipeline is available before the context has been generated
commit 56ed18e29dcb0a7cb0feccd0d50038416637427f
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Thu Dec 1 13:14:49 2016 +0100
Assuming the fixed pipeline is available in GL 3.1 contexts
commit 73075ead73be21c8ce9a468ed92eb2c8c7d548c4
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Fri Nov 4 12:59:45 2016 +0100
Fixed errors while quering for GL_TEXTURE_LUMINANCE_SIZE and GL_TEXTURE_INTENSITY_SIZE in GL >= 4.0 core profile contexts
commit 3f799ed20be22f6f82de13445c5f9515a424ef9f
Author: Jose Luis Cercos Pita <jlcercos@gmail.com>
Date: Fri Dec 16 10:01:03 2016 +0100
Added fixed functions pipeline support check at runtime
Closes: 128