summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles30/DebugGLES30.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/opengles30/DebugGLES30.cpp
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/opengles30/DebugGLES30.cpp')
-rw-r--r--Runtime/GfxDevice/opengles30/DebugGLES30.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengles30/DebugGLES30.cpp b/Runtime/GfxDevice/opengles30/DebugGLES30.cpp
new file mode 100644
index 0000000..af5efad
--- /dev/null
+++ b/Runtime/GfxDevice/opengles30/DebugGLES30.cpp
@@ -0,0 +1,38 @@
+#include "UnityPrefix.h"
+#include "IncludesGLES30.h"
+#include "DebugGLES30.h"
+#include "AssertGLES30.h"
+
+
+void DumpVertexArrayStateGLES30()
+{
+#if GFX_SUPPORTS_OPENGLES30
+ GLint maxVertexAttribs = 0;
+ GLES_CHK(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs));
+
+ GLint vbo = 0;
+ GLint ibo = 0;
+ GLES_CHK(glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &vbo));
+ GLES_CHK(glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &ibo));
+
+ printf_console("---> VertexArray State: vbo:%d ibo:%d\n", vbo, ibo);
+
+ for (int q = 0; q < maxVertexAttribs; ++q)
+ {
+ int enabled, size, stride, normalized, type, vbo;
+ GLES_CHK(glGetVertexAttribiv(q, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &enabled));
+ GLES_CHK(glGetVertexAttribiv(q, GL_VERTEX_ATTRIB_ARRAY_SIZE, &size));
+ GLES_CHK(glGetVertexAttribiv(q, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &stride));
+ GLES_CHK(glGetVertexAttribiv(q, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &normalized));
+ GLES_CHK(glGetVertexAttribiv(q, GL_VERTEX_ATTRIB_ARRAY_TYPE, &type));
+ GLES_CHK(glGetVertexAttribiv(q, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, &vbo));
+
+ GLvoid* ptr;
+ GLES_CHK(glGetVertexAttribPointerv(q, GL_VERTEX_ATTRIB_ARRAY_POINTER, &ptr));
+
+ printf_console(" attr[%d] --- %s type:%d size:%d stride:%d norm:%d vbo:%d, %p\n",
+ q, enabled? "On ": "Off",
+ type, size, stride, normalized, vbo, ptr);
+ }
+#endif
+}