diff options
Diffstat (limited to 'Runtime/GfxDevice/opengles30/DebugGLES30.cpp')
-rw-r--r-- | Runtime/GfxDevice/opengles30/DebugGLES30.cpp | 38 |
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 +} |