[Piglit] [PATCH v2 4/5] piglit-util-gl-common: Add Function to clear extensions list.
Chad Versace
chad.versace at linux.intel.com
Tue Sep 3 11:15:34 PDT 2013
On 08/23/2013 11:51 AM, Kenney Phillis wrote:
> The default handling of the extensions does not allow for proper
> fall back of contexts to work as inteded. There is currently no
> guarantee that any implementations of OpenGL will have the pointer
> of supported extensions will remain constant after contexts change.
> ---
> tests/util/piglit-util-gl-common.c | 8 ++++++++
> tests/util/piglit-util-gl-common.h | 6 ++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
> index 7d21d18..336f0b0 100644
> --- a/tests/util/piglit-util-gl-common.c
> +++ b/tests/util/piglit-util-gl-common.c
> @@ -132,6 +132,14 @@ static void initialize_piglit_extension_support(void)
> #endif
> }
>
> +void piglit_reinitialize_extensions()
> +{
> + if (gl_extensions != NULL) {
> + free(gl_extensions);
> + gl_extensions = NULL;
> + }
> +}
> +
Let's add 'gl' to this function's name. Now that Piglit has a lot of OpenCL tests,
the function name feels ambiguous: is it reinitializing OpenGL or OpenCL extensions?
'piglit_gl_reinitialize_extensions' or 'piglit_reinitialize_gl_extensions' both look
good.
> diff --git a/tests/util/piglit-util-gl-common.h b/tests/util/piglit-util-gl-common.h
> index 41f110a..ed18a4c 100644
> --- a/tests/util/piglit-util-gl-common.h
> +++ b/tests/util/piglit-util-gl-common.h
> @@ -64,6 +64,12 @@ int piglit_get_gl_version(void);
> bool piglit_is_extension_supported(const char *name);
>
> /**
> + * reinitialize the supported extension List.
> + */
> +
> +void piglit_reinitialize_extensions();
> +
> +/**
Remove the extra newline between comment and function.
More information about the Piglit
mailing list