[Piglit] [PATCH 2/3] piglit util: add piglit_link_simple_gs_program

Brian Paul brianp at vmware.com
Sat Apr 20 09:30:39 PDT 2013


On 04/19/2013 06:09 PM, Jordan Justen wrote:
> Signed-off-by: Jordan Justen<jordan.l.justen at intel.com>
> ---
>   tests/util/piglit-shader.c |   23 +++++++++++++++++++++++
>   tests/util/piglit-shader.h |    1 +
>   2 files changed, 24 insertions(+)
>
> diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
> index c67e58a..4bad739 100644
> --- a/tests/util/piglit-shader.c
> +++ b/tests/util/piglit-shader.c
> @@ -235,6 +235,29 @@ piglit_link_check_status_quiet(GLint prog)
>   }
>
>
> +GLint piglit_link_simple_gs_program(GLint vs, GLint gs, GLint fs)
> +{
> +	GLint prog;
> +
> +	piglit_require_GLSL();
> +
> +	prog = glCreateProgram();
> +	if (vs)
> +		glAttachShader(prog, vs);
> +	if (gs)
> +		glAttachShader(prog, gs);
> +	if (fs)
> +		glAttachShader(prog, fs);
> +	glLinkProgram(prog);
> +
> +	if (!piglit_link_check_status(prog)) {
> +		glDeleteProgram(prog);
> +		prog = 0;
> +	}
> +
> +	return prog;
> +}

Since GL program/shader IDs are all GLuint, shouldn't all the GLint 
above be GLuint?

I guess the existing piglit_link_simple_program() has that issue already.

Also, I think you could re-implement piglit_link_simple_program() in 
terms of piglit_link_simple_gs_program(gs=0).

Looks fine otherwise.

Reviewed-by: Brian Paul <brianp at vmware.com>


> +
>   GLint piglit_link_simple_program(GLint vs, GLint fs)
>   {
>   	GLint prog;
> diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h
> index 12cf731..5cd7fba 100644
> --- a/tests/util/piglit-shader.h
> +++ b/tests/util/piglit-shader.h
> @@ -35,6 +35,7 @@ GLuint piglit_compile_shader_text(GLenum target, const char *text);
>   GLboolean piglit_link_check_status(GLint prog);
>   GLboolean piglit_link_check_status_quiet(GLint prog);
>   GLint piglit_link_simple_program(GLint vs, GLint fs);
> +GLint piglit_link_simple_gs_program(GLint vs, GLint gs, GLint fs);
>
>   #if defined(PIGLIT_USE_OPENGL_ES1)
>   #define glAttachShader assert(!"glAttachShader does not exist in ES1")



More information about the Piglit mailing list