diff options
author | Ian Romanick <[email protected]> | 2011-11-04 15:48:41 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2011-11-08 11:10:07 -0800 |
commit | 4464a4b27b66f832acbe52b0a002c04415924c14 (patch) | |
tree | 77a6e73d9319c18159bdbb621cd8ab3501c23548 /src/mesa/main/shader_query.cpp | |
parent | 0a0d820f7bb191c1c541270e9206fd9494f38560 (diff) |
mesa: Stub implementation of glBindFragDataLocation
This just validates the input parameters so far.
Fixes piglit's bindfragdata-invalid-parameters test.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/shader_query.cpp')
-rw-r--r-- | src/mesa/main/shader_query.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index bd873a49134..0694b48aeb1 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -237,3 +237,40 @@ _mesa_longest_attribute_name_length(struct gl_shader_program *shProg) return longest; } + +void GLAPIENTRY +_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber, + const GLchar *name) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_shader_program *const shProg = + _mesa_lookup_shader_program_err(ctx, program, "glBindFragDataLocation"); + if (!shProg) + return; + + if (!name) + return; + + if (strncmp(name, "gl_", 3) == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBindFragDataLocation(illegal name)"); + return; + } + + if (colorNumber >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_VALUE, "glBindFragDataLocation(index)"); + return; + } + + /* Replace the current value if it's already in the list. Add + * FRAG_RESULT_DATA0 because that's how the linker differentiates + * between built-in attributes and user-defined attributes. + */ + + + /* + * Note that this binding won't go into effect until + * glLinkProgram is called again. + */ +} |