aboutsummaryrefslogtreecommitdiffstats
path: root/emulator
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Revert "Add targetPlatform for executable binaries"" into ↵Xavier Ducrohet2015-02-131-14/+14
|\ | | | | | | | | | | | | | | | | studio-1.2-dev automerge: 2c05810 automerge: 3b7b0b5 * commit '3b7b0b509b4077688f38f3eab3e80e0db19dc643': Revert "Add targetPlatform for executable binaries"
| * Revert "Add targetPlatform for executable binaries"Xavier Ducrohet2015-02-121-14/+14
| | | | | | | | This reverts commit 7f3cb91779907c12d02e8e5c5f4a6a7c510d210e.
* | Merge "Add targetPlatform for executable binaries" into studio-1.2-dev ↵Raymond Chiu2015-02-101-14/+14
|\ \ | |/ | | | | | | | | | | | | | | automerge: f7757fb automerge: 95fc762 * commit '95fc7621288e7bd695b41a8b0c4ec589d94c86d8': Add targetPlatform for executable binaries
| * Add targetPlatform for executable binariesRaymond Chiu2015-02-101-14/+14
| | | | | | | | | | | | Make dsl changes due to gradle update. Change-Id: I65729783f5c8f985ed31a231e7dd9a0b9e50f7b3
| * Correctly set error codebohu2014-11-252-4/+28
| | | | | | | | | | | | Fixed a few error codes to be more accurate Change-Id: Ifad6bf51c399215a9110bd40cfd380309ac6422c
| * Validate glClear maskbohu2014-11-251-0/+3
| | | | | | | | | | | | | | The mask should only be a combination of GL_DEPTH_BUFFER_BIT, GL_COLOR_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT Change-Id: Ic448bd33a9bf0dc50db4298a53e96dd128fd110c
| * Check and return correct error codebohu2014-11-251-3/+5
| | | | | | | | | | | | | | | | check and return proper error codes when negative width, height or size or wrong internal texture format is passed in. Change-Id: Ic4ddea55042d8e21f8729a7ca675a44a232b7c7c
| * validate glBufferData's usage parameterbohu2014-11-253-0/+12
| | | | | | | | | | | | | | Only GL_STREAM_DRAW, GL_STATIC_DRAW and GL_DYNAMIC_DRAW usages are allowed. Change-Id: I2d6a425363c32330d25272d26884d32610d8dd19
| * Detach texture or renderbuffer when deleting thembohu2014-11-252-1/+29
| | | | | | | | | | | | | | When a texture or renderbuffer is still attached to framebuffer but is getting deleted, it should also be detached from framebuffer. Change-Id: Ide2c2a0e36ca8bf58f9351a17b78b76ebd507c12
| * emulator/opengl: Fix glShaderSource() signature.David 'Digit' Turner2014-11-2510-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The glShaderSource() function really takes a 'const GLchar* const*' parameter, not 'const GLchar**'. This creates issues when compiling the auto-generated encoders created with the latest version of 'emugen' and the GL2 Khronos headers. This patch is used to fix the issue. Note that it requires defining a new type in gl2.types, as well as fixing the signature of misc functions in the translator. Change-Id: I750f95f2e33d83b3b5563642ad7f87e4b8a37f35
| * emulator/opengl/emugen: Add new 'flushOnEncode' entry point flag.David 'Digit' Turner2014-11-2522-2/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new flag that can be applied to entry points for 'emugen', named 'flushOnEncode'. When used, the generated encoder will call stream->flush() just after adding bytes to the stream. This is needed to match the manual change that was performed in the renderControl encoder in the following patch: https://android-review.googlesource.com/#/c/95864/ Change-Id: I8cc8fdb0d38ef27e8ba646c83d717166400babfd
| * emulator/opengl: Remove compiler warnings.David 'Digit' Turner2014-11-253-2/+4
| | | | | | | | | | | | | | | | | | | | This patch ensures that the auto-generated client_context.h headers do not generate compiler warnings in the setError() function. + Remove tiny warning for NativeLinuxSubWindow.cpp Change-Id: Ibab92ab3332fd284589435732b52c011ae21c15f
| * emulator/opengl/emugen: Small cleanup of autogenerated sources.David 'Digit' Turner2014-11-257-52/+49
| | | | | | | | | | | | | | | | | | | | | | | | This patch ensures the generated sources are cleaned up a little bit, more specifically: - Add proper end-ifdef-guard comments. - Use anonymous C++ namespaces to avoid name conflicts in the encoder. - Remove extra spaces / empty lines / indent. - Use 'const' when defining constant tables. Change-Id: Ib11fd06adb9075d472d1dd2fd6defb0760aaa2c2
| * emulator/opengl: Add emugen test suite.David 'Digit' Turner2014-11-2522-0/+629
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a small test suite to check the output of the 'emugen' program. This serves two purposes: 1) To more easily check that modifications to 'emugen' do not break stuff liberally. 2) To better document how the changes in the generator actually modify the output. To run it, simply call the 'run-tests.sh' script with 'emugen' in your path, or use --emugen=<program> otherwise. See --help for more details. NOTE: The test suite currently doesn't check that the generated sources compile properly, or that they even work as expected. See the following external/qemu patch to call run-tests.sh during each android-rebuild.sh run: https://android-review.googlesource.com/112541 Change-Id: I148e456ce726bda7168d433e407fe967959839f6
| * emulator/opengl/emugen: Use local variables for parameters.David 'Digit' Turner2014-11-251-83/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify the generated decoder to extract paramters from the stream into local variables, the rules are: - non-pointer parameters are extracted into local variables named "var_<name>", where <name> is the parameter name as it appears in the protocol specification for the entry. - for input pointers, use "inptr_<name>", as well as "size_<name>" for the corresponding size in bytes. - for output pointers, use "outptr_<name>" and "size_<name>" This makes the generated code easier to understand, for example the following: case OP_glBindAttribLocation: { size_t tmpPtr2Size = (size_t)*(uint32_t *)(ptr + 8 + 4 + 4); InputBuffer tmpPtr2(ptr + 8 + 4 + 4 + 4, tmpPtr2Size); DEBUG("gl2(%p): glBindAttribLocation(%u %u %p(%u) )\n", stream,Unpack<GLuint,uint32_t>(ptr + 8), Unpack<GLuint,uint32_t>(ptr + 8 + 4), (const GLchar*)(tmpPtr2.get()), (uint32_t)tmpPtr2Size); this->glBindAttribLocation(Unpack<GLuint,uint32_t>(ptr + 8), Unpack<GLuint,uint32_t>(ptr + 8 + 4), (const GLchar*)(tmpPtr2.get())); SET_LASTCALL("glBindAttribLocation"); break; } becomes: case OP_glBindAttribLocation: { GLuint var_program = Unpack<GLuint,uint32_t>(ptr + 8); GLuint var_index = Unpack<GLuint,uint32_t>(ptr + 8 + 4); uint32_t size_name = Unpack<uint32_t,uint32_t>(ptr + 8 + 4 + 4); InputBuffer inptr_name(ptr + 8 + 4 + 4 + 4, size_name); DEBUG("gl2(%p): glBindAttribLocation(%u %u %p(%u) )\n", stream,var_program, var_index, (const GLchar*)(inptr_name.get()), size_name); this->glBindAttribLocation(var_program, var_index, (const GLchar*)(inptr_name.get())); SET_LASTCALL("glBindAttribLocation"); break; } Change-Id: Ifa8c73eec85b818d6d8b6371587da9fdfa57de8e
| * emulator/opengl/emugen: Move pointer increment out of case statements.David 'Digit' Turner2014-11-251-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor patch that ensures that the pointer/position increment all happen at one place, instead of being replicated in each case statement. In other words, the generated code used to look like: switch (opcode) { case OP_someOperation1: { ... ptr += *(uint32_t)(ptr + 4); pos += *(uint32_t)(ptr + 4); break; } case OP_someOperation2: { ... ptr += *(uint32_t)(ptr + 4); pos += *(uint32_t)(ptr + 4); break; } ... default: { unknownOpcode = true; } Now it looks like: switch (opcode) { case OP_someOperation1: { ... break; } case OP_someOperation2: { ... break; } ... default: { unknownOpcode = true; } if (!unknownOpcode) { ptr += packetLen; pos += packetLen; } Which is cleaner. Also change the type of |opcode| and |packetLen| to uint32_t and size_t respectively. + Minor formatting changes to indentation. Change-Id: If0002fe18a24b9ce6691e3e3cd3e102d1e00d4c9
| * emulator/opengl/emugen: Introduce helper macros.David 'Digit' Turner2014-11-251-8/+17
| | | | | | | | | | | | | | | | This patch introduces two helper macros in the generated decoder to make its source code slightly more readable (DEBUG and SET_LASCALL). Change-Id: I6659fe69a5533e5194d8db5f1882abaf1a5daee5
| * emulator/opengl/emugen: Remove accessor functions.David 'Digit' Turner2014-11-254-79/+66
| | | | | | | | | | | | | | | | This patch simplifies the generated encoders and decoders by getting rid of the accessor functions (e.g. set_glDrawElementsData) given that all fields are public and can be written to directly. Change-Id: I15f4caac95e4d5f1e24a1a5838622600c6bc3207
| * emulator/opengl/emugen: Ensure correct buffer alignment.David 'Digit' Turner2014-11-252-4/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The decoders generated by emugen pass addresses that come directly from the stream to EGL/GL functions. Sometimes, these addresses are not properly padded with regards to the type of data being transfered and this can crash some implementations (e.g. OSMesa being compiled with -msse by default, and doesn't build without it). This patch introduces two helper classes in ProtocolUtils.h, named InputBuffer and OutputBuffer, which are used to auto-align buffer pointers, then make the generated decoder code use them. Change-Id: I345c7eecc230f62310ced5378b6344f419647e06
| * emulator/opengl/emgen: Fix debug output of floating point values.David 'Digit' Turner2014-11-251-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | When calling printf() with a "%f", the value passed must be a double, not a float, which means we can't just pass a 32-bit value in the stack and assume printf() will cast it to a float properly. This results in bogus values printed whenever a GLfloat is used in a function signature, due to invalid stack offsets used by the printf(). Fix the problem by using Unpack<>() template. Change-Id: I282d9c07af68457f32af477435e5dc1999267d39
| * emulator/opengl: Add UniqueIntegerMap class.David 'Digit' Turner2014-11-253-0/+329
| | | | | | | | | | | | | | | | This helper class will be used by future patches to map arbitraty opaque 'void*' values (e.g. EGLImage values) to 32-bit unique values that can be sent through the wire protocol. Change-Id: I5b17a1f230e5f9f8b905af66ba79b312f3f01e55
| * emulator/opengl/emugen: Use templates to read values from stream.David 'Digit' Turner2014-11-252-73/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The decoder didn't properly handle GLsizeiptr and GLintptr values, which are always 32-bit on the wire, but can be 64-bit on the host. I.e. it did something like that to read them from the stream: *(GLsizeiptr*)(ptr + offset) This fixes the issue by using templates to generate host-type-specific functions that properly read data from the stream and convert it to the appropriate host type. Change-Id: I75749bd715456ca143eb1713498f7cf635918801
| * emulator/opengl/emugen: Get rid of VarConverter.David 'Digit' Turner2014-11-252-72/+45
| | | | | | | | | | | | | | | | This patch simplifies VarType.h a bit, since there is no point in having a specialized class like VarConverter to essentially hold what is a size in bytes! Change-Id: Idbba469a8594d1e964bbe79bbbea65934c42c033
| * emulator/opengl/emugl: Remove ispointer field from types definitions.David 'Digit' Turner2014-11-254-95/+101
| | | | | | | | Change-Id: I3b4b5510eb5d5cb379f7a498b58b4adb6417290b
| * Need to revert this one and cherry pick earlier CLs firstBo Hu2014-11-1822-629/+0
| | | | | | | | | | | | | | | | Revert "emulator/opengl: Add emugen test suite." This reverts commit d4ddf47c4ef330fd40ea89dfa3279aca5b7facf0. Change-Id: I01a5f93453d90cb4f666c99c41cc95048c4411db
| * emulator/opengl: Add emugen test suite.David 'Digit' Turner2014-11-1822-0/+629
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a small test suite to check the output of the 'emugen' program. This serves two purposes: 1) To more easily check that modifications to 'emugen' do not break stuff liberally. 2) To better document how the changes in the generator actually modify the output. To run it, simply call the 'run-tests.sh' script with 'emugen' in your path, or use --emugen=<program> otherwise. See --help for more details. NOTE: The test suite currently doesn't check that the generated sources compile properly, or that they even work as expected. See the following external/qemu patch to call run-tests.sh during each android-rebuild.sh run: https://android-review.googlesource.com/112541 Change-Id: I9abc3f9ae63b0bb753f0f8e07c1b3f0b11a3252f (cherry picked from commit 6d4468efe84bf50fb8e43aab011059fb7d019c1b)
| * Properly handle shader program deletionbohu2014-11-183-1/+42
| | | | | | | | | | | | | | | | | | When deleting a program that is still in use, its delete status should set to true and the actual deletion should happen later when the program is not in use. Change-Id: I821312997d372ed4773033ba373a8c792f6d7ba9 (cherry picked from commit 9b3c3647baf41e15cf9564df4b974162a7135873)
| * Properly handle shader deletionbohu2014-11-183-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | When deleting a shader that is still attached to program, it should not be deleted immediately. Instead, it should be marked for deletion. When a program is deleted, its shaders should be detached. When a shader is detached, it should be deleted if it is marked for deletion. Change-Id: I481dbfe37e3ad4af454574b75d157bdfeb1c9cdd (cherry picked from commit bc42a0598f6e5ffb0ebd646e0bad8d94c50ec193)
| * handles glGetFloatv with GL_STENCIL_VALUE_MASK etcbohu2014-11-181-0/+14
| | | | | | | | | | | | | | | | | | For GL_STENCIL_VALUE_MASK and the like, glGetFloatv returns -1 and this is incorrect, according to GLES 2 spec. This commit does proper casts to get sensible value. Change-Id: I9c07ddf812458bd2d374189c0c4263c44de0d6da (cherry picked from commit 92ebbc674404fd90aba4df68216e1f103456c7fc)
* | emulator/opengl: Remove obsolete directory.David 'Digit' Turner2014-12-08260-43724/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | All sources were moved to external/qemu/distrib/android-emugl to make it easier to modify both the emulator and host libraries at the same time. See: https://android-review.googlesource.com/#/c/118203/ As such, the sources in this directory are now ignored and can be safely removed. Change-Id: I5d143c971f995e2599e5e1d6174030d6803e8080
* | emulator/opengl: Fix Windows cross-build.David 'Digit' Turner2014-12-011-1/+1
| | | | | | | | | | | | | | | | When building the host version of the gtest library, always include -lpthread as part of LOCAL_LDLIBS, otherwise the build will fail when cross-compiling for Windows on Linux. Change-Id: I8614f9e6d543dbba910b9495d6c1bd59e7c61004
* | emulator/opengl: Fix pixelDataSize() ambiguity.David 'Digit' Turner2014-11-282-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this fix, the GLESv1 encoder library will link to the pixelDataSize() function that is defined in the GLESv2 encoder library, which results in bugs, like the boot animation now showing with -gpu on. This patch doesn't change the generated decoder libraries, nor does it affect the encoder ones until external/qemu/distrib/update-emugl-sources.sh is called. When the latter script will be run, other changes under device/generic/goldfish/generic/ will be needed to fix the namespace of the functions being defined in GLEncoderUtils.cpp and GL2EncoderUtils.cpp Change-Id: I588659461dd6d73350d150a896494ccf50fbdc7f
* | emulator/opengl: Update declarations to fix const issue.David 'Digit' Turner2014-11-286-8/+10
| | | | | | | | | | | | | | | | | | | | This patch modifies a few GLESv1 and GLESv2 function declaration to use the correct constness for the parameters of a few functions. This fixes build breaks when the generated encoders are used with recent Khronos headers. Change-Id: I582d5ab6d85fd18e6d6dce27b9a08f38b026f916
* | emulator/opengl/emugen: Fix type parsing.David 'Digit' Turner2014-11-2826-93/+493
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the parsing of type declarations and parameter declarations to: - Properly recognize complicated types like 'const int* const*' which previously required omitting spaces (e.g. 'const int*const*') to be recognized by the parser. - Normalize the type strings (e.g. 'const char **items' -> 'const char** items') - Add a unit test program (emugen_unittests) to check emugen's internal functions. For now this only applies to the new functions introduced in the new header Parser.h + Update emugen test suite accordingly. Change-Id: Ib1b6bcbae97e1ee7d8b272843dfb5926d2d98fd2
* | Merge "handles glGetFloatv with GL_STENCIL_VALUE_MASK etc"bohu2014-11-181-0/+14
|\ \
| * | handles glGetFloatv with GL_STENCIL_VALUE_MASK etcbohu2014-11-171-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | For GL_STENCIL_VALUE_MASK and the like, glGetFloatv returns -1 and this is incorrect, according to GLES 2 spec. This commit does proper casts to get sensible value. Change-Id: I9c07ddf812458bd2d374189c0c4263c44de0d6da
* | | Merge "Properly handle shader program deletion"bohu2014-11-183-1/+42
|\ \ \ | |/ / |/| |
| * | Properly handle shader program deletionbohu2014-11-063-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | When deleting a program that is still in use, its delete status should set to true and the actual deletion should happen later when the program is not in use. Change-Id: I821312997d372ed4773033ba373a8c792f6d7ba9
* | | Merge "Correctly set error code"bohu2014-11-172-4/+28
|\ \ \
| * | | Correctly set error codebohu2014-11-062-4/+28
| |/ / | | | | | | | | | | | | | | | Fixed a few error codes to be more accurate Change-Id: Ifad6bf51c399215a9110bd40cfd380309ac6422c
* | | Merge "Build and package 32/64bit find_java." into studio-1.0-dev automerge: ↵Xavier Ducrohet2014-11-141-2/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 7e91a74 automerge: 7ffcc2b * commit '7ffcc2bd1248a25c221e3f2957cc54678e0473b9': Build and package 32/64bit find_java.
| * | Merge "Build and package 32/64bit find_java." into studio-1.0-devXavier Ducrohet2014-11-141-2/+2
| |\ \ | | |/ | | | | | | | | | | | | | | | automerge: 7e91a74 * commit '7e91a740cb092a020c1bb6e99982e162741ffd61': Build and package 32/64bit find_java.
| | * Build and package 32/64bit find_java.Xavier Ducrohet2014-11-071-2/+2
| | | | | | | | | | | | Change-Id: I93a2e42fb0a81d1495bb12b657b6bd6a597a128e
| * | Merge "Handle empty data parameter in glTexSubImage2D" into studio-1.0-devVince Harron2014-10-301-1/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | automerge: d5b5fdb * commit 'd5b5fdb5bb3635bab96be2b9aef1b1da2e96d564': Handle empty data parameter in glTexSubImage2D
| | * Handle empty data parameter in glTexSubImage2Dbohu2014-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This commit handles empty data parameter in decoder side to avoid crashing emultor. Change-Id: I1605c328506d1fa1506023ca7b261d210b944d12 (cherry picked from commit f68413b2dbf5a73643195589b3fb5c10886a150e)
| * | Merge "Handle empty length parameter on decoder side" into studio-1.0-devVince Harron2014-10-301-0/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | automerge: 75c9edb * commit '75c9edb0abb98eee51cdf972287fe405662a9c19': Handle empty length parameter on decoder side
| | * Handle empty length parameter on decoder sidebohu2014-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | OpenGL standard allows empty length parameter and we should handle it properly to avoid crashing emulator. Change-Id: I3bd5da19461da0c1f84138a197ae770091458b57 (cherry picked from commit f3e18524d036044e416647bb0a86ecaa270b3494)
| * | Merge "Properly reset source code buffer" into studio-1.0-devVince Harron2014-10-301-0/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | automerge: a829d50 * commit 'a829d501fa16bdbdcfb85dfcff88c37dbcfac956': Properly reset source code buffer
| | * Properly reset source code bufferbohu2014-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit clears m_src of ShaderParser in setSrc() method before reading new shader source code so that any previous source code won't be prefixed to new shader source code. Change-Id: Iacc98b32aea380d1e4503c37b86f5db55263e667 (cherry picked from commit ba8d8fef8f76d86f90f5cc7774e1e0f4fb507b86)
* | | Merge "Properly handle shader deletion"bohu2014-11-063-3/+61
|\ \ \