diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-07-21 14:16:07 -0600 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2008-07-21 14:16:07 -0600 |
commit | 70d3928f6366c94b147d768d55eaa7d1f45462bd (patch) | |
tree | 0984a053bc99eca1cd28f69f4af07a24d3a650b8 | |
parent | fbf26e109b1e96aa4eeca018198ff0b5a71e557b (diff) |
mesa: fix some issues in _mesa_validate_program()
-rw-r--r-- | src/mesa/shader/shader_api.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index e25cb63216..f390e3cef4 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1534,15 +1534,19 @@ static void _mesa_validate_program(GLcontext *ctx, GLuint program) { struct gl_shader_program *shProg; - shProg = _mesa_lookup_shader_program(ctx, program); + + shProg = _mesa_lookup_shader_program_err(ctx, program, "glValidateProgram"); if (!shProg) { - _mesa_error(ctx, GL_INVALID_VALUE, "glValidateProgram(program)"); return; } - /* XXX temporary */ - shProg->Validated = GL_TRUE; - /* From the GL spec: + if (!shProg->LinkStatus) { + shProg->Validated = GL_FALSE; + return; + } + + /* From the GL spec, a program is invalid if any of these are true: + any two active samplers in the current program object are of different types, but refer to the same texture image unit, @@ -1555,6 +1559,8 @@ _mesa_validate_program(GLcontext *ctx, GLuint program) processing exceeds the combined limit on the total number of texture image units allowed. */ + + shProg->Validated = GL_TRUE; } |