summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/program.h')
-rw-r--r--src/mesa/program/program.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index 9cd1780b892..9a5bd22cbb9 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -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 */