[Piglit] [PATCH] Make shader_runner GL/GLSL version numbers ints.
Stuart Abercrombie
sabercrombie at chromium.org
Sat Dec 1 16:26:30 PST 2012
Anyone?
On Wed, Nov 28, 2012 at 10:07 PM, Stuart Abercrombie
<sabercrombie at chromium.org> wrote:
> Use was irregular, and this fits with the Piglit framework.
> ---
> tests/shaders/shader_runner.c | 24 ++++++++++++------------
> 1 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index ffe1a6c..c216e29 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -58,9 +58,9 @@ PIGLIT_GL_TEST_CONFIG_END
>
> extern float piglit_tolerance[4];
>
> -static unsigned gl_version = 0;
> -static unsigned glsl_version = 0;
> -static unsigned glsl_req_version = 0;
> +static int gl_version = 0;
> +static int glsl_version = 0;
> +static int glsl_req_version = 0;
> static int gl_max_fragment_uniform_components;
> static int gl_max_vertex_uniform_components;
>
> @@ -387,15 +387,15 @@ process_comparison(const char *src, enum comparison *cmp)
>
> void
> parse_version_comparison(const char *line, enum comparison *cmp,
> - unsigned *version, bool is_glsl)
> + int *version, bool is_glsl)
> {
> - unsigned major;
> - unsigned minor;
> + int major;
> + int minor;
>
> line = eat_whitespace(line);
> line = process_comparison(line, cmp);
>
> - sscanf(line, "%u.%u", &major, &minor);
> + sscanf(line, "%d.%d", &major, &minor);
>
> /* This hack is so that we can tell the difference between GL versions
> * and GLSL versions. All GL versions look like 3.2, and we want the
> @@ -492,7 +492,7 @@ process_requirement(const char *line)
> }
> } else if (string_match("GL", line)) {
> enum comparison cmp;
> - unsigned version;
> + int version;
>
> parse_version_comparison(line + 2, &cmp, &version, false);
>
> @@ -769,8 +769,8 @@ get_required_versions(const char *script_name,
> unsigned text_size;
> char *text = piglit_load_text_file(script_name, &text_size);
> const char *line = text;
> - unsigned requested_glsl_version = 110;
> - unsigned requested_gl_version = 10;
> + int requested_glsl_version = 110;
> + int requested_gl_version = 10;
> bool in_requirement_section = false;
>
>
> @@ -793,7 +793,7 @@ get_required_versions(const char *script_name,
> /* empty */
> } else if (string_match("GLSL", line)) {
> enum comparison cmp;
> - unsigned version;
> + int version;
>
> parse_version_comparison(line + 4, &cmp,
> &version, true);
> @@ -802,7 +802,7 @@ get_required_versions(const char *script_name,
>
> } else if (string_match("GL", line)) {
> enum comparison cmp;
> - unsigned version;
> + int version;
>
> parse_version_comparison(line + 2, &cmp,
> &version, false);
> --
> 1.7.5.4
>
More information about the Piglit
mailing list