Commit Graph

14 Commits

Author SHA1 Message Date
Stas Gurtovoy
0111043202 opengles emulator: fix the mixing between pack/unpack alignments
The was a bug in the calculation of the pixels data size, caused by wrong usage
of pack/unpack alignment.
Pack should be used for glReadPixels, while unpack should be used for glTexImage and such.
Also fixes crash in "Angry Birds" & "Angry Birds Rio"

Change-Id: I099308a57a1ea907d38c59bad056429bc107de98
2011-08-09 17:14:20 +02:00
Stas Gurtovoy
e99305dd9f opengles emulator: cache all buffer on the guest
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
2011-08-09 17:14:20 +02:00
Stas Gurtovoy
d9d1006222 opengles emulator: support for null in data parameter of glCompressedTexImage2D
Thought the spec doesn't speak about null in data parameter,
it is checked in covgl - so we'll base it on glTexImage2D and allow
null in data.

Change-Id: I9bf5131852bf795acc7ab89bd17b9df90ac99460
2011-07-13 11:26:37 +03:00
Stas Gurtovoy
d6f18cdf80 opengl emulator: Added gl error tracking on the guest (encoder)
Sometimes we need to check parameter values before encoding
to prevent crashes, for example:
glDeleteBufferes(-1, ptr); - would crash
For that we need to check some gl errors on the guest.

The change adds error state to the encoder and also
adds new feature to emugen which allows to insert
parameter check code into the attribute file.
Added such parameter check code in the appropiate
gl functions in gl.attrib and gl2.attrib

Change-Id: I7f317df52ac8fbd96979100a1031cf023a0b49d3
2011-07-07 16:35:16 +03:00
Stas Gurtovoy
304a1c21ca opengles Translator: Omit precision macros from shaders
The shaders fail to compile if we don't omit those changes (Cordy game for example).
Anyways, they have no semantic meaning in GLSL, quote for GLSL 4.1 spec:
"Precision qualifiers are added for code portability with OpenGL ES, not for functionality. They have the
same syntax as in OpenGL ES, as described below, but they have no semantic meaning, which includes no
effect on the precision used to store or operate on variables."
Also removed an anoying print in the encoder.
2011-07-03 15:35:11 +03:00
Stas Gurtovoy
118af85051 emulator GLESv2: fixed (#16) NenaMark crashes on exit
The GL2Encoder::m_compressedTextureFormats  member wasn't initialized, so the d'tor
would sometimes crash trying to delete it. Also init m_num_compressedTextureFormats.

Change-Id: Iae423c16a84a4e454e0e1167f7478f9e2f6183c0
2011-06-30 09:14:16 +03:00
Stas Gurtovoy
62d074d9f8 emulator opengl: add GLESv2 support to driver + renderer
Added GLESv2 library to system.
Made fixes to the host libOpenGLRender to
compile and support GLESv2 (defined WITH_GLES2).
Other fixes required to make GLESv2 to work.

Change-Id: I9eb198e6092e7fa3550342c50929dd1714282cb3
2011-06-30 09:14:12 +03:00
David 'Digit' Turner
8422a11a21 emulator: opengl: Update/simplify build scripts
This patch is a major rework of the build opengl-emulation
build scripts. See README for details.

In a nutshell, this introduces various functions that considerably
simplify the declaration of the 26+ modules in this implementation,
by handling auto-generation of sources and module imports/exports.

Change-Id: I827522d783c7b6cf5eafd37204a1025c235458cd
2011-06-23 00:35:54 +02:00
Stas Gurtovoy
a26f6f221b emulator opengl: Added glFinishRoundTrip to GLESv2
Change-Id: Ia1c6cb7e75a1769040d13e81d0da7db5f5c28435
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
d32c2d9633 emulator opengl: system GLESv1 first commit.
This is the first commit for the GLESv1 implementation.
It also includes needed fixes in emugen to support const types.
Also, changed glFinish definition in gl.in to match the
definition as in gl.h.

Change-Id: I90262a1db6035a90af8db17984acecef6499847a
2011-06-17 17:18:45 +03:00
Jacky Romano
59ad4dfd2b emulator opengl: handle NULL pointers
glTexImage[2,3]D and glBufferData properly handle NULL pointer
parameter

Change-Id: If799d41966b700b8fae3e7a68cac5b3a488b0146
2011-05-03 16:04:34 +02:00
Jacky Romano
0c814b227c emulator opengl - encode glShaderSource
glShaderSource strings are concatenated into a single string
before sent over the wire protocol. The wire protocol transfer is
done using a special api call 'glShaderString'

Change-Id: I90c157df66fe82fee17c460a1e7852d370c77088
2011-05-03 15:25:25 +02:00
Jacky Romano
68e7ee63f5 opengl emulator - handle shader string decoding
Shader strings are sent over the wire protocal as one concatenated
string. a special api call - glShaderString is used to handle the
encoding and decoding of this string.

Change-Id: Id682763f35e9fcc6215559931db2112a4fa981a9
2011-05-03 15:15:25 +02:00
Jacky Romano
318ffd3798 Emulator Opengl - adding preliminary version of GLESv2 encoder
This preliminary version includes the API definition, and the
GL2Encoder implementation class

Change-Id: I7ef9cfeb98c1e85097287ab26733825087368ee0
2011-05-03 14:54:03 +02:00