Commit Graph

135 Commits

Author SHA1 Message Date
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 'Digit' Turner
91f40d930e emulator: opengl: ut_renderer usability improvements
This patch provides two useful changes to the ut_renderer
unit-test program:

1/ the ability to control the GL window dimensions with
   two env. variables: ANDROID_WINDOW_WIDTH and ANDROID_WINDOW_HEIGHT

2/ the ability to save/restore the GL window position between
   GL connections.

Both are useful to use ut_renderer in a demo setting, nothing more.

Change-Id: I19a8f911ee821ddc4eb6307de12d63600ff696b0
2011-05-05 22:42:31 +02: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
e22ae45128 emulator: opengl: Add clean step.
The previous changes replaced /system/lib/libGLES_emul.so with
several other libraries (lib{EGL, GLESv1_CM, GLESv2}_emul.so).

The clean step removes the old libGLES_emul.so from the build to
avoid any surprises.

Change-Id: I285b34c4d5f5a8bd3b37d9cb1b2da33fb155e62c
2011-05-03 16:55:11 +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
David 'Digit' Turner
892a6306e7 emulator: opengl: Use QEMU pipe.
This patch modifies the guest libraries to use the new
fast qemu "opengles" pipe to communicate with the host
renderer process.

Note that the renderer is still listening on a TCP socket
on port 22468.

Change-Id: I6ab84f972a8024e1fdababa4615d0650c8d461bf

Conflicts:

	tools/emulator/opengl/tests/gles_android_wrapper/Android.mk
	tools/emulator/opengl/tests/gles_android_wrapper/ServerConnection.h
2011-05-03 16:21:12 +02:00
Jacky Romano
7b73c9f1d3 common debug flag for the wrapper libraries
Change-Id: I6f20ed1e7a2b95dee21e09aa9b43fae22e5e4d3d
2011-05-03 16:12:26 +02: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
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
a003fb6596 emulator opengl: missing constant in glUtilsParamSize
GL_MAX_TEXTURE_IMAGE_UNITS

Change-Id: I5cb5747fcb94fe919600f8f0f18e72fc2e94e51f
2011-05-03 16:02:58 +02:00
Jacky Romano
4a17ab6429 emulator opengl - ensure server connection for rendering thread
Ensure a server connection creation on make current, for cases where
the context and surface was created on a seperate thread.

In addition this commit publishes all the surface as ES2 capable
if queried.

Change-Id: Ie415b8ab3e370fa7fe97a526276e333aaa5e9e8b
2011-05-03 16:01:31 +02:00
Jacky Romano
bfefa4dbc8 emulator opengl : add Dungeon Defenders to the test apps list
Change-Id: Ia97db38daa672e5d9d265e2ffa5bd169b59bd7d5
2011-05-03 15:53:41 +02:00
Jacky Romano
44d4d9473e opengl emulator : GLESv2 handling in the test egl implementation
Handle GLESv2 rendering in the emulator:
* load and initialize GLESv2 encoder library
* hide request for GLESv2 surfaces and contexts from the emulator
native implementation
* communicate the context/surface version configuration to the rendering
server

Change-Id: I9226275fc4a24983767735bdf19ddafbe9d07f34
2011-05-03 15:49:02 +02:00
Jacky Romano
0c01f32aa2 emulator opengl : unit-test renderer GLESv2
Make the unit test renderer (ut_renderer) encode GLESv2 commands.
A rendering thread has both V1 & V2 decoder object, and tryies to decode
commands of the two protocols from the stream.
Context creating is taking into account the API version and creates context
accordingly.
Decoder data is shared between the V1 & V2 decoders and applied to both of
them on makeCurrent (regardless to the requested context version)

Change-Id: If78e84310e5dcd22108c19656051b138b22e3c9f
2011-05-03 15:47:07 +02:00
Jacky Romano
25af30c464 emulator opengl: context version param
add version parameter when creating new context

Change-Id: I3e36796dd4e582b5deda0da2aaf764ceba92a1d1
2011-05-03 15:46:43 +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
b95e444f2b emulator opengl - GLESv2 implementation
Decoder side implementation for GLESv2

Change-Id: I5db0c0acd2ef52a156487a99ece5cd2f5b073616
2011-05-03 15:11:36 +02:00
Jacky Romano
804809556d emulator opengl: typo caused the decoder to crash
embarrassing :-)

Change-Id: I4da948bba0cd16b6e8289c3c79e0daefb41f90e4
2011-05-03 14:54:04 +02:00
Jacky Romano
e359543f4a Emulator Opengl unit test - use sperate implementation libraries
Use seperate EGL_emul, GLESv1_CM_emul and GLESv2_emul implementation
libraries.  This replaces GLES_emul that was prviously included
EGL and GLESv1.
This change enables the wrapper to support GLESv2. However,
this current EGL implementation uses the native android emulator
EGL thus will not expose this GLESv2 capability.

Change-Id: Ib0a309d71cce1248efe9a08aa59434101d0ac607
2011-05-03 14:54:04 +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
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
Jacky Romano
139308015e emulator Opengl - slight type change for GLESv2
Match the location type in the decoder context data to take
int locations rather then symbolic constants.

Change-Id: I353e43315c90dbeafe4820a3749a0d1cf0848d4b
2011-05-03 14:39:11 +02:00
Jacky Romano
68367ae969 emulator Opengl - number of supported vertex attributes
make the number of suppoted vertex attributes (by the codec)
common across the encoder and the decoder.

Change-Id: I699ef62821566cec0764982872adb92ebb8861e9
2011-05-03 14:38:29 +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
8e2dc32b2d Merge "Add GLESv2 functionality to GLESv1/GLESv2 shared code" 2011-05-02 09:18:55 -07:00
David Turner
77b1a4565c Merge "Move utility functions into glUtils" 2011-05-02 09:15:28 -07:00
Jacky Romano
254492ffd6 Add GLESv2 functionality to GLESv1/GLESv2 shared code
Extends GLClientState to support additional state data
that is required by GLESv2. this includes:
* normalized flag in vertex attribute arrays
* getter for vertex attribute arrays state
* glParamSize now knows about the result size of GL2 parameters
* utility functions required for a GLESv2 encoder

Change-Id: I7e57d978bed5b8b929b918aee66c7f71dc5df3b1
2011-05-02 18:23:13 +03:00
Jacky Romano
3c2aa9b931 Move utility functions into glUtils
Move utility functions into glUtils so they can be shared
between GLESv1 and GLESv2 codecs.

Change-Id: I673b316395604e4288412e7ace328076812d4cc1
2011-05-02 18:23:13 +03: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