diff options
author | Brian Paul <brianp@vmware.com> | 2012-07-18 15:32:51 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2012-07-18 16:51:47 -0600 |
commit | 1170b5aa9f8394fefcbab759c09d26293ba4b0ee (patch) | |
tree | d6d44aed21907ed429b319005b8e3b2113f88261 /src/mesa/program | |
parent | c3c83af380d703cdc24475bd39baa1722c333b44 (diff) | |
download | external_mesa3d-1170b5aa9f8394fefcbab759c09d26293ba4b0ee.zip external_mesa3d-1170b5aa9f8394fefcbab759c09d26293ba4b0ee.tar.gz external_mesa3d-1170b5aa9f8394fefcbab759c09d26293ba4b0ee.tar.bz2 |
mesa: add some gl_program cast wrappers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/program')
-rw-r--r-- | src/mesa/program/program.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h index 9cd1780..9a5bd22 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 */ |