Commit Graph

135 Commits

Author SHA1 Message Date
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
Guy Zadikario
cd1489a89c opengl translator: make GLcommon static library
This change turns GLcommon to be static instead of shared
library.
Removed the s_globalNameSpace static object from objectNameManager
and moved it to live inside the EglDisplay object which is shared
for all display space objects (GLESv1, GLESv2 and EGL).

Change-Id: I92fa71fb7cbac423c22b7188e8d9642a5fddf0d9
2011-06-07 11:29:15 +02:00
Amit Feller
0db9dae215 opengl translator: moved some types out of eglplatform.h
Some native types like NativeFBConfig and NativeContext are
internal to the translator implementation and should not
exist in the interface headers.
Moved those types from eglplatform.h into eglinternalplatfom.h

Change-Id: I6462a007de8c185deecbb9beebc343ca3626fd0c
2011-06-06 19:01:45 +03:00
Amit Feller
c879e1c8a6 opengl translator: initialize dispatch with dummy functions
Initialize the GLDispatch with dummy function instead of
NULL pointer in case the function does not present on the
host OpenGL library. Prevent ugly segfault when a call to
such function is made.

Change-Id: I3488e60e091af06273a5680accabb7fe30fab066
2011-06-06 19:01:45 +03:00
Amit Feller
3dd22a5450 implementing mac OS support for translator's libs
Change-Id: Ifa12cf1177db49197ad8496f4e0ef8098d43aa8d
2011-06-06 18:45:01 +03:00
Amit Feller
dd26774dac opengl translator: GLSL ES translation
There are some differences between GLSL/ES and Desktop
GLSL. This change translate the GLSL/ES shader source
to be compatible with the desktop GLSL language.

Change-Id: Ia6fdd6a90944926adcf440299b9ea3a4500d1eb1
2011-06-06 18:45:01 +03:00
Amit Feller
d61fb75ef8 opengl translator: added EGL_RENDERABLE_TYPE attrib
fixing bug in eglChooseConfig, there was no referer to
EGL_RENDERABLE_TYPE this caused the eglChooseConfig to fail
when an attribute EGL_RENDERABLE_TYPE was specified in
the attrib_list

Change-Id: Ib4635a55ef3cc0ff380e581d4a41602ddfd32f82
2011-06-06 18:45:01 +03:00
Liran
e4b6d4a629 fixes for gles2 tests
load necessary functions from gl dispatch for gles2
fix usage of global names in some functions
combine the shaders and programs namespace to one

Change-Id: I92bd90a91a5840fcceebd05ab06bebb65bb415a0
2011-06-06 13:22:38 +03:00
Liran
da84d440c6 add gles2 extensions
implement extensions for gles2
add missing entry point for gles1 EGLImage extension

Change-Id: I7cf0118fdf69f3fb2a7023cf97134efd6aabbf59
2011-06-06 13:22:38 +03:00
Liran
d94a2efe6a implement GL_OES_draw_texture
Change-Id: I9f91fa63dab0cf769dd5ee609c96d1143122991c
2011-06-06 13:22:38 +03:00
Liran
3b7e5e3281 Add gles 1 extension implementation to translator
This fix addes to the Translator the implementations of theses extensions:
GL_EXT_texture_format_BGRA8888
GL_OES_blend_equation_separate
GL_OES_blend_func_separate
GL_OES_blend_subtract
GL_OES_depth24
GL_OES_matrix_palette
GL_OES_extended_matrix_palette
GL_OES_element_index_uint
GL_OES_framebuffer_object
GL_OES_packed_depth_stencil
GL_OES_point_size_array
GL_OES_point_sprite
GL_OES_read_format
GL_OES_stencil_wrap
GL_OES_texture_env_crossbar
GL_OES_texture_cube_map
GL_OES_texture_mirrored_repeat

Change-Id: I472808d123ec0e03279137a48d89dc4b19023758
2011-06-06 13:22:30 +03:00