add special handling of locations smaller or equal to 0
do not translate location -1 (this location means the
uniform is not found)
location 0 does not need translation, it has no effect
Change-Id: Idbde51f08433ed70a5a1a2cf1ede51043f3cca76
Uniform locations are 32-bit values which the application queries
from the driver after a shader program is linked. It seems that Cordy
game (possibly all Unity based apps) store the returned location as
16-bit value. Intel driver returns location values in the upper 16-bit
range :(
This is a workaround for this issue, when a program is linked we check
the locations of all uniforms, if all locations are within the upper
16-bit range (as with Intel driver) we shift the location value before
returning to the application. Also override all functions which take
a location parameter and do the reverse shift before sending a location
value to the host.
Change-Id: I234aaafe3313774b5da79eb1dac713b89b10ad60
added state tracking for uniforms in program objects
for each active uniform in index i we will save its starting location
,size and type, so when calling glGetUniform on its location,
we can tell how many bytes we should read from the stream according to
the uniform's type
add some type and size definitions to functions
that calculate size from enum
some other fixes to the codec
Change-Id: I4ecdf41e752454a908d131e76bab113a616f2bc8
This is needed to support the rare, but still legal scenario,
when glDrawElemets is used with some index array data is stored in VBO's
while the actual attributes (vertices) data is in immediate mode.
When in immediate mode, we need to process the incodes, in order to know
which vertex data to send, which was impossible without the caching.
This commit introduces a new class GLSharedGroup, which will hold all data
that can be shared by shared contexts (buffers are such data).
This also makes the "Jet Cars Stunts" app work properly.
Change-Id: Ic937080dae461bc8cdf4d10cf37066a6e847f464