diff options
author | Gregory Hainaut <[email protected]> | 2013-06-28 14:05:49 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-02-21 15:41:02 -0800 |
commit | 8ed8592fd685727e568fc0d7f74b835efb03fbc4 (patch) | |
tree | 2f26603a46c587f8a050bfe92b12930071fa0deb /src/mesa/main/shaderapi.c | |
parent | 4177d39c1ec10d252f2d08cc9ab9141f0ca94421 (diff) |
mesa/sso: Add support for GL_PROGRAM_SEPARABLE query
This was originally included in another patch, but it was split out by
Ian Romanick.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index ac95dc735cf..79ef149d765 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -696,6 +696,12 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param params[i] = shProg->Comp.LocalSize[i]; return; } + case GL_PROGRAM_SEPARABLE: + if (!ctx->Extensions.ARB_separate_shader_objects) + break; + + *params = shProg->SeparateShader; + return; default: break; } @@ -1736,6 +1742,25 @@ _mesa_ProgramParameteri(GLuint program, GLenum pname, GLint value) */ shProg->BinaryRetreivableHint = value; return; + + case GL_PROGRAM_SEPARABLE: + if (!ctx->Extensions.ARB_separate_shader_objects) + break; + + /* Spec imply that the behavior is the same as ARB_get_program_binary + * Chapter 7.3 Program Objects + */ + if (value != GL_TRUE && value != GL_FALSE) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glProgramParameteri(pname=%s, value=%d): " + "value must be 0 or 1.", + _mesa_lookup_enum_by_nr(pname), + value); + return; + } + shProg->SeparateShader = value; + return; + default: break; } |