[Mesa-dev] [RFC PATCH 06/56] mesa/program: Add tessellation shader init functions.

Chris Forbes chrisf at ijw.co.nz
Sat Sep 20 18:40:46 PDT 2014


From: Fabian Bieler <fabianbieler at fastmail.fm>

V2 [Chris]: Fix rebase issues; helper previously used here no longer
exists.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/program/program.c | 32 ++++++++++++++++++++++++++++++++
 src/mesa/program/program.h | 10 ++++++++++
 2 files changed, 42 insertions(+)

diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 6e17fe6..dc030b0 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -294,6 +294,38 @@ _mesa_init_compute_program(struct gl_context *ctx,
 
 
 /**
+ * Initialize a new tessellation control program object.
+ */
+struct gl_program *
+_mesa_init_tess_ctrl_program(struct gl_context *ctx,
+                             struct gl_tess_ctrl_program *prog,
+                             GLenum target, GLuint id)
+{
+   if (prog) {
+      init_program_struct(&prog->Base, target, id);
+      return &prog->Base;
+   }
+   return NULL;
+}
+
+
+/**
+ * Initialize a new tessellation evaluation program object.
+ */
+struct gl_program *
+_mesa_init_tess_eval_program(struct gl_context *ctx,
+                             struct gl_tess_eval_program *prog,
+                             GLenum target, GLuint id)
+{
+   if (prog) {
+      init_program_struct(&prog->Base, target, id);
+      return &prog->Base;
+   }
+   return NULL;
+}
+
+
+/**
  * Initialize a new geometry program object.
  */
 struct gl_program *
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index 9324394..dd5198a 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -79,6 +79,16 @@ _mesa_init_fragment_program(struct gl_context *ctx,
                             GLenum target, GLuint id);
 
 extern struct gl_program *
+_mesa_init_tess_ctrl_program(struct gl_context *ctx,
+                            struct gl_tess_ctrl_program *prog,
+                            GLenum target, GLuint id);
+
+extern struct gl_program *
+_mesa_init_tess_eval_program(struct gl_context *ctx,
+                            struct gl_tess_eval_program *prog,
+                            GLenum target, GLuint id);
+
+extern struct gl_program *
 _mesa_init_geometry_program(struct gl_context *ctx,
                             struct gl_geometry_program *prog,
                             GLenum target, GLuint id);
-- 
2.1.0



More information about the mesa-dev mailing list