summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/program.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-08 11:09:58 -0800
committerPaul Berry <[email protected]>2014-01-09 09:31:27 -0800
commit8668eaaa007a1a0b23a4bc39469d6dba293b7da9 (patch)
tree33b9067a26c4e2a5d7b9a8f83fba9fa74939b9f5 /src/mesa/program/program.h
parente654216ac7ec2d254685d0ff5f437917747c9bd3 (diff)
mesa: Use functions to convert gl_shader_stage to PROGRAM enum or pipe target.
Suggested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> v2: Improve assert message.
Diffstat (limited to 'src/mesa/program/program.h')
-rw-r--r--src/mesa/program/program.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index 4015b4c202b..0e350cd6f86 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -207,6 +207,24 @@ _mesa_program_enum_to_shader_stage(GLenum v)
}
}
+
+static inline GLenum
+_mesa_shader_stage_to_program(gl_shader_stage stage)
+{
+ switch (stage) {
+ case MESA_SHADER_VERTEX:
+ return GL_VERTEX_PROGRAM_ARB;
+ case MESA_SHADER_FRAGMENT:
+ return GL_FRAGMENT_PROGRAM_ARB;
+ case MESA_SHADER_GEOMETRY:
+ return GL_GEOMETRY_PROGRAM_NV;
+ }
+
+ assert(!"Unexpected shader stage in _mesa_shader_stage_to_program");
+ return GL_VERTEX_PROGRAM_ARB;
+}
+
+
static inline GLenum
_mesa_program_index_to_target(GLuint i)
{