<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sdk/emulator/opengl/host/tools/emugen, branch replicant-6.0</title>
<subtitle>sdk
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/'/>
<entry>
<title>emulator/opengl: Remove obsolete directory.</title>
<updated>2014-12-08T08:27:26+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-12-07T13:24:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=e8d37d5d88fa24a66ea8467e9b87a665b5e56992'/>
<id>e8d37d5d88fa24a66ea8467e9b87a665b5e56992</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Fix type parsing.</title>
<updated>2014-11-28T09:58:38+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-11-27T15:54:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=8c107b481a05f11f32fca6a5797fda637860ad4c'/>
<id>8c107b481a05f11f32fca6a5797fda637860ad4c</id>
<content type='text'>
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' -&gt; '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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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' -&gt; '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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Add new 'flushOnEncode' entry point flag.</title>
<updated>2014-10-31T10:16:11+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-10-31T10:16:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=c4f3b66839698174b9f86c92b0a8efae5c80d415'/>
<id>c4f3b66839698174b9f86c92b0a8efae5c80d415</id>
<content type='text'>
This adds a new flag that can be applied to entry points for 'emugen',
named 'flushOnEncode'. When used, the generated encoder will call
stream-&gt;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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a new flag that can be applied to entry points for 'emugen',
named 'flushOnEncode'. When used, the generated encoder will call
stream-&gt;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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl: Remove compiler warnings.</title>
<updated>2014-10-30T20:37:31+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-10-30T14:35:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=ad887fb072b747c6da73e676c3720f95fc688f3b'/>
<id>ad887fb072b747c6da73e676c3720f95fc688f3b</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Small cleanup of autogenerated sources.</title>
<updated>2014-10-30T20:36:55+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-10-30T14:21:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=4631f988e530be4d11daf0fa03e8ab47e0bfbcae'/>
<id>4631f988e530be4d11daf0fa03e8ab47e0bfbcae</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl: Add emugen test suite.</title>
<updated>2014-10-30T14:39:18+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-10-30T14:09:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=6d4468efe84bf50fb8e43aab011059fb7d019c1b'/>
<id>6d4468efe84bf50fb8e43aab011059fb7d019c1b</id>
<content type='text'>
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=&lt;program&gt; 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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=&lt;program&gt; 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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Use local variables for parameters.</title>
<updated>2014-09-25T22:44:11+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-09-25T21:09:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=ebef20fc443650603ac91735595549bba8f47f44'/>
<id>ebef20fc443650603ac91735595549bba8f47f44</id>
<content type='text'>
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_&lt;name&gt;", where &lt;name&gt; is the parameter name as
    it appears in the protocol specification for the entry.

  - for input pointers, use "inptr_&lt;name&gt;", as well as
    "size_&lt;name&gt;" for the corresponding size in bytes.

  - for output pointers, use "outptr_&lt;name&gt;" and "size_&lt;name&gt;"

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&lt;GLuint,uint32_t&gt;(ptr + 8), Unpack&lt;GLuint,uint32_t&gt;(ptr + 8 + 4), (const GLchar*)(tmpPtr2.get()), (uint32_t)tmpPtr2Size);
		this-&gt;glBindAttribLocation(Unpack&lt;GLuint,uint32_t&gt;(ptr + 8), Unpack&lt;GLuint,uint32_t&gt;(ptr + 8 + 4), (const GLchar*)(tmpPtr2.get()));
		SET_LASTCALL("glBindAttribLocation");
		break;
	}

becomes:

	case OP_glBindAttribLocation: {
		GLuint var_program = Unpack&lt;GLuint,uint32_t&gt;(ptr + 8);
		GLuint var_index = Unpack&lt;GLuint,uint32_t&gt;(ptr + 8 + 4);
		uint32_t size_name = Unpack&lt;uint32_t,uint32_t&gt;(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-&gt;glBindAttribLocation(var_program, var_index, (const GLchar*)(inptr_name.get()));
		SET_LASTCALL("glBindAttribLocation");
		break;
	}

Change-Id: Ifa8c73eec85b818d6d8b6371587da9fdfa57de8e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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_&lt;name&gt;", where &lt;name&gt; is the parameter name as
    it appears in the protocol specification for the entry.

  - for input pointers, use "inptr_&lt;name&gt;", as well as
    "size_&lt;name&gt;" for the corresponding size in bytes.

  - for output pointers, use "outptr_&lt;name&gt;" and "size_&lt;name&gt;"

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&lt;GLuint,uint32_t&gt;(ptr + 8), Unpack&lt;GLuint,uint32_t&gt;(ptr + 8 + 4), (const GLchar*)(tmpPtr2.get()), (uint32_t)tmpPtr2Size);
		this-&gt;glBindAttribLocation(Unpack&lt;GLuint,uint32_t&gt;(ptr + 8), Unpack&lt;GLuint,uint32_t&gt;(ptr + 8 + 4), (const GLchar*)(tmpPtr2.get()));
		SET_LASTCALL("glBindAttribLocation");
		break;
	}

becomes:

	case OP_glBindAttribLocation: {
		GLuint var_program = Unpack&lt;GLuint,uint32_t&gt;(ptr + 8);
		GLuint var_index = Unpack&lt;GLuint,uint32_t&gt;(ptr + 8 + 4);
		uint32_t size_name = Unpack&lt;uint32_t,uint32_t&gt;(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-&gt;glBindAttribLocation(var_program, var_index, (const GLchar*)(inptr_name.get()));
		SET_LASTCALL("glBindAttribLocation");
		break;
	}

Change-Id: Ifa8c73eec85b818d6d8b6371587da9fdfa57de8e
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Move pointer increment out of case statements.</title>
<updated>2014-09-25T22:44:11+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-09-25T19:56:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=e3823f90ffd60a4b1692f799e31eaccff77bf08d'/>
<id>e3823f90ffd60a4b1692f799e31eaccff77bf08d</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Introduce helper macros.</title>
<updated>2014-09-25T22:44:10+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-09-25T19:47:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=9319d29db93b728947a32d30a1b109d237130ffd'/>
<id>9319d29db93b728947a32d30a1b109d237130ffd</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>emulator/opengl/emugen: Remove accessor functions.</title>
<updated>2014-09-25T22:44:10+00:00</updated>
<author>
<name>David 'Digit' Turner</name>
<email>digit@google.com</email>
</author>
<published>2014-09-25T18:53:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/sdk/commit/?id=e3803760bc279db27e997b17a0941c34a7d61b5a'/>
<id>e3803760bc279db27e997b17a0941c34a7d61b5a</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
</feed>
