aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/program.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/program/program.h')
-rw-r--r--mesalib/src/mesa/program/program.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/mesalib/src/mesa/program/program.h b/mesalib/src/mesa/program/program.h
index 353ccab47..baff47376 100644
--- a/mesalib/src/mesa/program/program.h
+++ b/mesalib/src/mesa/program/program.h
@@ -210,14 +210,16 @@ _mesa_program_target_to_index(GLenum v)
static inline GLenum
_mesa_program_index_to_target(GLuint i)
{
- static const GLenum enums[MESA_SHADER_TYPES] = {
+ static const GLenum enums[] = {
GL_VERTEX_PROGRAM_ARB,
GL_GEOMETRY_PROGRAM_NV,
GL_FRAGMENT_PROGRAM_ARB
};
- if(i >= MESA_SHADER_TYPES)
+ STATIC_ASSERT(Elements(enums) == MESA_SHADER_TYPES);
+ if(i >= MESA_SHADER_TYPES) {
+ assert(!"Unexpected program index");
return 0;
- else
+ } else
return enums[i];
}