aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/program.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-31 10:00:43 +0200
committermarha <marha@users.sourceforge.net>2012-07-31 10:00:43 +0200
commitbd27b3d008b0abf9ae2edcb127302728808533e4 (patch)
treea73a74f04a31a0f44465ed82bcf58b180ca53dbd /mesalib/src/mesa/program/program.h
parent2ff5448bcca8cba4b62026d5493cb08aaf2838d8 (diff)
downloadvcxsrv-bd27b3d008b0abf9ae2edcb127302728808533e4.tar.gz
vcxsrv-bd27b3d008b0abf9ae2edcb127302728808533e4.tar.bz2
vcxsrv-bd27b3d008b0abf9ae2edcb127302728808533e4.zip
fontconfig libXext mesa xserver pixman git update 31 Jul 2012
Diffstat (limited to 'mesalib/src/mesa/program/program.h')
-rw-r--r--mesalib/src/mesa/program/program.h54
1 files changed, 47 insertions, 7 deletions
diff --git a/mesalib/src/mesa/program/program.h b/mesalib/src/mesa/program/program.h
index 9cd1780b8..c5650c519 100644
--- a/mesalib/src/mesa/program/program.h
+++ b/mesalib/src/mesa/program/program.h
@@ -183,13 +183,11 @@ _mesa_valid_register_index(const struct gl_context *ctx,
extern void
_mesa_postprocess_program(struct gl_context *ctx, struct gl_program *prog);
-/* keep these in the same order as TGSI_PROCESSOR_* */
static inline GLuint
_mesa_program_target_to_index(GLenum v)
{
- switch(v)
- {
+ switch (v) {
case GL_VERTEX_PROGRAM_ARB:
return MESA_SHADER_VERTEX;
case GL_FRAGMENT_PROGRAM_ARB:
@@ -205,10 +203,10 @@ _mesa_program_target_to_index(GLenum v)
static inline GLenum
_mesa_program_index_to_target(GLuint i)
{
- GLenum enums[MESA_SHADER_TYPES] = {
- GL_VERTEX_PROGRAM_ARB,
- GL_FRAGMENT_PROGRAM_ARB,
- GL_GEOMETRY_PROGRAM_NV,
+ static const GLenum enums[MESA_SHADER_TYPES] = {
+ GL_VERTEX_PROGRAM_ARB,
+ GL_FRAGMENT_PROGRAM_ARB,
+ GL_GEOMETRY_PROGRAM_NV,
};
if(i >= MESA_SHADER_TYPES)
return 0;
@@ -216,4 +214,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 */