summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorSiva Velusamy <vsiva@google.com>2012-02-27 07:41:38 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-27 07:41:38 -0800
commit0a66900ee5093afa12a5786c4b9dc0e58991f426 (patch)
treeb6f554da62152b1b335a9a393a0afcb98a497bb1 /opengl
parent40ba9cddea1cfdeaf966e463fdb2ff3b37d87ed7 (diff)
parent8293c92c751f15614b1c72e92becba6097e053c0 (diff)
downloadframeworks_base-0a66900ee5093afa12a5786c4b9dc0e58991f426.zip
frameworks_base-0a66900ee5093afa12a5786c4b9dc0e58991f426.tar.gz
frameworks_base-0a66900ee5093afa12a5786c4b9dc0e58991f426.tar.bz2
Merge "gltrace: attach buffer data sent with glBufferData"
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/GLES_trace/src/gltrace_fixup.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
index 6c4feb5..a043929 100644
--- a/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
+++ b/opengl/libs/GLES_trace/src/gltrace_fixup.cpp
@@ -237,6 +237,26 @@ void fixup_glUniformMatrixGeneric(int matrixSize, GLMessage *glmsg) {
fixup_glUniformGeneric(3, matrixSize * matrixSize * n_matrices, glmsg);
}
+void fixup_glBufferData(int sizeIndex, int dataIndex, GLMessage *glmsg) {
+ /* void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) */
+ /* void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) */
+ GLsizeiptr size = glmsg->args(sizeIndex).intvalue(0);
+
+ GLMessage_DataType *arg_datap = glmsg->mutable_args(dataIndex);
+ GLvoid *datap = (GLvoid *)arg_datap->intvalue(0);
+
+ if (datap == NULL) {
+ // glBufferData can be called with a NULL data pointer
+ return;
+ }
+
+ arg_datap->set_type(GLMessage::DataType::VOID);
+ arg_datap->set_isarray(true);
+ arg_datap->clear_intvalue();
+
+ arg_datap->add_rawbytes(datap, size);
+}
+
void fixup_GenericIntArray(int argIndex, int nInts, GLMessage *glmsg) {
GLMessage_DataType *arg_intarray = glmsg->mutable_args(argIndex);
GLint *intp = (GLint *)arg_intarray->intvalue(0);
@@ -503,6 +523,14 @@ void fixupGLMessage(GLTraceContext *context, nsecs_t wallStart, nsecs_t wallEnd,
const GLfloat* value) */
fixup_glUniformMatrixGeneric(4, glmsg);
break;
+ case GLMessage::glBufferData:
+ /* void glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) */
+ fixup_glBufferData(1, 2, glmsg);
+ break;
+ case GLMessage::glBufferSubData:
+ /* void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) */
+ fixup_glBufferData(2, 3, glmsg);
+ break;
case GLMessage::glDrawArrays:
/* void glDrawArrays(GLenum mode, GLint first, GLsizei count) */
if (context->getGlobalTraceState()->shouldCollectFbOnGlDraw()) {