[Mesa-dev] [PATCH 04/12] sso: implement ActiveShaderProgram & GetProgramPipelineiv

Kenneth Graunke kenneth at whitecape.org
Sat May 4 14:56:04 PDT 2013


On 05/04/2013 02:32 PM, gregory hainaut wrote:
> On Sat, 04 May 2013 12:37:05 -0700
> Kenneth Graunke <kenneth at whitecape.org> wrote:
>
>> On 05/03/2013 10:44 AM, Gregory Hainaut wrote:
>>> V2:
>>> * Rename object
>>> * Formatting improvement
>>> ---
>>>    src/mesa/main/pipelineobj.c |   77 +++++++++++++++++++++++++++++++++++++++++++
>>>    1 file changed, 77 insertions(+)
>>>
>>> diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
>>> index d81bd0e..ffbeeae 100644
>>> --- a/src/mesa/main/pipelineobj.c
>>> +++ b/src/mesa/main/pipelineobj.c
>>> @@ -231,6 +231,30 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
>>>    void GLAPIENTRY
>>>    _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program)
>>>    {
>>> +   GET_CURRENT_CONTEXT(ctx);
>>> +   struct gl_shader_program *shProg = (program != 0)
>>> +      ? _mesa_lookup_shader_program_err(ctx, program, "glActiveShaderProgram(program)")
>>> +      : NULL;
>>> +
>>> +   struct gl_pipeline_object *pipe = lookup_pipeline_object(ctx, pipeline);
>>> +
>>> +   if (!pipe) {
>>> +      _mesa_error(ctx, GL_INVALID_OPERATION, "glActiveShaderProgram(pipeline)");
>>> +      return;
>>> +   }
>>> +
>>> +   /* Object is created by any Pipeline call but glGenProgramPipelines,
>>> +    * glIsProgramPipeline and GetProgramPipelineInfoLog
>>> +    */
>>> +   pipe->EverBound = GL_TRUE;
>>
>> This doesn't seem right to me.  I found this section of the spec:
>>
>> """
>>       A program pipeline object is created by binding a name returned by
>>       GenProgramPipelines with the command
>>
>>           void BindProgramPipeline(uint pipeline);
>>
>>       <pipeline> is the program pipeline object name. The resulting program
>>       pipeline object is a new state vector, comprising ACTIVE_PROGRAM,
>>       VERTEX_SHADER, GEOMETRY_SHADER, FRAGMENT_SHADER, TESS_CONTROL_SHADER,
>>       and TESS_EVALUATION_SHADER.
>> """
>>
>> It sure sounds to me like BindProgramPipeline is the only thing that
>> should set EverBound.  Is there another part of the spec that I missed
>> which suggests otherwise?
>>
>
> You mean http://www.opengl.org/registry/specs/ARB/separate_shader_objects.txt ? Or an older glspec?

Yeah, the extension spec.

> Don't know which one is the reference but here an extract (duplicated 4 times)
> of glspec43.core.20130214.pdf:
> Page 104-105 (void UseProgramStages)
> Page 105-106 (void ActiveShaderProgram)
> Page 144 (void GetProgramPipelineiv)
> Page 339 (void ValidateProgramPipeline)
> """
> If pipeline is a name that has been generated (without subsequent deletion) by
> GenProgramPipelines, but refers to a program pipeline object that has not been
> previously bound, the GL first creates a new state vector in the same manner as
> when BindProgramPipeline creates a new program pipeline object.
> """

Oh!  That's what I missed...thanks.  Seems fine then.  It might be nice 
to quote that in at least one of the comment blocks.


More information about the mesa-dev mailing list