diff options
author | Gregory Hainaut <[email protected]> | 2013-06-28 19:22:15 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-03-25 10:25:26 -0700 |
commit | aa46ad26b13a753858627088d1e8f7cc81beb64e (patch) | |
tree | 4cd8bf64a9f9638821d0cb185332a3fb88c7ba51 /src/mesa | |
parent | 658eaa32295c62d65a40445cef1daaf9c41f311e (diff) |
mesa/sso: Add gl_pipeline_object::InfoLog support
V2 (idr):
* Keep the behavior of other info logs in Mesa: and empty info log
reports a GL_INFO_LOG_LENGTH of zero.
* Use a NULL pointer to denote an empty info log.
* Split out from previous uber patch.
Reviewed-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/mtypes.h | 2 | ||||
-rw-r--r-- | src/mesa/main/pipelineobj.c | 25 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f9317a58099..c18ff1edab7 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2807,6 +2807,8 @@ struct gl_pipeline_object GLbitfield Flags; /**< Mask of GLSL_x flags */ GLboolean EverBound; /**< Has the pipeline object been created */ + + GLchar *InfoLog; }; /** diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index 7245b7802b9..2d079cc7545 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -80,6 +80,7 @@ _mesa_new_pipeline_object(struct gl_context *ctx, GLuint name) mtx_init(&obj->Mutex, mtx_plain); obj->RefCount = 1; obj->Flags = _mesa_get_shader_flags(); + obj->InfoLog = NULL; } return obj; @@ -572,9 +573,7 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) *params = pipe->ActiveProgram ? pipe->ActiveProgram->Name : 0; return; case GL_INFO_LOG_LENGTH: - /* FINISHME: Implement the info log. - */ - *params = 0; + *params = pipe->InfoLog ? strlen(pipe->InfoLog) + 1 : 0; return; case GL_VALIDATE_STATUS: /* FINISHME: Implement validation status. @@ -621,4 +620,24 @@ void GLAPIENTRY _mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) { + GET_CURRENT_CONTEXT(ctx); + + struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline); + + if (!pipe) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetProgramPipelineInfoLog(pipeline)"); + return; + } + + if (bufSize < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetProgramPipelineInfoLog(bufSize)"); + return; + } + + if (pipe->InfoLog) + _mesa_copy_string(infoLog, bufSize, length, pipe->InfoLog); + else + *length = 0; } |