GLAPI/glActiveShaderProgram: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
m Bot: Adjusting API page category.
m Bot: Adding better formatting.
 
(6 intermediate revisions by 2 users not shown)
Line 9: Line 9:
== Function Definition ==
== Function Definition ==


   void '''glActiveShaderProgram'''(GLuint ''pipeline'', GLuint ''program'');
   void '''glActiveShaderProgram'''(GLuint {{param|pipeline}}, GLuint {{param|program}});


; pipeline
; pipeline
: Specifies the program pipeline object to set the active program object for.
: Specifies the program pipeline object to set the active program object for.
; program
; program
: Specifies the program object to set as the active program pipeline object ''pipeline''.
: Specifies the program object to set as the active program pipeline object {{param|pipeline}}.


== Description ==
== Description ==


'''glActiveShaderProgram''' sets the linked program named by ''program'' to be the active program for the program pipeline object ''pipeline''. The active program in the active program pipeline object is the target of calls to [[GLAPI/glUniform|glUniform]] when no program has been made current through a call to [[GLAPI/glUseProgram|glUseProgram]].
'''glActiveShaderProgram''' sets the linked program named by {{param|program}} to be the active program for the program pipeline object {{param|pipeline}}. The active program in the active program pipeline object is the target of calls to {{apifunc|glUniform}} when no program has been made current through a call to {{apifunc|glUseProgram}}.


== Errors ==
== Errors ==


{{code|GL_INVALID_OPERATION}} is generated if ''pipeline'' is not a name previously returned from a call to [[GLAPI/glGenProgramPipelines|glGenProgramPipelines]] or if such a name has been deleted by a call to [[GLAPI/glDeleteProgramPipelines|glDeleteProgramPipelines]].
{{enum|GL_INVALID_OPERATION}} is generated if {{param|pipeline}} is not a name previously returned from a call to {{apifunc|glGenProgramPipelines}} or if such a name has been deleted by a call to {{apifunc|glDeleteProgramPipelines}}.


{{code|GL_INVALID_OPERATION}} is generated if ''program'' refers to a program object that has not been successfully linked.
{{enum|GL_INVALID_VALUE}} is generated if {{param|program}} is not a valid program object or shader object name.
 
{{enum|GL_INVALID_OPERATION}} is generated if {{param|program}} is a shader object.
 
{{enum|GL_INVALID_OPERATION}} is generated if {{param|program}} refers to a program object that has not been successfully linked.


== See Also ==
== See Also ==


[[GLAPI/glGenProgramPipelines|glGenProgramPipelines]], [[GLAPI/glDeleteProgramPipelines|glDeleteProgramPipelines]], [[GLAPI/glIsProgramPipeline|glIsProgramPipeline]], [[GLAPI/glUseProgram|glUseProgram]], [[GLAPI/glUniform|glUniform]]
{{apifunc|glGenProgramPipelines}}, {{apifunc|glBindProgramPipeline}}, {{apifunc|glUseProgram}}, {{apifunc|glUniform}}, {{apifunc|glUniformSubroutines}}


== Copyright ==
== Copyright ==
Line 34: Line 38:
Copyright © 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. [http://opencontent.org/openpub/ http://opencontent.org/openpub/].
Copyright © 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. [http://opencontent.org/openpub/ http://opencontent.org/openpub/].


[[Category:API Reference 4|ActiveShaderProgram]]
[[Category:Core API Ref Shader Program Usage and State|ActiveShaderProgram]]
[[Category:GL 4 API Shader Program Usage and State|ActiveShaderProgram]]
[[Category:Core API Reference|ActiveShaderProgram]]
[[Category:Program Pipeline Object API State Functions|ActiveShaderProgram]]

Latest revision as of 09:47, 15 August 2013

glActiveShaderProgram
Core in version 4.6
Core since version 4.1
Core ARB extension ARB_separate_shader_objects

glActiveShaderProgram: set the active program object for a program pipeline object

Function Definition

 void glActiveShaderProgram(GLuint pipeline​, GLuint program​);
pipeline
Specifies the program pipeline object to set the active program object for.
program
Specifies the program object to set as the active program pipeline object pipeline​.

Description

glActiveShaderProgram sets the linked program named by program​ to be the active program for the program pipeline object pipeline​. The active program in the active program pipeline object is the target of calls to glUniform when no program has been made current through a call to glUseProgram.

Errors

GL_INVALID_OPERATION is generated if pipeline​ is not a name previously returned from a call to glGenProgramPipelines or if such a name has been deleted by a call to glDeleteProgramPipelines.

GL_INVALID_VALUE is generated if program​ is not a valid program object or shader object name.

GL_INVALID_OPERATION is generated if program​ is a shader object.

GL_INVALID_OPERATION is generated if program​ refers to a program object that has not been successfully linked.

See Also

glGenProgramPipelines, glBindProgramPipeline, glUseProgram, glUniform, glUniformSubroutines

Copyright

Copyright © 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.