GLAPI/glGetActiveSubroutineUniformName: Difference between revisions

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


   void '''glGetActiveSubroutineUniformName'''(GLuint ''program'', GLenum ''shadertype'', GLuint ''index'', GLsizei ''bufsize'', GLsizei *''length'', GLchar *''name'');
   void '''glGetActiveSubroutineUniformName'''(GLuint {{param|program}}, GLenum {{param|shadertype}}, GLuint {{param|index}}, GLsizei {{param|bufsize}}, GLsizei *{{param|length}}, GLchar *{{param|name}});


; program
; program
: Specifies the name of the program containing the subroutine.
: Specifies the name of the program containing the subroutine.
; shadertype
; shadertype
: Specifies the shader stage from which to query for the subroutine parameter. ''shadertype'' must be one of {{code|GL_VERTEX_SHADER}}, {{code|GL_TESS_CONTROL_SHADER}}, {{code|GL_TESS_EVALUATION_SHADER}}, {{code|GL_GEOMETRY_SHADER}} or {{code|GL_FRAGMENT_SHADER}}.
: Specifies the shader stage from which to query for the subroutine parameter. {{param|shadertype}} must be one of {{enum|GL_VERTEX_SHADER}}, {{enum|GL_TESS_CONTROL_SHADER}}, {{enum|GL_TESS_EVALUATION_SHADER}}, {{enum|GL_GEOMETRY_SHADER}}, {{enum|GL_FRAGMENT_SHADER}}, or {{enum|GL_COMPUTE_SHADER}}.
; index
; index
: Specifies the index of the shader subroutine uniform.
: Specifies the index of the shader subroutine uniform.
; bufsize
; bufsize
: Specifies the size of the buffer whose address is given in ''name''.
: Specifies the size of the buffer whose address is given in {{param|name}}.
; length
; length
: Specifies the address of a variable into which is written the number of characters copied into ''name''.
: Specifies the address of a variable into which is written the number of characters copied into {{param|name}}.
; name
; name
: Specifies the address of a buffer that will receive the name of the specified shader subroutine uniform.
: Specifies the address of a buffer that will receive the name of the specified shader subroutine uniform.
Line 26: Line 26:
== Description ==
== Description ==


'''glGetActiveSubroutineUniformName''' retrieves the name of an active shader subroutine uniform. ''program'' contains the name of the program containing the uniform. ''shadertype'' specifies the stage for which which the uniform location, given by ''index'', is valid. ''index'' must be between zero and the value of {{code|GL_ACTIVE_SUBROUTINE_UNIFORMS}} minus one for the shader stage.
'''glGetActiveSubroutineUniformName''' retrieves the name of an active shader subroutine uniform. {{param|program}} contains the name of the program containing the uniform. {{param|shadertype}} specifies the stage for which which the uniform location, given by {{param|index}}, is valid. {{param|index}} must be between zero and the value of {{enum|GL_ACTIVE_SUBROUTINE_UNIFORMS}} minus one for the shader stage.


The uniform name is returned as a null-terminated string in ''name''. The actual number of characters written into ''name'', excluding the null terminator is returned in ''length''. If ''length'' is {{code|NULL}}, no length is returned. The maximum number of characters that may be written into ''name'', including the null terminator, is specified by ''bufsize''. The length of the longest subroutine uniform name in ''program'' and ''shadertype'' is given by the value of {{code|GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}}, which can be queried with [[GLAPI/glGetProgramStage|glGetProgramStage]].
The uniform name is returned as a null-terminated string in {{param|name}}. The actual number of characters written into {{param|name}}, excluding the null terminator is returned in {{param|length}}. If {{param|length}} is {{code|NULL}}, no length is returned. The maximum number of characters that may be written into {{param|name}}, including the null terminator, is specified by {{param|bufsize}}. The length of the longest subroutine uniform name in {{param|program}} and {{param|shadertype}} is given by the value of {{enum|GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}}, which can be queried with {{apifunc|glGetProgramStage}}.


== Errors ==
== Errors ==


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


{{code|GL_INVALID_VALUE}} is generated if ''index'' is greater than or equal to the value of {{code|GL_ACTIVE_SUBROUTINES}}.
{{enum|GL_INVALID_VALUE}} is generated if {{param|index}} is greater than or equal to the value of {{enum|GL_ACTIVE_SUBROUTINES}}.


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


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


[[GLAPI/glGetProgramStage|glGetProgramStage]] with argument {{code|GL_ACTIVE_SUBROUTINE_UNIFORMS}}
{{apifunc|glGetProgramStage}} with argument {{enum|GL_ACTIVE_SUBROUTINE_UNIFORMS}}
 
{{apifunc|glGetProgramInterface}} with the interface set to  {{enum|GL_VERTEX_SUBROUTINE_UNIFORM}}, {{enum|​GL_TESS_CONTROL_SUBROUTINE_UNIFORM}}, {{enum|GL_TESS_EVALUATION_SUBROUTINE​_UNIFORM}}, {{enum|GL_GEOMETRY_SUBROUTINE_UNIFORM}}, {{enum|​GL_FRAGMENT_SUBROUTINE_UNIFORM​}}, or {{enum|GL_COMPUTE_SUBROUTINE​_UNIFORM}} as appropriate, and with {{enum|GL_ACTIVE_RESOURCES}}
 
{{apifunc|glGetSubroutineIndex}}
 
{{apifunc|glGetProgramResourceIndex}} with the interface set to  {{enum|GL_VERTEX_SUBROUTINE_UNIFORM}}, {{enum|​GL_TESS_CONTROL_SUBROUTINE_UNIFORM}}, {{enum|GL_TESS_EVALUATION_SUBROUTINE​_UNIFORM}}, {{enum|GL_GEOMETRY_SUBROUTINE_UNIFORM}}, {{enum|​GL_FRAGMENT_SUBROUTINE_UNIFORM​}}, or {{enum|GL_COMPUTE_SUBROUTINE​_UNIFORM}} as appropriate


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


[[GLAPI/glGetSubroutineIndex|glGetSubroutineIndex]], [[GLAPI/glGetActiveSubroutineUniform|glGetActiveSubroutineUniform]], [[GLAPI/glGetProgramStage|glGetProgramStage]]
{{apifunc|glGetActiveSubroutineUniform}}, {{apifunc|glGetProgramResource}}, {{apifunc|glGetProgramResourceName}}, {{apifunc|glGetSubroutineUniformLocation}}


== Copyright ==
== Copyright ==
Line 50: Line 56:
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|GetActiveSubroutineUniformName]]
[[Category:Core API Ref Shader Program Query|GetActiveSubroutineUniformName]]
[[Category:GL 4 API Shader Program Query|GetActiveSubroutineUniformName]]
[[Category:Core API Reference|GetActiveSubroutineUniformName]]
[[Category:Program Object API State Functions|GetActiveSubroutineUniformName]]

Latest revision as of 09:58, 15 August 2013

glGetActiveSubroutineUniformName
Core in version 4.6
Core since version 4.0
Core ARB extension ARB_shader_subroutine

glGetActiveSubroutineUniformName: query the name of an active shader subroutine uniform

Function Definition

 void glGetActiveSubroutineUniformName(GLuint program​, GLenum shadertype​, GLuint index​, GLsizei bufsize​, GLsizei *length​, GLchar *name​);
program
Specifies the name of the program containing the subroutine.
shadertype
Specifies the shader stage from which to query for the subroutine parameter. shadertype​ must be one of GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER, or GL_COMPUTE_SHADER.
index
Specifies the index of the shader subroutine uniform.
bufsize
Specifies the size of the buffer whose address is given in name​.
length
Specifies the address of a variable into which is written the number of characters copied into name​.
name
Specifies the address of a buffer that will receive the name of the specified shader subroutine uniform.

Description

glGetActiveSubroutineUniformName retrieves the name of an active shader subroutine uniform. program​ contains the name of the program containing the uniform. shadertype​ specifies the stage for which which the uniform location, given by index​, is valid. index​ must be between zero and the value of GL_ACTIVE_SUBROUTINE_UNIFORMS minus one for the shader stage.

The uniform name is returned as a null-terminated string in name​. The actual number of characters written into name​, excluding the null terminator is returned in length​. If length​ is NULL, no length is returned. The maximum number of characters that may be written into name​, including the null terminator, is specified by bufsize​. The length of the longest subroutine uniform name in program​ and shadertype​ is given by the value of GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH, which can be queried with glGetProgramStage.

Errors

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

GL_INVALID_VALUE is generated if index​ is greater than or equal to the value of GL_ACTIVE_SUBROUTINES.

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

Associated Gets

glGetProgramStage with argument GL_ACTIVE_SUBROUTINE_UNIFORMS

glGetProgramInterface with the interface set to GL_VERTEX_SUBROUTINE_UNIFORM, ​GL_TESS_CONTROL_SUBROUTINE_UNIFORM, GL_TESS_EVALUATION_SUBROUTINE​_UNIFORM, GL_GEOMETRY_SUBROUTINE_UNIFORM, ​GL_FRAGMENT_SUBROUTINE_UNIFORM​, or GL_COMPUTE_SUBROUTINE​_UNIFORM as appropriate, and with GL_ACTIVE_RESOURCES

glGetSubroutineIndex

glGetProgramResourceIndex with the interface set to GL_VERTEX_SUBROUTINE_UNIFORM, ​GL_TESS_CONTROL_SUBROUTINE_UNIFORM, GL_TESS_EVALUATION_SUBROUTINE​_UNIFORM, GL_GEOMETRY_SUBROUTINE_UNIFORM, ​GL_FRAGMENT_SUBROUTINE_UNIFORM​, or GL_COMPUTE_SUBROUTINE​_UNIFORM as appropriate

See Also

glGetActiveSubroutineUniform, glGetProgramResource, glGetProgramResourceName, glGetSubroutineUniformLocation

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