summaryrefslogtreecommitdiff
path: root/trace_parser.hpp
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-11-20 11:22:25 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-11-20 11:22:25 +0000
commit885f265065244d05fd158d71d27b6fbaba5a2212 (patch)
tree07520f14756c1168915604e5071ea84482ae50b7 /trace_parser.hpp
parentc9edb83044ae17a35c42c10504ffffd0f12f3598 (diff)
Support glTexImage through blobs.
Diffstat (limited to 'trace_parser.hpp')
-rw-r--r--trace_parser.hpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/trace_parser.hpp b/trace_parser.hpp
index 221957b..674ee8e 100644
--- a/trace_parser.hpp
+++ b/trace_parser.hpp
@@ -89,8 +89,8 @@ public:
call.ret = parse_value();
break;
default:
- assert(0);
std::cerr << "error: unknown call detail " << c << "\n";
+ assert(0);
break;
}
} while(true);
@@ -129,6 +129,8 @@ public:
return parse_bitmask();
case Trace::TYPE_ARRAY:
return parse_array();
+ case Trace::TYPE_BLOB:
+ return parse_blob();
case Trace::TYPE_POINTER:
return parse_pointer();
case Trace::TYPE_VOID:
@@ -203,7 +205,7 @@ done:
return new UInt(value);
}
- Value *parse_array() {
+ Value *parse_array(void) {
size_t len = read_uint();
Array *array = new Array(len);
for (size_t i = 0; i < len; ++i) {
@@ -212,6 +214,15 @@ done:
return array;
}
+ Value *parse_blob(void) {
+ size_t size = read_uint();
+ Blob *blob = new Blob(size);
+ if (size) {
+ gzread(file, blob->buf, size);
+ }
+ return blob;
+ }
+
Value *parse_pointer() {
unsigned long long addr;
Value *value;