summaryrefslogtreecommitdiffstats
path: root/progs/xdemos/glxinfo.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-03-10 15:49:30 +0100
committerMichal Krol <[email protected]>2010-03-10 15:49:30 +0100
commit3ce4375912c8ea488460e593e07c5bb15b92dca9 (patch)
tree1011fa439bd829fd46a44fd99478135848800e73 /progs/xdemos/glxinfo.c
parentf59f28093ea827bd234d8e1a36bdd56a9fce5f09 (diff)
parent9b348d0ed125a22be3f318ac60cef6f201edfdab (diff)
Merge branch 'master' into gallium-sampler-view
Conflicts: src/gallium/auxiliary/Makefile src/gallium/auxiliary/SConscript src/gallium/auxiliary/tgsi/tgsi_exec.c src/gallium/auxiliary/util/u_blitter.c src/gallium/drivers/i915/i915_context.h src/gallium/drivers/i965/brw_context.h src/gallium/drivers/llvmpipe/lp_context.h src/gallium/drivers/nv50/nv50_context.h src/gallium/drivers/nv50/nv50_state_validate.c src/gallium/drivers/nv50/nv50_tex.c src/gallium/drivers/r300/r300_blit.c src/gallium/drivers/r300/r300_context.h src/gallium/drivers/r300/r300_emit.c src/gallium/drivers/r300/r300_state.c src/gallium/drivers/softpipe/sp_context.h src/gallium/drivers/svga/svga_context.h src/gallium/drivers/svga/svga_pipe_sampler.c
Diffstat (limited to 'progs/xdemos/glxinfo.c')
-rw-r--r--progs/xdemos/glxinfo.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c
index d8710882102..332f5c2f463 100644
--- a/progs/xdemos/glxinfo.c
+++ b/progs/xdemos/glxinfo.c
@@ -171,7 +171,7 @@ print_program_limits(GLenum target)
GLenum token;
const char *name;
};
- static const struct token_name limits[] = {
+ static const struct token_name common_limits[] = {
{ GL_MAX_PROGRAM_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_INSTRUCTIONS_ARB" },
{ GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" },
{ GL_MAX_PROGRAM_TEMPORARIES_ARB, "GL_MAX_PROGRAM_TEMPORARIES_ARB" },
@@ -184,6 +184,9 @@ print_program_limits(GLenum target)
{ GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB, "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" },
{ GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB" },
{ GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB" },
+ { (GLenum) 0, NULL }
+ };
+ static const struct token_name fragment_limits[] = {
{ GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" },
{ GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" },
{ GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB" },
@@ -192,8 +195,10 @@ print_program_limits(GLenum target)
{ GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB, "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" },
{ (GLenum) 0, NULL }
};
+
PFNGLGETPROGRAMIVARBPROC GetProgramivARB_func = (PFNGLGETPROGRAMIVARBPROC)
glXGetProcAddressARB((GLubyte *) "glGetProgramivARB");
+
GLint max[1];
int i;
@@ -207,10 +212,18 @@ print_program_limits(GLenum target)
return; /* something's wrong */
}
- for (i = 0; limits[i].token; i++) {
- GetProgramivARB_func(target, limits[i].token, max);
+ for (i = 0; common_limits[i].token; i++) {
+ GetProgramivARB_func(target, common_limits[i].token, max);
if (glGetError() == GL_NO_ERROR) {
- printf(" %s = %d\n", limits[i].name, max[0]);
+ printf(" %s = %d\n", common_limits[i].name, max[0]);
+ }
+ }
+ if (target == GL_FRAGMENT_PROGRAM_ARB) {
+ for (i = 0; fragment_limits[i].token; i++) {
+ GetProgramivARB_func(target, fragment_limits[i].token, max);
+ if (glGetError() == GL_NO_ERROR) {
+ printf(" %s = %d\n", fragment_limits[i].name, max[0]);
+ }
}
}
#endif /* GL_ARB_vertex_program / GL_ARB_fragment_program */
@@ -1100,7 +1113,7 @@ usage(void)
printf("\t-display <dname>: Print GLX visuals on specified server.\n");
printf("\t-h: This information.\n");
printf("\t-i: Force an indirect rendering context.\n");
- printf("\t-b: Find the 'best' visual and print it's number.\n");
+ printf("\t-b: Find the 'best' visual and print its number.\n");
printf("\t-l: Print interesting OpenGL limits.\n");
}