GLAPI/glProgramParameter: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
m Renaming category: 'GL 4 API Shader Program Creation' to 'Core API Ref Shader Program Creation'.
m Bot: Adding better formatting.
Line 8: Line 8:
== Function Definition ==
== Function Definition ==


   void '''glProgramParameteri'''(GLuint ''program'', GLenum ''pname'', GLint ''value'');
   void '''glProgramParameteri'''(GLuint {{param|program}}, GLenum {{param|pname}}, GLint {{param|value}});


; program
; program
Line 15: Line 15:
: Specifies the name of the parameter to modify.
: Specifies the name of the parameter to modify.
; value
; value
: Specifies the new value of the parameter specified by ''pname'' for ''program''.
: Specifies the new value of the parameter specified by {{param|pname}} for {{param|program}}.


== Description ==
== Description ==


'''glProgramParameter''' specifies a new value for the parameter nameed by ''pname'' for the program object ''program''.
'''glProgramParameter''' specifies a new value for the parameter nameed by {{param|pname}} for the program object {{param|program}}.


If ''pname'' is {{code|GL_PROGRAM_BINARY_RETRIEVABLE_HINT}}, ''value'' should be {{code|GL_FALSE}} or {{code|GL_TRUE}} to indicate to the implementation the intention of the application to retrieve the program's binary representation with [[GLAPI/glGetProgramBinary|glGetProgramBinary]]. The implementation may use this information to store information that may be useful for a future query of the program's binary. It is recommended to set {{code|GL_PROGRAM_BINARY_RETRIEVABLE_HINT}} for the program to {{code|GL_TRUE}} before calling [[GLAPI/glLinkProgram|glLinkProgram]], and using the program at run-time if the binary is to be retrieved later.
If {{param|pname}} is {{code|GL_PROGRAM_BINARY_RETRIEVABLE_HINT}}, {{param|value}} should be {{code|GL_FALSE}} or {{code|GL_TRUE}} to indicate to the implementation the intention of the application to retrieve the program's binary representation with {{apifunc|glGetProgramBinary}}. The implementation may use this information to store information that may be useful for a future query of the program's binary. It is recommended to set {{code|GL_PROGRAM_BINARY_RETRIEVABLE_HINT}} for the program to {{code|GL_TRUE}} before calling {{apifunc|glLinkProgram}}, and using the program at run-time if the binary is to be retrieved later.


If ''pname'' is {{code|GL_PROGRAM_SEPARABLE}}, ''value'' must be {{code|GL_TRUE}} or {{code|GL_FALSE}} and indicates whether ''program'' can be bound to individual pipeline stages via [[GLAPI/glUseProgramStages|glUseProgramStages]]. A program's {{code|GL_PROGRAM_SEPARABLE}} parameter must be set to {{code|GL_TRUE}} ''before'' [[GLAPI/glLinkProgram|glLinkProgram]] is called in order for it to be usable with a program pipeline object. The initial state of {{code|GL_PROGRAM_SEPARABLE}} is {{code|GL_FALSE}}.
If {{param|pname}} is {{code|GL_PROGRAM_SEPARABLE}}, {{param|value}} must be {{code|GL_TRUE}} or {{code|GL_FALSE}} and indicates whether {{param|program}} can be bound to individual pipeline stages via {{apifunc|glUseProgramStages}}. A program's {{code|GL_PROGRAM_SEPARABLE}} parameter must be set to {{code|GL_TRUE}}''before''{{apifunc|glLinkProgram}} is called in order for it to be usable with a program pipeline object. The initial state of {{code|GL_PROGRAM_SEPARABLE}} is {{code|GL_FALSE}}.


== Errors ==
== Errors ==


{{code|GL_INVALID_OPERATION}} is generated if ''program'' is not the name of an existing program object.
{{code|GL_INVALID_OPERATION}} is generated if {{param|program}} is not the name of an existing program object.


{{code|GL_INVALID_ENUM}} is generated if ''pname'' is not one of the accepted values.
{{code|GL_INVALID_ENUM}} is generated if {{param|pname}} is not one of the accepted values.


{{code|GL_INVALID_VALUE}} is generated if ''value'' is not a valid value for the parameter named by ''pname''.
{{code|GL_INVALID_VALUE}} is generated if {{param|value}} is not a valid value for the parameter named by {{param|pname}}.


== Associated Gets ==
== Associated Gets ==


[[GLAPI/glGetProgram|glGetProgram]].
{{apifunc|glGetProgram}}.


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


[[GLAPI/glGetProgram|glGetProgram]], [[GLAPI/glGetProgramBinary|glGetProgramBinary]], [[GLAPI/glProgramBinary|glProgramBinary]]
{{apifunc|glGetProgram}}, {{apifunc|glGetProgramBinary}}, {{apifunc|glProgramBinary}}


== Copyright ==
== Copyright ==

Revision as of 01:24, 29 April 2012

glProgramParameter
Core in version 4.6
Core since version 4.1

glProgramParameter: specify a parameter for a program object

Function Definition

 void glProgramParameteri(GLuint program​, GLenum pname​, GLint value​);
program
Specifies the name of a program object whose parameter to modify.
pname
Specifies the name of the parameter to modify.
value
Specifies the new value of the parameter specified by pname​ for program​.

Description

glProgramParameter specifies a new value for the parameter nameed by pname​ for the program object program​.

If pname​ is GL_PROGRAM_BINARY_RETRIEVABLE_HINT, value​ should be GL_FALSE or GL_TRUE to indicate to the implementation the intention of the application to retrieve the program's binary representation with glGetProgramBinary. The implementation may use this information to store information that may be useful for a future query of the program's binary. It is recommended to set GL_PROGRAM_BINARY_RETRIEVABLE_HINT for the program to GL_TRUE before calling glLinkProgram, and using the program at run-time if the binary is to be retrieved later.

If pname​ is GL_PROGRAM_SEPARABLE, value​ must be GL_TRUE or GL_FALSE and indicates whether program​ can be bound to individual pipeline stages via glUseProgramStages. A program's GL_PROGRAM_SEPARABLE parameter must be set to GL_TRUEbeforeglLinkProgram is called in order for it to be usable with a program pipeline object. The initial state of GL_PROGRAM_SEPARABLE is GL_FALSE.

Errors

GL_INVALID_OPERATION is generated if program​ is not the name of an existing program object.

GL_INVALID_ENUM is generated if pname​ is not one of the accepted values.

GL_INVALID_VALUE is generated if value​ is not a valid value for the parameter named by pname​.

Associated Gets

glGetProgram.

See Also

glGetProgram, glGetProgramBinary, glProgramBinary

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/.