Commit Graph

56 Commits

Author SHA1 Message Date
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
Guy Zadikario
a7f83c0565 removed old/obsolete file GLEScontext.cpp
Change-Id: I82f21eef958e37515b46279cf2b44386320723ca
2011-06-06 13:19:26 +03:00
Yochai Shefi Simchon
3150361b51 Fix issues raised by the GLES 1.1 conformance test
- Most of the fixes are about unhandled enums.
- Adding an unbindBuffer method to GLEScontext, and use it in the
 glDeleteBuffers call, so a buffer is not considered bound after
 it has been deleted.
- Handle the case where a call to glCompressedTexImage2D gets
 NULL as its data (in which case the uncompressTexture function
 should only calculate the output format, but not attempt to
 uncompress the NULL data).
- A few segfaults.

Change-Id: I6a856ea6da1be3b15b41140d6383508a6803897c
2011-06-05 13:34:27 +03:00
Yochai Shefi Simchon
889d928f29 Fix a bug where eglMakeCurrent(NULL) did not work
This happened because the VALIDATE macros terminated the function prematurally.
Also clear the surface bindings from the previous context.

Change-Id: I33d587f5e877caa6ec651a04ff887e0c77a9d5f3
2011-05-31 15:01:59 +03:00
Yochai Shefi Simchon
88ec3acc83 Fix a mess in contexts/surfaces reference count
The main issue was that SmartPtr had an implicit cast to void*, returning its
internal pointer. This allowed writing unsafe code, since the internal pointer
could be handled without increasing its ref count.
So, removed this cast and fixed the various places which relied on it.
Also, fix two calls to "destroy" ahich should have been "markForDestruction".
The naming is not good, should probably change it in a later patch.

Change-Id: Idabc800e97649b2e2404fb7387d25deac70af62e
2011-05-31 15:01:59 +03:00
Yochai Shefi Simchon
eada5b81de ThreadInfo- use explicit rather than void pointers
Replace the void* pointers with explicit pointers for EglContext, EglDisplay
and GLEScontext. Use forward declarations. This is to improve finding errors
in compile time rather than on run time.

Change-Id: Iaec3c36c1e12f36b37d34f68e9d8aa58ff1b30c0
2011-05-31 14:59:20 +03:00
Yochai Shefi Simchon
094026698e Fix version returned by eglInitialize from 4.1 to 1.4.
Change-Id: I43f3512374f546a81b7cfbba8959ce9f0ed7fe53
2011-05-31 14:15:02 +03:00
Yochai Shefi Simchon
aac7fe282c EglChooseConfig should handle the case where "configs" is NULL.
Change-Id: I236afdfc73eb5dd5a3ab19e2b388772ea297bdb4
2011-05-31 14:13:26 +03:00
Amit Feller
624176d51a Emulators's GLES 2.0 translator implementation
This is the GLESv2 on top of openGL implementation on the host
most of this change is moving code which is necessary by both
GLES 1.0 and GLES 2.0 implementations from GLES_CM folder into
GLcommon folder.

GLESv2Imp - includes GLES 2.0 entry points implementation

Change-Id: I934fb963478a7f596d824612f847a5aa77d2ed9d
2011-05-30 11:06:24 +03:00
David Turner
fd6ed4dd31 Merge "adding functionality to get the local name of an object from it's local name" 2011-05-18 06:52:22 -07:00
Amit Feller
f0b7c2e4f9 this checkin supports windows OS in all Translator libs
Note: this is a re-submit of Ie5111d9c435b64d205b140a79863c0273742ee7f,
fixed to avoid breaking the Mac build.

Change-Id: Ib534063d3f403d33d162956bf510baf9689a246a
2011-05-17 21:28:17 +02:00
David 'Digit' Turner
2840185690 Fix mac build
Change-Id: I1fc8c5043160dbe2508324655fb506bc31cc50ac
2011-05-17 21:00:52 +02:00
Raphael Moll
603b37abac Revert "this checkin supports windows OS in all Translator libs"
This reverts commit 0bf6848571.

This commit breaks Mca builds:
  development/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp: In function 'EGLBoolean eglChooseConfig(void*, const EGLint*, void**, EGLint, EGLint*)':
  development/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp:412: error: 'PIXEL_FORMAT_INITIALIZER' was not declared in this scope
  make: *** [out/host/darwin-x86/obj/SHARED_LIBRARIES/libEGL_translator_intermediates/EglImp.o] Error 1
2011-05-17 11:41:30 -07:00
Amit Feller
1f4c692222 adding functionality to get the local name of an object from it's local name
Change-Id: I8c9ccc36a5fb70a38a77fa0f0e7826a6fe886db1
2011-05-17 16:10:27 +03:00
Amit Feller
02c3e538e8 fixing bug in the name of GL function "glClearDepthf" --> "glClearDeapth"
Change-Id: I9700bdb973d2dc01400078c349010a271004dbd9
2011-05-17 15:33:43 +03:00
Amit Feller
0bf6848571 this checkin supports windows OS in all Translator libs
Change-Id: Ie5111d9c435b64d205b140a79863c0273742ee7f
2011-05-17 11:20:25 +03:00
Amit Feller
6203540306 small changes to the code before the commit for supporting windows os
Change-Id: I062add6d6340677a9e2e98ac47d53c87ad2a6535
2011-05-11 17:48:21 +03:00
Amit Feller
e387c21109 changing GLcommon lib to be a sharedlib instead of static
Change-Id: Ic1fdcd1fbf3105a6fbd26c77e58acbe9b09dcacb
2011-05-11 17:31:02 +03:00
David Turner
fdd5607a6d emulator: opengl: Fix Mac and Windows builds.
+ Fix typo in clean step.

Change-Id: I1da8b17a167247d252b5e8519832b042c2db3ccd
2011-05-03 18:29:27 +02:00
David 'Digit' Turner
4707d72787 adding error handling for Xerrors on EGl linux implementation (EglLinuxApi.cpp)
Change-Id: Ib8535e2c25c7de67c8d7830a644643b52742ceaa
2011-05-03 16:42:44 +02:00
Jacky Romano
5fb23be610 emugen: porperly handle nullAllowed API calls
This change fixes bugs in the encoder and decoder code generation
with nullAllowed flaged parameters

Change-Id: I7b196fbb41bbb2cfaa429e7c1dde3a415778ee51
2011-05-03 16:03:49 +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
b95e444f2b emulator opengl - GLESv2 implementation
Decoder side implementation for GLESv2

Change-Id: I5db0c0acd2ef52a156487a99ece5cd2f5b073616
2011-05-03 15:11:36 +02:00
Jacky Romano
979bbff8c0 emugen: make 'setContextAccessor' method static
Change-Id: Iad924f77464236af2d78e147276125ee0e481073
2011-05-03 14:42:47 +02:00
Jacky Romano
a3b48dbbe7 emugen - fix wrapper context naming
Change-Id: I5261c5f94f200480bad4ad74812c20302a5e81d5
2011-05-03 14:41:52 +02:00
Jacky Romano
ea3a3584f5 emugen: generate wrapper library files
Add functionality to generate a wrapper library. A wrapper library includes:
1. entry points
2. dispatch table (accessed from the library entry points)
3. dispatch table accessor callback
4. dispatch table initialization function

Note that the dispatch table initialization function used to be part of the decoder. This
change moves it to be part of the dispatch table layer where it belongs.

Change-Id: Ide6764a17cc029056f9946e778a513cdc2a49003
2011-05-03 14:40:52 +02:00
Amit Feller
25d29c4778 adding support for getting gles proc address from eglGetProcAdress
Change-Id: Ife1b3be5abd181cce837eebbf993e99759eec8e7
2011-05-03 13:34:13 +02:00
David Turner
2d3b98f87b emulator: opengl: Fix Mac build
This fixes several issues when building the host libraris on Darwin.
Note that there is still not proper implementation of backend functions.

Change-Id: I3ba4120df6545a8c2aa62fdfcaadaf5ff4972456
2011-05-02 14:08:03 +02:00
David Turner
27c128d701 Merge "GLESv1 extensions" 2011-05-01 23:53:38 -07:00
Amit Feller
0ff6e7917b supporting EGL_KHR_image_base & EGL_KHR_gl_texture_2d_image extentions
Change-Id: I69c3e975c892bcd0872c47e349b427f570d7e82d
2011-04-29 22:10:43 +02:00
Amit Feller
fce7b684b1 integrating objectNameManger into GLES implementation
Change-Id: Icda250f9e9d3af15a2d7c214136b777833d5596d
2011-04-29 22:10:43 +02:00
Amit Feller
a245cb125f Emulator's host translator EGL implementation.
This is the EGL implementation for the host EGL/GLES translator.

EglImp.cpp - includes the EGL entry points implementation.
ThreadInfo.cpp - defines the per-thread info which is shared to EGL and GLES
EglOsApi.h - platform dependant interface functions.
EglLinuxApi.cpp - implements the GLX platform of EglOsApi
EglWindowsApi.cpp - implenents the Windows platform of EglOsApi - This has not been compiled yet!!!

Change-Id: I30a8cf457858ef04febf67005787d8d18e5e7a70
2011-04-29 22:10:43 +02:00
Amit Feller
03dcd431cc Emulator's GLES translator implementation.
This is the GLESv1 on top of OpenGL implementation on the host.
GLDispatch - dispatch table to host OpenGL implementation.
GLESimp - includes GLES entry points implementation.

Change-Id: Ief5eac2253a5a98b75a5d76363a36b7587d17391
2011-04-29 22:10:43 +02:00
Liran
fb06a28c30 GLESv1 extensions
This fix adds support for OpenGLES 1.1 extensions in the codec
layer. This fix also includes bug fixes in GLEncoder (client-state)
and gles android wrapper modules.

Change-Id: I512649724d43e4af9d3ce5d49ae66d9f4da0b823
2011-04-28 09:24:46 +03:00
David Turner
eff952cdbf Really fix the Mac build.
Damned!

Change-Id: Ice8295fb23beefe328207112b011489276b5b278
2011-04-16 22:21:57 +02:00
Guy Zadikario
555d9bece7 emulator opengl: the host renderer executable.
This is the host renderer executable. It is a small process which
just calls into libOpenglRender library. The process is invoked
through the initOpenGLRenderer function of libOpenglRenderer.

Change-Id: I85af075b5eb751ffb9543ecbd8e7fc155054f146
2011-04-16 10:45:48 +03:00
Guy Zadikario
1f0d3939ed emulatgor opengl: First commit of the host renderer library.
This is a library which includes all the OpenGL renderer functionality,
it is packaged in a library so that both the renderer process and the emulator
program will be able to use that functionality.

NOTES:
   1) gl_proc.h and GLDispatch.{h,cpp} in this commit will be replaced
      with the decoder auto-generated dispatch in a later commit, the
      auto-generated dispatch is currently missing some extension functions
      required for the renderer.
   2) look at host/include/libOpenglRender/render_api.h for the external
      interface defined for this library (to be used by the emulator).

The following is a description of each component:

FrameBuffer - The main object which manages the framebuffer and color buffers.
              This is a singleton which get initialized through its initialize
              static function. It initializes the OpenGL renderer and must be
              called first. This initialization function is not thread safe so
              it must be called before any thread that is calling to this
              library is created.

FBConfig - Includes a static set of configs supported by the renderer which get
           initialized during FrameBuffer initialization phase. Also,
           an instance of this class includes the a description of one frame
           buffer configuration supported by the renderer.

RenderContext - encapsulate a rendering context state.

ColorBuffer - implements a color buffer object as a texture which can be bind
              as render target or source.

WindowSurface - implements the functionality of a native window which can be
                bound to a rendering context and its target ColorBuffer can
                be specified and replaced.

ThreadInfo - holds per-thread information.

EGLDispatch - loads the EGL plugin library, all egl calls are made through
              this dispatch table which get initialized during initialization
              phase.

GLDispatch - loads the GLES plugin library, all GLES calls are made through
             this dispatch table which get initialized during initialization
             phase - This will be replaced by the auto-generated code of the
             decoder ...

RenderThread - implements a thread that reads command tokens from an IOStream
               and decode it.

RenderControl - implements the host side implementation of the renderControl
                API, when a renderControl token is decoded from the stream
                it is dispatched to this implementation.

RenderServer - implements a TCP server which listens to port number and
               launcges a RenderThread for each new connection.

Change-Id: I9f34d17bdfcb715893a13cd30086c767f499df87
2011-04-16 10:45:39 +03:00
David Turner
23a491dccd Merge "emulator opengl: renderControl API encoder/decoder" 2011-04-15 06:45:25 -07:00
David Turner
2732ff2db2 Merge "Moved IOStream.h to be used in external API for libOpenGLRender." 2011-04-15 06:42:28 -07:00
Guy Zadikario
32fc922316 emulator opengl: renderControl API encoder/decoder
That adds the renderControl API encoder/decoder which is used for
guest to host control commands. See system/renderControl_enc/README
for more info about the API itself.

Change-Id: I2c72803137889d646fbb3d2a56ecdcf94b088f40
2011-04-13 13:33:26 +03:00
Guy Zadikario
caafd4df2e Moved IOStream.h to be used in external API for libOpenGLRender.
This change includes four changes:
1) moved IOStream.h into host/include/libOpenGLRender, this directory
   will include the api interface into the libOpenGLRender which will be
   used later by the emulator and we need this interface to use IOStream.h
2) Updated Andorid.mk files to include the new directory location of IOStream.h
   in the LOCAL_C_INCLUDE.
3) Added new function "read" to IOStream which reads a message without a givven
   size.
4) Updated TcpStream to use "cutils/sockets.h" instead of using directly the socket api for portability reasons. (It now compiles on windows as well).

Change-Id: I30eb40c8dcd5aacf0d993aff9cdb90b283b12dde
2011-04-13 13:33:05 +03:00