[Piglit] [PATCH 2/3] piglit util: add piglit_link_simple_gs_program
Jordan Justen
jordan.l.justen at intel.com
Fri Apr 19 17:09:55 PDT 2013
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;
+}
+
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")
--
1.7.10.4
More information about the Piglit
mailing list