diff options
author | Eric Anholt <[email protected]> | 2012-04-13 13:51:34 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-04-16 11:59:29 -0700 |
commit | 4ec449a6ed1d2cea3bf83d6518b3b352ce5daceb (patch) | |
tree | 4b6f808d47d72d6c22a28a5c9eda1710206c36b4 /src/glsl | |
parent | acd4024e0a0096c351a7143f908e029df53b1fdf (diff) |
glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/linker.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 6ba297237c7..5f8e8830169 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2225,6 +2225,20 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) goto done; } + if (max_version >= 140) { + /* Note that this will change with GL_ARB_separate_shader_objects */ + if (num_vert_shaders == 0) { + linker_error(prog, + "GLSL %.02f without GL_ARB_compatibility requires a " + "vertex shader", max_version / 100.0); + } + if (num_frag_shaders == 0) { + linker_error(prog, + "GLSL %.02f without GL_ARB_compatibility requires a " + "fragment shader", max_version / 100.0); + } + } + prog->Version = max_version; for (unsigned int i = 0; i < MESA_SHADER_TYPES; i++) { |