GLES2Dbg: improve protocol and error check after shader upload

Change-Id: I0bd3867e0532e1c64c62db816be31ba0102c7e49
Signed-off-by: David Li <davidxli@google.com>
This commit is contained in:
David Li
2011-03-28 10:24:07 -07:00
parent a60b6e69bf
commit 9c4ef35e35
5 changed files with 253 additions and 157 deletions

View File

@@ -61,10 +61,10 @@ public class MessageFormatter {
static String FormatFloats(int count, final ByteBuffer data) {
if (data.remaining() == 0)
return "[null]";
data.order(SampleView.targetByteOrder);
String ret = "[";
for (int i = 0; i < count; i++)
{
ret += Float.intBitsToFloat(Integer.reverseBytes(data.getInt()));
for (int i = 0; i < count; i++) {
ret += Float.intBitsToFloat(data.getInt());
if (i < count - 1)
ret += ", ";
}
@@ -74,10 +74,10 @@ public class MessageFormatter {
static String FormatInts(int count, final ByteBuffer data) {
if (data.remaining() == 0)
return "[null]";
data.order(SampleView.targetByteOrder);
String ret = "[";
for (int i = 0; i < count; i++)
{
ret += Integer.reverseBytes(data.getInt());
for (int i = 0; i < count; i++) {
ret += data.getInt();
if (i < count - 1)
ret += ", ";
}
@@ -87,10 +87,10 @@ public class MessageFormatter {
static String FormatUints(int count, final ByteBuffer data) {
if (data.remaining() == 0)
return "[null]";
data.order(SampleView.targetByteOrder);
String ret = "[";
for (int i = 0; i < count; i++)
{
long bits = Integer.reverseBytes(data.getInt()) & 0xffffffff;
for (int i = 0; i < count; i++) {
long bits = data.getInt() & 0xffffffff;
ret += bits;
if (i < count - 1)
ret += ", ";
@@ -101,10 +101,10 @@ public class MessageFormatter {
static String FormatMatrix(int columns, int count, final ByteBuffer data) {
if (data.remaining() == 0)
return "[null]";
data.order(SampleView.targetByteOrder);
String ret = "[";
for (int i = 0; i < count; i++)
{
ret += Float.intBitsToFloat(Integer.reverseBytes(data.getInt()));
for (int i = 0; i < count; i++) {
ret += Float.intBitsToFloat(data.getInt());
if (i % columns == columns - 1)
ret += "\\n ";
else if (i < count - 1)