Commit Graph

60 Commits

Author SHA1 Message Date
Yochai Shefi Simchon
2da542b598 1.1 Translator conformance: fix texture issues
This fixes three issues:

1. glGet(GL_2d_TEXTURE_BINDING) should be handled by the translator rather
than by OpenGL.

2. glIsTexture shoud return GL_TRUE only if the texture was bound at some
point - add a wasBound member to the TextureData and maintain it.

3. glTexParameter(GL_GENERATE_MIPMAP) did not work. The first problem was
that it was not allowed by our validator - fixed. The next issue is that
this enum is not necessarily supported by the OpenGL implementation - it
is in OpenGL 2.x, but was replaced by an extension in 3.x. So in case the
extension does not exist, and GL_GENERATE_MIPMAP is required, save this info
in a new requiresAutoMipmap member of TextureData and call glGenerateMipmapExt
whenever glTex(Sub)Image2D is called.
There is a theoretical case where neither GL_GENERATE_MIPMAP nor glGenerateMipmap
is supported by the OpenGL implementation - this is not likely to happen, but
if we find such an implementation it might require implementing a mipmap
generation software algorithm (which is bad).
2011-07-03 14:56:13 +03:00
Stas Gurtovoy
635e929c44 opengl translator: fixed glGetString(GL_EXTENSIONS) for GLESv2
fixed query of GL_EXTENSIONS in glesv2.
Also fixed EGL surface desruction when there is
no current context.
2011-07-03 14:56:13 +03:00
Yochai Shefi Simchon
d18e93ba4c Translator 1.1 conformance: fix ARRAY related gets
There is a set of glGets which query the client state of the
binded arrays. The data exists in the translator context and is not
passed to GL, so the glGets should be handled internaly.
This is done by implementing four glGet*v methods in GLEScontext, which
return a boolean value indicating whether we have set the return value
or not, and are called by the glGet*v functions in GLEScmImp.
Two of the glGets are handled by GLEScontext, and the other 15 by
GLEScmContext since they are specific to GLES 1.1. The same should be
done for 2.0 specific glGets in a later patch.
Also. bufferName is now saved in GLESPointer in to allow the
GL_*_ARRAY_BUFFER_BINDING get.
2011-07-03 14:56:13 +03:00
Yochai Shefi Simchon
b241f904f0 Translator: fix eglGetProcAddress() on Linux
Our implementation of eglGetProcAddress() resolves the function addresses
in run time. Typically this is not an issue, but when a gl function is
also implemented by the calling app the address was resolved to the calling
app's version of the function rather than ours. This is the case with the
glDrawTex{isfx}OES functions in the 1.1 conformance test.
The solution is to add the -Bsymbolic switch when linking our libraries,
so all symbol resolution is done internaly.
The same fix should probably be done for Mac.
2011-07-03 14:56:12 +03:00
Yochai Shefi Simchon
83132ab0a2 Translator 1.1 - fix glGetPointer
getPointer is implemented both in GLEScmContext and its parent GLEScontext,
but was not declared virtual amd hence didn't work.
2011-07-03 14:52:28 +03:00
Yochai Shefi Simchon
6a40d94db4 Fix segfault when destroying context
m_texCoords was not initialized in the GLEScontext constructor, so when
destructing it resulted in an illegal free.
2011-07-03 14:47:12 +03:00
Yochai Shefi Simchon
03da50800f glDrawTex- GL_INVALID_VALUE if width/height <= 0 2011-07-03 14:47:12 +03:00
Amit Feller
772de2edde opengl translator: extending ConversionArrays class
inserting some of the logic which was scattered over some parts
of the GLESContext class to be encpsulated inside the ConversionArrays
so that the code will be more clea and organized.
2011-07-03 14:47:12 +03:00
Liran
166f3cb3c6 opengl translator: add vertex attrib index validation.
Fixed conformance test issue.
2011-07-03 14:32:43 +03:00
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
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
efcbbc3f28 emulator opengl: fix windows build
Change-Id: I145c7bf3a664fdb2c9e113cd977b4b2431d0668d
2011-06-30 09:14:16 +03: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
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
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
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
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
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