diff options
author | Paul Berry <[email protected]> | 2014-01-09 04:03:30 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-02-05 09:04:55 -0800 |
commit | f5c5438e1fb9b5b1e83c7081da518d9943fc82e8 (patch) | |
tree | b2871a77dbb51f60e5ab5ef73812141b6434c44a /src | |
parent | 28ce604b7f2b08b967b6a27051ecab04adaed575 (diff) |
main/cs: Implement query for COMPUTE_WORK_GROUP_SIZE.
v2: Improve error message.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/shaderapi.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 571e13ca9b9..65b6b16bbc0 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -663,6 +663,24 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param *params = shProg->NumAtomicBuffers; return; + case GL_COMPUTE_WORK_GROUP_SIZE: { + int i; + if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_compute_shader) + break; + if (!shProg->LinkStatus) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(program not " + "linked)"); + return; + } + if (shProg->_LinkedShaders[MESA_SHADER_COMPUTE] == NULL) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramiv(no compute " + "shaders)"); + return; + } + for (i = 0; i < 3; i++) + params[i] = shProg->Comp.LocalSize[i]; + return; + } default: break; } |