mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Add a function to dump the info for all attribute arrays.
This commit is contained in:
parent
411ab8f359
commit
4e7af5c3e0
2 changed files with 36 additions and 0 deletions
|
@ -43,5 +43,6 @@ void GL_EndRendering (void);
|
|||
int GL_CompileShader (const char *name, const char *shader_src, int type);
|
||||
int GL_LinkProgram (const char *name, int vert, int frag);
|
||||
int GL_ResolveShaderParam (int program, shaderparam_t *param);
|
||||
void GL_DumpAttribArrays (void);
|
||||
|
||||
#endif // __QF_GLSL_vid_h
|
||||
|
|
|
@ -336,3 +336,38 @@ GL_ResolveShaderParam (int program, shaderparam_t *param)
|
|||
}
|
||||
return param->location;
|
||||
}
|
||||
|
||||
void
|
||||
GL_DumpAttribArrays (void)
|
||||
{
|
||||
GLint max = 0;
|
||||
GLint ind;
|
||||
GLint enabled;
|
||||
GLint size = -1;
|
||||
GLint stride = -1;
|
||||
GLint type = -1;
|
||||
GLint norm = -1;
|
||||
GLint binding = -1;
|
||||
GLint current = -1;
|
||||
void *pointer = 0;
|
||||
|
||||
qfglGetIntegerv (GL_MAX_VERTEX_ATTRIBS, &max);
|
||||
|
||||
for (ind = 0; ind < max; ind++) {
|
||||
qfglGetVertexAttribiv (ind, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &enabled);
|
||||
if (!enabled)
|
||||
continue;
|
||||
Sys_Printf ("attrib %d: %sabled\n", ind, enabled ? "en" : "dis");
|
||||
qfglGetVertexAttribiv (ind, GL_VERTEX_ATTRIB_ARRAY_SIZE, &size);
|
||||
qfglGetVertexAttribiv (ind, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &stride);
|
||||
qfglGetVertexAttribiv (ind, GL_VERTEX_ATTRIB_ARRAY_TYPE, &type);
|
||||
qfglGetVertexAttribiv (ind, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &norm);
|
||||
qfglGetVertexAttribiv (ind, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING,
|
||||
&binding);
|
||||
qfglGetVertexAttribiv (ind, GL_CURRENT_VERTEX_ATTRIB, ¤t);
|
||||
qfglGetVertexAttribPointerv (ind, GL_VERTEX_ATTRIB_ARRAY_POINTER,
|
||||
&pointer);
|
||||
Sys_Printf (" %d %d '%s' %d %d %d %p\n", size, stride,
|
||||
type_name (type), norm, binding, current, pointer);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue