Commit Graph

345 Commits

Author SHA1 Message Date
Liran
3c15de2f2e opengl translator: conformance fixes
fix shader and program names in glDeleteShader/Program
fix object name manager to accept objects with name 0
fix unbinding of buffers,framebuffers and renderbuffers
separate getPointer to have specific implementation for gles 1 and 2
fix number of supported texture images to match GL
fix incorrect optimization that skips draw on false conditions
2011-07-03 14:32:43 +03:00
Amit Feller
61d845731a validateing client's arrays type 2011-07-03 14:32:43 +03:00
Amit Feller
2ca84fb34a opengl translator: supporting GL_BYTE type
support GL_BYTE in glvertexpointer & glTexCoordPointer,
Desktop OpenGL does not support GL_BYTE in those calls
so we convert the data into GL_SHORT.
2011-07-03 14:32:43 +03:00
Stas Gurtovoy
33e95e85fd emulotor gralloc: fixed HAL_PIXEL_FORMAT_RGB_565
set its glFormat to GL_RGB since GL_RGB565_OES is not supported on the host.
This also fixes the wallpaper issue, making it visible.

Change-Id: Icf616e70d8f41ca0d01e7cdeb9585107dc8ebc31
2011-07-01 12:06:07 +02:00
Stas Gurtovoy
8793e54e60 emulator gralloc: Make the cb_handle_t::validate static
This is nicer, since it checks the handle itself, not counting on the caller to check it

Change-Id: I7eba6292dee8e0832a8c0074f508c07c3bc43ff2
2011-06-30 09:14:16 +03:00
Amit Feller
87363ca283 opengl translator: Fix windows runtime problems
fixed functions calling conventions in dispatch tables,
added link flag to translator libraries to produce an alias
function for all exported functions with stdcall name mangling.

Change-Id: I4360f26da1f897764ba6d4dd02c365ed00420b51
2011-06-30 09:14:16 +03:00
Amit Feller
a20ba0e4de Setting Renderer default libs to use translator libs
Change-Id: I853a30ce1aa7325d01a30b30c18f4e0bd5a5702f
2011-06-30 09:14:16 +03:00
Amit Feller
efcbbc3f28 emulator opengl: fix windows build
Change-Id: I145c7bf3a664fdb2c9e113cd977b4b2431d0668d
2011-06-30 09:14:16 +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 Turner
bcb0c197a1 Merge "emulator opengl: fixed wrong delete" 2011-06-28 04:45:32 -07:00
David Turner
5b060ef926 Merge changes I1c2d8bc4,I64a63c2e,Ia209f88a,I9e797024,Ic09a5d0e
* changes:
  emulator opengl: guest/host rendering syncronization.
  emulator opengl: initialize new colorbuffers
  emulator opengles: Fixed bug in gralloc unregister_buffer
  emulator opengles: Fixed a bug in eglChooseConfig implementation.
  opengles emulator: Fixed upside-down gl image
2011-06-28 04:44:48 -07:00
Yochai Shefi Simchon
e02b38778a Fix an iligal "free".
m_map[GL_TEXTURE_COORD_ARRAY] is not an allocated pointer, therefore it shouldn't be freed.

Change-Id: I84e2937c16ddcbb8922cdf270de86732ee966d60
2011-06-25 17:02:33 +03:00
Yochai Shefi Simchon
33cd758244 tex 0 is legal.
Change-Id: I99f59aa0aff1986e86e0954bb61924895b9b044f
2011-06-25 17:02:33 +03:00
Yochai Shefi Simchon
72233c6be3 Support GL_(NUM_)COMPRESSED_TEXTURE_FORMATS get.
Change-Id: I6adb541649ec83f50f520e27a26814a47359b827
2011-06-25 17:02:33 +03:00
Guy Zadikario
a0b0d08e17 emulator opengl: fixed wrong delete
Solves a crash in Replica Island.

Change-Id: Id085cc2c88d0e3bdbf59f43882b7397b15ded05c
2011-06-25 16:56:08 +03:00
Guy Zadikario
0536060b40 emulator opengl: guest/host rendering syncronization.
Added a return value for rcFlushWindowColorBuffer and
rcUpdateColorBuffer in order to make those calls to block
with a round-trip to the host. This is to make sure that
the color buffer is up-to-date before the flinger use it
for rendering.
Also added a call to the native windows's lock function after
EGL is attached and bound to render on the window. This call
was missed before.

This syncronization can be optimized by removing the round-trip
and insert sync primitive to the stream at every draw command that
reads from a color buffer to make the sync happen on the host
before rendering the color buffer and remove the need for the
guest to wait for that update.

Change-Id: I1c2d8bc407b69663e992a68d5aa755f19bbe0ec3
2011-06-25 16:56:08 +03:00
Guy Zadikario
4ef1f3474e emulator opengl: initialize new colorbuffers
Initialize new allocated color buffers with zeros.

Change-Id: I64a63c2eda83fdec1926c387e171324fb07ebe83
2011-06-25 16:56:08 +03:00
Stas Gurtovoy
88ad268dd9 emulator opengles: Fixed bug in gralloc unregister_buffer
Reset the ashmemBase & mappedPid on unregister_buffer

Change-Id: Ia209f88a15eb51edb39b1a799500d835b944bc87
2011-06-25 16:30:30 +03:00
Stas Gurtovoy
128f401e4f emulator opengles: Fixed a bug in eglChooseConfig implementation.
The config_size argument in rcChooseConfig should match the number
of requested configs and not the size in bytes to store it.
Moved the configs array size computation into rendeerControl.attrib.

Change-Id: I9e797024522965a656764c20252b25ff5ae657f5
2011-06-25 16:30:30 +03:00
Stas Gurtovoy
fdcba322fe opengles emulator: Fixed upside-down gl image
This fix performs a flip software copy to match our coords with those expected by the flinger.
We may think of a better implementation in the future.

Change-Id: Ic09a5d0e22f7e209b33c07c993a3d56e328dd3ed
2011-06-25 16:28:58 +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
David Turner
bd414ea2ff Merge "opengl translator: fix eglGetConfigAttrib" 2011-06-21 23:23:26 -07:00
David Turner
8e706026d1 Merge "opengl translator: conformance fixes" 2011-06-21 23:23:07 -07:00
Guy Zadikario
22a288abf8 emulator gralloc: removed compilation warnings.
just removes anoying compliation warnings in the HMI
initialization.

Change-Id: I23377a7cae774cf436f89e25edb78c10ff5b5c78
2011-06-21 20:47:43 +02:00
Guy Zadikario
7d39ef3772 emulator opengl: Fix gralloc color buffer uploads
Use the correct OpenGL pixel type enum when uploading
color buffer content to host.

Change-Id: Idc859306c0398850505f0f348796bc4f12b63b6a
2011-06-21 20:47:43 +02:00
Stas Gurtovoy
5960b2717c emulator opengl: Added support for config_size 0 to FBConfig::chooseConfig
Fixed a bug in FBConfig::chooseConfig implementation

Change-Id: I4b8e98f43825c012f13d0a0684fe8f918e511400
2011-06-21 20:47:43 +02:00
Stas Gurtovoy
ca629bd28e emulator opengl: fix crash in gralloc_free
Fixed bug in list implementation in gralloc_free which caused a crash,
also removed some log prints.

Change-Id: Ie932c838086c99567643868682419ceb122cf787
2011-06-21 20:47:43 +02:00
Guy Zadikario
1ef706f96f emulator opengl: implement glGetString
Added rcGetGLString token to renderControl to query
a GL string constant from the current context from the host.
Implement glGetString functinality in EGL so that the string
value can be cached in the context structure and also
implementation can be shared between GLESv1 and GLESv2.

Also, fixed clientAPI context initialization check in
eglMakeCurrent. The check was for the previously bounded
context instead for the newly bounded context.

Change-Id: I41c0b4ad462c9ad5bd5c66719b41509bb1b7a947
2011-06-21 20:47:43 +02:00
Guy Zadikario
a2ec7339da emulator opengl: use eglGetProcAddress in EGL dispatch.
Initialize EGL extensions functions in the EGLDispatch
table using eglGetProcAddress instead of dlsym.
(try dlsym if eglGetProcAddress failed).

Change-Id: I256c4c5f9f3728a5b0e4d5bbcc75b83aa8a85f29
2011-06-21 14:48:44 +03:00
Guy Zadikario
4ec4346f07 emulator egl translator: Fix eglGetProcAddress.
Fixed eglGetProcAddress when called for egl
extension functions.
Also fixed a typo in the EGL extension string.

Change-Id: Ia081257fa641182246eec723d08ae2e9148ca0cc
2011-06-21 14:48:44 +03:00
Guy Zadikario
f0dce80492 opengl renderer: Fixed colorBuffer texture creation.
The created texture format which represents the color buffer must
be of type GL_RGB or GL_RGBA also for the 565/5551 surface formats.

Change-Id: I7799a4824a0a5b8d57e3bfc507cac5664340725e
2011-06-21 14:48:44 +03:00
Guy Zadikario
b57ad81dae emulator opengl: Fix bug when re-binding the same context
When re-binding the same context the resoult was that the
surfaces got unbinded from the context.
Fixed that situation and added an optimization to do nothing
in case of re-binding the same context to the same binded surfaces.

Change-Id: Ic7058723399b0807d902c29b4170c7465c02bb99
2011-06-21 14:48:44 +03:00
Stas Gurtovoy
5def410ff5 emulator opengl: more few fixups needed for the system to load.
Change-Id: I698b14d0f594c091c237a605aeefbb048bf746ca
2011-06-21 14:48:44 +03:00
Stas Gurtovoy
613025efb3 emulator opengl: pool of fixups to the host side.
Those are the host side fixups required for the system to load
without failure to the point of bootanimation is run.

Change-Id: I42eebb123b05aaf6a0671e91e77a4ba6b330b852
2011-06-21 14:48:44 +03:00
Stas Gurtovoy
6a79e88f01 emulator opengl: pool of fixups to the system components.
Those fixes make the system load without failure.
Also the flinger and bootanimation are running.

Change-Id: Ieb7039e76c444df778a421a07bccc48514199245
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
2220d27302 emulator opengl: added Bind texture to EGLImage/surface
added functionality to bind an EGLImage to a texture both
in the system and host sides.

Change-Id: I2dc26090b45da080ac4d0e8f5799c95f7cc54634
2011-06-21 01:41:50 +03:00
Stas Gurtovoy
a26f6f221b emulator opengl: Added glFinishRoundTrip to GLESv2
Change-Id: Ia1c6cb7e75a1769040d13e81d0da7db5f5c28435
2011-06-21 01:41:50 +03:00
Liran
163235e504 opengl translator: fix eglGetConfigAttrib
fix renderable type parameter for eglconfig

Change-Id: Iac1d782cc37b0c7055bb90109a17583b84e6e6e3
2011-06-17 18:16:46 +03:00
Liran
ac7987ee84 opengl translator: conformance fixes
- fix destructor of eglcontext to delete its share group if needed
- fix available eglconfigs not to choose configs with BUFFER_SIZE=0
  or configs which do not support RGBA
- fix conformant bit on eglconfig
- fix typo in glBindBuffer
- fix glVertexAttribPointer to send correct offset to GL with vbo

Change-Id: I69d980407a40cb371ec62c5c883e4190bdcfce72
2011-06-17 18:16:46 +03:00
Stas Gurtovoy
de40cd3cc8 emulator opengl: Small change to support more surface attributes
Change-Id: I14d630d50c8505dabcd065e6187bd6d6509c312b
2011-06-17 17:27:19 +03:00
Stas Gurtovoy
a6882bf79d emulator opengl: Added glFinishRoundTrip implementation.
This is to allow glFinish to wait for the host render to finish.

Change-Id: I43e23aee19700b79bc70c89e791df180c6c1fb91
2011-06-17 17:27:19 +03:00
Stas Gurtovoy
903945c963 emulator opengl: implemented getProcAddress in GLESv1.
Also changed emugen to generates gl_ftable.h needed for
getProcAddress implementation.
Added not_api attrib to emugen's gl.attrib to exclude from the
generated ftable.

Change-Id: I03786ea5d5a640bbcf5efccadca5bf2ec3e09fca
2011-06-17 17:27:15 +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
Stas Gurtovoy
a7b7e95b03 emulator opengl: implement eglChooseConfig functionality.
Added new RenderControl command to request the host to execute
the ChooseConfig functionality.

Change-Id: Ib92be313a6df740de69d671c6994ec6cae17ea13
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
33dc9add2a emulator opengl: some system egl fixes after a review.
Change-Id: I4a0c72319e8c69fba8ac00ed7bfff7667ae07269
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
c36ac6ed2f emulator opengl: moved gralloc buffer handle struct to be shared.
We need to share the cb_hande_t between gralloc/EGL/GLES, moved it
into the opengl system common lib.
Also added eglSwapBuffers implementation.

Change-Id: Ia461a48c273af42293aafcf084e457adf03cbed3
2011-06-11 00:16:21 +03:00
Stas Gurtovoy
dd0a3777bc Handle egl context
Added EGLContext functionality to emulator's accelerated EGL implementation.

Change-Id: Idde7d701808839f8d89c6c081a9f3216bdea7a52
2011-06-11 00:16:20 +03:00
Stas Gurtovoy
8a8c601c4f emulator opengl: Create and destroy Surfaces
Also fixed link failure.

Change-Id: I4cbe28b2d51a5d4e48c4cba72df64f9df0898da5
2011-06-11 00:15:19 +03:00
Stas Gurtovoy
37db3deb7b First commit of the system egl implementation.
At this point system/egl should build without errors

Change-Id: Ieabae930fc20a8df4f3d68f179d685401e946e74
2011-06-09 21:24:26 +03:00