| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: If8f42a739dce6d1ac4d737ee50c7d2d569004153
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Zero output parameters so that errors don't return random
data (even if the target code was careful to zero its output
parameters.) Spec says that we will not modify values in case of
an error, which is not currently possible, but at least this
means we return deterministic values.
* Similarly, avoid passing uninitialized data if an error occurs
during getting the viewport.
* Fix a bug where glGetError may be called when NULL is decoded in
CHECK_GL_ERROR mode.
* Output more information about the stream in DEBUG_PRINTOUT mode to
help separate from multiple streams.
Change-Id: I31706b92642efe4c7ed38d178b49e72835a9c9a6
|
|
|
|
|
|
|
|
|
|
| |
This back-ports several fixes from aosp/master branch into idea133:
145e25 Fix the Google Maps crash issue
e33909 Support GL_MAX_TEXTURE_SIZE case to glGetIntegerv API
c6dd20 Fix Mac build.
Change-Id: I26a05956c3b926dddeb638c6cff979199075ecbb
|
|\
| |
| |
| | |
x86_64-linux-glibc2.11-4.8" into idea133
|
| |
| |
| |
| |
| |
| |
| |
| | |
Unlike its 4.6 counterpart, the new
x86_64-linux-glibc2.11-4.8/x86_64-linux/include/c++/4.8/x86_64-linux/bits/gthr-default.h
(line #39) no longer unconditionally include unistd.h which provides getopt prototype
Change-Id: I53310bb0f27e6ed7b4ee732ef301c4868decccb4
|
|/
|
|
|
|
|
| |
These warnings appear when building the sources through the emulator's
standalone build system, not the platform one.
Change-Id: Ib5d51cf6211f32763be00c7436ae14c06f76b436
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the Windows SDK build. A previous patch
apparently broke it even though I could not reproduce this
locally before submitting.
What it does is, when using the platform build to generate
Windows binaries, use the host Linux binary instead of rebuilding
the 'emugen' tool from sources.
Note that the emulator's standalone build supports building
host Linux binaries even when targetting Windows by default.
+ Add a missing module import that got lost in translation
for some odd reason.
Change-Id: I2ccd962d8b3df859b2cba82573225820b69b0d32
|
|
|
|
|
|
|
|
| |
This patch improves the build files for the GPU emulation
libraries to allow them to be built directly with the emulator's
own standalone build system.
Change-Id: I205392bdfe4223a5c43fa67e24a2beffcbcbc07a
|
|
|
|
|
|
|
|
|
|
|
| |
This patch gets rid of all compiler warnings for the
GPU emulation libraries when building on a Linux host.
Note that GLcommon/GLutils.h now provides two new functions
to perform 'safe' type casts between unsigned integers and
pointers: SafePointerFromUInt() and SafeUIntFromPointer().
Change-Id: I01c48bbd72f925d70eb9831f57e15815e687121f
|
|
|
|
|
|
|
|
| |
MIPS cannot handle unaligned accesses, so this patch changes the
direct assignment of ints/floats to using memcpy
Signed-Off-By: Bhanu Chetlapalli <bhanu@mips.com>
Change-Id: I82600dece8f48f718f73b49cdf831094bbfdcde5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The emulator GLES support has two interfaces: a host shared library
interface used by QEMU, and a protocol between the platform and the
host. The host library interface is not versioned; QEMU and the GLES
renderer must match. The protocol on the other hand must be backwards
compatible: a new GLES renderer must support an older platform image.
Thus for branching purposes it makes more sense to put the GLES
renderer in sdk.git, which is branched along with qemu.git for SDK
releases. Platform images will be built against the protocol version
in the platform branch of sdk.git.
Change-Id: I2c3bce627ecfd0a4b3e688d1839fe10755a21e58
|
|
|
|
|
|
| |
This project code is moving to live under development.git/tools/emulator
Change-Id: I3f7673bc17681a0ffa14bb0b4d0880977b77f24d
|
|
Emugen is a tool that can be used to generate code that
deals with marshaling/unmarshaling request to/from a wire-protocol.
Its input is an API defintion files and its output is C++ source
code for the client (caller) and the server (callee) sides.
See README file for more details.
Change-Id: I45beea6657fae0887d2b4d92933213ecc20d2525
|