aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/program.c')
-rw-r--r--src/mesa/program/program.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index c13e61b1630..2d03bba3d12 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -286,6 +286,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 *
@@ -333,6 +365,16 @@ _mesa_new_program(struct gl_context *ctx, GLenum target, GLuint id)
CALLOC_STRUCT(gl_geometry_program),
target, id);
break;
+ case GL_TESS_CONTROL_PROGRAM_NV:
+ prog = _mesa_init_tess_ctrl_program(ctx,
+ CALLOC_STRUCT(gl_tess_ctrl_program),
+ target, id);
+ break;
+ case GL_TESS_EVALUATION_PROGRAM_NV:
+ prog = _mesa_init_tess_eval_program(ctx,
+ CALLOC_STRUCT(gl_tess_eval_program),
+ target, id);
+ break;
case GL_COMPUTE_PROGRAM_NV:
prog = _mesa_init_compute_program(ctx,
CALLOC_STRUCT(gl_compute_program),
@@ -554,6 +596,23 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
gpc->UsesStreams = gp->UsesStreams;
}
break;
+ case GL_TESS_CONTROL_PROGRAM_NV:
+ {
+ const struct gl_tess_ctrl_program *tcp = gl_tess_ctrl_program_const(prog);
+ struct gl_tess_ctrl_program *tcpc = gl_tess_ctrl_program(clone);
+ tcpc->VerticesOut = tcp->VerticesOut;
+ }
+ break;
+ case GL_TESS_EVALUATION_PROGRAM_NV:
+ {
+ const struct gl_tess_eval_program *tep = gl_tess_eval_program_const(prog);
+ struct gl_tess_eval_program *tepc = gl_tess_eval_program(clone);
+ tepc->PrimitiveMode = tep->PrimitiveMode;
+ tepc->Spacing = tep->Spacing;
+ tepc->VertexOrder = tep->VertexOrder;
+ tepc->PointMode = tep->PointMode;
+ }
+ break;
default:
_mesa_problem(NULL, "Unexpected target in _mesa_clone_program");
}