GLES2Dbg: reconstruct vertex attributes to match indices

Rather than converting glDrawElements into glDrawArrays and
 uploading all attributes each draw call.
Also added CaptureDraw and CaptureSwap options.

Change-Id: If8ac6556a2674868ce83f074ce4068a6af2d3a0e
Signed-off-by: David Li <davidxli@google.com>
This commit is contained in:
David Li
2011-04-13 16:16:38 -07:00
parent 7befbd7dee
commit 5d916dff8b
11 changed files with 638 additions and 309 deletions

View File

@@ -81,25 +81,31 @@ public abstract class MessageParser {
ByteString ParseFloats(int count) {
ByteBuffer buffer = ByteBuffer.allocate(count * 4);
buffer.order(SampleView.targetByteOrder);
String [] arg = GetList();
for (int i = 0; i < count; i++)
buffer.putFloat(Float.parseFloat(arg[i].trim()));
buffer.rewind();
return ByteString.copyFrom(buffer);
}
ByteString ParseInts(int count) {
ByteBuffer buffer = ByteBuffer.allocate(count * 4);
buffer.order(SampleView.targetByteOrder);
String [] arg = GetList();
for (int i = 0; i < count; i++)
buffer.putInt(Integer.parseInt(arg[i].trim()));
buffer.rewind();
return ByteString.copyFrom(buffer);
}
ByteString ParseUInts(int count) {
ByteBuffer buffer = ByteBuffer.allocate(count * 4);
buffer.order(SampleView.targetByteOrder);
String [] arg = GetList();
for (int i = 0; i < count; i++)
buffer.putInt((int)(Long.parseLong(arg[i].trim()) & 0xffffffff));
buffer.rewind();
return ByteString.copyFrom(buffer);
}