[Mesa-dev] [PATCH 1/4] glxinfo/wglinfo: remove print_shader_limits() code
Emil Velikov
emil.l.velikov at gmail.com
Tue Mar 6 16:09:00 UTC 2018
On 5 March 2018 at 16:53, Brian Paul <brianp at vmware.com> wrote:
> And add queries of GL 2.0 limits. All the VS, FS, GS limits which were
> reported with print_shader_limits() are also covered by the GL 2.0 and
> 3.2 queries.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105285
> ---
> src/xdemos/glinfo_common.c | 89 ++++++----------------------------------------
> 1 file changed, 11 insertions(+), 78 deletions(-)
>
> diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
> index 3668026..7ffbeac 100644
> --- a/src/xdemos/glinfo_common.c
> +++ b/src/xdemos/glinfo_common.c
> @@ -378,74 +378,6 @@ struct token_name
> };
>
>
> -static void
> -print_shader_limit_list(const struct token_name *lim)
> -{
> - GLint max[1];
> - unsigned i;
> -
> - for (i = 0; lim[i].token; i++) {
> - glGetIntegerv(lim[i].token, max);
> - if (glGetError() == GL_NO_ERROR) {
> - printf(" %s = %d\n", lim[i].name, max[0]);
> - }
> - }
> -}
> -
> -
> -/**
> - * Print interesting limits for vertex/fragment shaders.
> - */
> -static void
> -print_shader_limits(GLenum target)
> -{
> - static const struct token_name vertex_limits[] = {
> - { GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB" },
> - { GL_MAX_VARYING_FLOATS_ARB, "GL_MAX_VARYING_FLOATS_ARB" },
> - { GL_MAX_VERTEX_ATTRIBS_ARB, "GL_MAX_VERTEX_ATTRIBS_ARB" },
> - { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
> - { GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" },
> - { GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" },
> - { GL_MAX_TEXTURE_COORDS_ARB, "GL_MAX_TEXTURE_COORDS_ARB" },
> - { GL_MAX_VERTEX_OUTPUT_COMPONENTS , "GL_MAX_VERTEX_OUTPUT_COMPONENTS " },
> - { (GLenum) 0, NULL }
> - };
> - static const struct token_name fragment_limits[] = {
> - { GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" },
> - { GL_MAX_TEXTURE_COORDS_ARB, "GL_MAX_TEXTURE_COORDS_ARB" },
> - { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
> - { GL_MAX_FRAGMENT_INPUT_COMPONENTS , "GL_MAX_FRAGMENT_INPUT_COMPONENTS " },
> - { (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:
> - printf(" GL_VERTEX_SHADER_ARB:\n");
> - print_shader_limit_list(vertex_limits);
> - break;
> -
> - case GL_FRAGMENT_SHADER:
> - 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;
> - }
> -}
> -
> -
> /**
> * Print interesting limits for vertex/fragment programs.
> */
> @@ -627,7 +559,17 @@ print_limits(const char *extensions, const char *oglstring, int version,
> { 1, GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS, "GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS", "GL_ARB_tessellation_shader" },
> { 1, GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS, "GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS", "GL_ARB_tessellation_shader" },
> #endif
> -
> +#if defined(GL_VERSION_2_0)
Normally we'd want this and other similar guards removed, with local
fall-back definitions when applicable.
As-is the old build server will produce glxinfo w/o support for
feature X and at runtime user will not see X even when the driver
supports it.
Not an actual issue with these, so meh ;-)
-Emil
More information about the mesa-dev
mailing list