Demos (master): glxinfo: Print geometry shader limits for OpenGL 3.2+ contexts
Ian Romanick
idr at kemper.freedesktop.org
Wed Jan 29 16:33:43 UTC 2014
Module: Demos
Branch: master
Commit: dea0db4b713eb7f9836f37b963419bd6ee5938d8
URL: http://cgit.freedesktop.org/mesa/demos/commit/?id=dea0db4b713eb7f9836f37b963419bd6ee5938d8
Author: Ian Romanick <ian.d.romanick at intel.com>
Date: Sun Jan 26 21:47:34 2014 -0700
glxinfo: Print geometry shader limits for OpenGL 3.2+ contexts
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/xdemos/glxinfo.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/xdemos/glxinfo.c b/src/xdemos/glxinfo.c
index e5b5b5b..0a3f882 100644
--- a/src/xdemos/glxinfo.c
+++ b/src/xdemos/glxinfo.c
@@ -134,6 +134,12 @@ static const struct { int major, minor; } gl_versions[] = {
#define NUM_GL_VERSIONS ELEMENTS(gl_versions)
+/**
+ * Version of the context that was created
+ *
+ * 20, 21, 30, 31, 32, etc.
+ */
+static int version;
/**
* GL Error checking/warning.
@@ -547,6 +553,15 @@ print_shader_limits(GLenum target)
{ GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
{ (GLenum) 0, NULL }
};
+ static const struct token_name geometry_limits[] = {
+ { GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS" },
+ { GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS" },
+ { GL_MAX_GEOMETRY_OUTPUT_VERTICES , "GL_MAX_GEOMETRY_OUTPUT_VERTICES " },
+ { GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS" },
+ { GL_MAX_GEOMETRY_INPUT_COMPONENTS , "GL_MAX_GEOMETRY_INPUT_COMPONENTS " },
+ { GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS" },
+ { (GLenum) 0, NULL }
+ };
switch (target) {
case GL_VERTEX_SHADER:
@@ -558,6 +573,11 @@ print_shader_limits(GLenum target)
printf(" GL_FRAGMENT_SHADER_ARB:\n");
print_shader_limit_list(fragment_limits);
break;
+
+ case GL_GEOMETRY_SHADER:
+ printf(" GL_GEOMETRY_SHADER:\n");
+ print_shader_limit_list(geometry_limits);
+ break;
}
}
@@ -690,6 +710,9 @@ print_limits(const char *extensions, const char *oglstring)
if (extension_supported("GL_ARB_fragment_shader", extensions)) {
print_shader_limits(GL_FRAGMENT_SHADER_ARB);
}
+ if (version >= 32) {
+ print_shader_limits(GL_GEOMETRY_SHADER);
+ }
}
@@ -1057,7 +1080,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect,
int glxVersionMinor;
char *displayName = NULL;
char *colon = NULL, *period = NULL;
- int version; /* 20, 21, 30, 31, 32, etc */
CheckError(__LINE__);
/* Get list of GL extensions */
More information about the mesa-commit
mailing list