mesa: add some gl_program cast wrappers
authorBrian Paul <brianp@vmware.com>
Wed, 18 Jul 2012 21:32:51 +0000 (15:32 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Jul 2012 22:51:47 +0000 (16:51 -0600)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/program/program.h

index 9cd1780b8929296454c27aeaf1fb9e493c734fe7..9a5bd22cbb99646cc14c8a4957f1828538c55afc 100644 (file)
@@ -216,4 +216,46 @@ _mesa_program_index_to_target(GLuint i)
       return enums[i];
 }
 
+
+/* Cast wrappers from gl_program to gl_vertex/geometry/fragment_program */
+
+static inline struct gl_fragment_program *
+gl_fragment_program(struct gl_program *prog)
+{
+   return (struct gl_fragment_program *) prog;
+}
+
+static inline const struct gl_fragment_program *
+gl_fragment_program_const(const struct gl_program *prog)
+{
+   return (const struct gl_fragment_program *) prog;
+}
+
+
+static inline struct gl_vertex_program *
+gl_vertex_program(struct gl_program *prog)
+{
+   return (struct gl_vertex_program *) prog;
+}
+
+static inline const struct gl_vertex_program *
+gl_vertex_program_const(const struct gl_program *prog)
+{
+   return (const struct gl_vertex_program *) prog;
+}
+
+
+static inline struct gl_geometry_program *
+gl_geometry_program(struct gl_program *prog)
+{
+   return (struct gl_geometry_program *) prog;
+}
+
+static inline const struct gl_geometry_program *
+gl_geometry_program_const(const struct gl_program *prog)
+{
+   return (const struct gl_geometry_program *) prog;
+}
+
+
 #endif /* PROGRAM_H */