mesa: added _mesa_clone_vertex/fragment_program()
authorBrian Paul <brianp@vmware.com>
Mon, 15 Feb 2010 02:09:04 +0000 (19:09 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 15 Feb 2010 04:57:14 +0000 (21:57 -0700)
To reduce casting elsewhere...

src/mesa/shader/program.h

index 0187a2c55ff7f8f6f63702d6c4c75ab31dbb9455..af9f4170d1bc18c2a9ac880776948c797447fa01 100644 (file)
@@ -108,6 +108,22 @@ _mesa_reference_fragprog(GLcontext *ctx,
 extern struct gl_program *
 _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog);
 
+static INLINE struct gl_vertex_program *
+_mesa_clone_vertex_program(GLcontext *ctx,
+                           const struct gl_vertex_program *prog)
+{
+   return (struct gl_vertex_program *) _mesa_clone_program(ctx, &prog->Base);
+}
+
+
+static INLINE struct gl_fragment_program *
+_mesa_clone_fragment_program(GLcontext *ctx,
+                             const struct gl_fragment_program *prog)
+{
+   return (struct gl_fragment_program *) _mesa_clone_program(ctx, &prog->Base);
+}
+
+
 extern  GLboolean
 _mesa_insert_instructions(struct gl_program *prog, GLuint start, GLuint count);