mesa: add KHR_no_error support for glActiveShaderProgram()

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Timothy Arceri 2017-05-03 15:26:22 +10:00
parent 00c5119a5e
commit 0bca4784c2
3 changed files with 21 additions and 1 deletions

View file

@ -20,7 +20,7 @@
<param name="stages" type="GLbitfield" />
<param name="program" type="GLuint" />
</function>
<function name="ActiveShaderProgram" es2="3.1">
<function name="ActiveShaderProgram" es2="3.1" no_error="true">
<param name="pipeline" type="GLuint" />
<param name="program" type="GLuint" />
</function>

View file

@ -373,6 +373,24 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
use_program_stages(ctx, shProg, stages, pipe);
}
void GLAPIENTRY
_mesa_ActiveShaderProgram_no_error(GLuint pipeline, GLuint program)
{
GET_CURRENT_CONTEXT(ctx);
struct gl_shader_program *shProg = NULL;
struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
if (program)
shProg = _mesa_lookup_shader_program(ctx, program);
/* Object is created by any Pipeline call but glGenProgramPipelines,
* glIsProgramPipeline and GetProgramPipelineInfoLog
*/
pipe->EverBound = GL_TRUE;
_mesa_reference_shader_program(ctx, &pipe->ActiveProgram, shProg);
}
/**
* Use the named shader program for subsequent glUniform calls (if pipeline
* bound)

View file

@ -77,6 +77,8 @@ _mesa_UseProgramStages_no_error(GLuint pipeline, GLbitfield stages,
extern void GLAPIENTRY
_mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
void GLAPIENTRY
_mesa_ActiveShaderProgram_no_error(GLuint pipeline, GLuint program);
extern void GLAPIENTRY
_mesa_ActiveShaderProgram(GLuint pipeline, GLuint program);