1 /*
2  * Copyright (c) 2002-2012 LWJGL Project
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  *   notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  *   notice, this list of conditions and the following disclaimer in the
14  *   documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of 'LWJGL' nor the names of
17  *   its contributors may be used to endorse or promote products derived
18  *   from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 package org.lwjgl.opengl;
33 
34 import org.lwjgl.util.generator.*;
35 import org.lwjgl.util.generator.opengl.*;
36 
37 import java.nio.ByteBuffer;
38 import java.nio.IntBuffer;
39 
40 @Extension(postfix = "")
41 public interface ARB_program_interface_query {
42 
43 	/**
44 	 * Accepted by the <programInterface> parameter of GetProgramInterfaceiv,
45 	 * GetProgramResourceIndex, GetProgramResourceName, GetProgramResourceiv,
46 	 * GetProgramResourceLocation, and GetProgramResourceLocationIndex:
47 	 */
48 	int GL_UNIFORM                            = 0x92E1,
49 		GL_UNIFORM_BLOCK                      = 0x92E2,
50 		GL_PROGRAM_INPUT                      = 0x92E3,
51 		GL_PROGRAM_OUTPUT                     = 0x92E4,
52 		GL_BUFFER_VARIABLE                    = 0x92E5,
53 		GL_SHADER_STORAGE_BLOCK               = 0x92E6,
54 		GL_VERTEX_SUBROUTINE                  = 0x92E8,
55 		GL_TESS_CONTROL_SUBROUTINE            = 0x92E9,
56 		GL_TESS_EVALUATION_SUBROUTINE         = 0x92EA,
57 		GL_GEOMETRY_SUBROUTINE                = 0x92EB,
58 		GL_FRAGMENT_SUBROUTINE                = 0x92EC,
59 		GL_COMPUTE_SUBROUTINE                 = 0x92ED,
60 		GL_VERTEX_SUBROUTINE_UNIFORM          = 0x92EE,
61 		GL_TESS_CONTROL_SUBROUTINE_UNIFORM    = 0x92EF,
62 		GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0,
63 		GL_GEOMETRY_SUBROUTINE_UNIFORM        = 0x92F1,
64 		GL_FRAGMENT_SUBROUTINE_UNIFORM        = 0x92F2,
65 		GL_COMPUTE_SUBROUTINE_UNIFORM         = 0x92F3,
66 		GL_TRANSFORM_FEEDBACK_VARYING         = 0x92F4;
67 
68 	/** Accepted by the <pname> parameter of GetProgramInterfaceiv: */
69 	int GL_ACTIVE_RESOURCES               = 0x92F5,
70 		GL_MAX_NAME_LENGTH                = 0x92F6,
71 		GL_MAX_NUM_ACTIVE_VARIABLES       = 0x92F7,
72 		GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8;
73 
74 	/** Accepted in the <props> array of GetProgramResourceiv: */
75 	int GL_NAME_LENGTH                          = 0x92F9,
76 		GL_TYPE                                 = 0x92FA,
77 		GL_ARRAY_SIZE                           = 0x92FB,
78 		GL_OFFSET                               = 0x92FC,
79 		GL_BLOCK_INDEX                          = 0x92FD,
80 		GL_ARRAY_STRIDE                         = 0x92FE,
81 		GL_MATRIX_STRIDE                        = 0x92FF,
82 		GL_IS_ROW_MAJOR                         = 0x9300,
83 		GL_ATOMIC_COUNTER_BUFFER_INDEX          = 0x9301,
84 		GL_BUFFER_BINDING                       = 0x9302,
85 		GL_BUFFER_DATA_SIZE                     = 0x9303,
86 		GL_NUM_ACTIVE_VARIABLES                 = 0x9304,
87 		GL_ACTIVE_VARIABLES                     = 0x9305,
88 		GL_REFERENCED_BY_VERTEX_SHADER          = 0x9306,
89 		GL_REFERENCED_BY_TESS_CONTROL_SHADER    = 0x9307,
90 		GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308,
91 		GL_REFERENCED_BY_GEOMETRY_SHADER        = 0x9309,
92 		GL_REFERENCED_BY_FRAGMENT_SHADER        = 0x930A,
93 		GL_REFERENCED_BY_COMPUTE_SHADER         = 0x930B,
94 		GL_TOP_LEVEL_ARRAY_SIZE                 = 0x930C,
95 		GL_TOP_LEVEL_ARRAY_STRIDE               = 0x930D,
96 		GL_LOCATION                             = 0x930E,
97 		GL_LOCATION_INDEX                       = 0x930F,
98 		GL_IS_PER_PATCH                         = 0x92E7;
99 
100 	@Reuse("GL43")
101 	@StripPostfix("params")
glGetProgramInterfaceiv(@Luint int program, @GLenum int programInterface, @GLenum int pname, @Check(R) @OutParameter IntBuffer params)102 	void glGetProgramInterfaceiv(@GLuint int program, @GLenum int programInterface,
103 	                             @GLenum int pname, @Check("1") @OutParameter IntBuffer params);
104 
105 	@Reuse("GL43")
106 	@Alternate("glGetProgramInterfaceiv")
107 	@GLreturn("params")
108 	@StripPostfix(value = "params", hasPostfix = false)
glGetProgramInterfaceiv2(@Luint int program, @GLenum int programInterface, @GLenum int pname, @OutParameter IntBuffer params)109 	void glGetProgramInterfaceiv2(@GLuint int program, @GLenum int programInterface,
110 	                              @GLenum int pname, @OutParameter IntBuffer params);
111 
112 	@Reuse("GL43")
113 	@GLuint
glGetProgramResourceIndex(@Luint int program, @GLenum int programInterface, @NullTerminated @Const @GLchar ByteBuffer name)114 	int glGetProgramResourceIndex(@GLuint int program, @GLenum int programInterface,
115 	                              @NullTerminated @Const @GLchar ByteBuffer name);
116 
117 	@Reuse("GL43")
118 	@Alternate("glGetProgramResourceIndex")
119 	@GLuint
glGetProgramResourceIndex(@Luint int program, @GLenum int programInterface, @NullTerminated CharSequence name)120 	int glGetProgramResourceIndex(@GLuint int program, @GLenum int programInterface,
121 	                              @NullTerminated CharSequence name);
122 
123 	@Reuse("GL43")
glGetProgramResourceName(@Luint int program, @GLenum int programInterface, @GLuint int index, @AutoSize(value = R, canBeNull = true) @GLsizei int bufSize, @Check(value = R, canBeNull = true) @OutParameter @GLsizei IntBuffer length, @Check(canBeNull = true) @OutParameter @GLchar ByteBuffer name)124 	void glGetProgramResourceName(@GLuint int program, @GLenum int programInterface,
125 	                              @GLuint int index, @AutoSize(value = "name", canBeNull = true) @GLsizei int bufSize, @Check(value = "1", canBeNull = true) @OutParameter @GLsizei IntBuffer length,
126 	                              @Check(canBeNull = true) @OutParameter @GLchar ByteBuffer name);
127 
128 	@Reuse("GL43")
129 	@Alternate("glGetProgramResourceName")
130 	@GLreturn(value = "name", maxLength = "bufSize")
glGetProgramResourceName2(@Luint int program, @GLenum int programInterface, @GLuint int index, @GLsizei int bufSize, @OutParameter @GLsizei @Constant(R) IntBuffer length, @OutParameter @GLchar ByteBuffer name)131 	void glGetProgramResourceName2(@GLuint int program, @GLenum int programInterface,
132 	                               @GLuint int index, @GLsizei int bufSize,
133 	                               @OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
134 	                               @OutParameter @GLchar ByteBuffer name);
135 
136 	@Reuse("GL43")
137 	@StripPostfix("params")
glGetProgramResourceiv(@Luint int program, @GLenum int programInterface, @GLuint int index, @AutoSize(R) @GLsizei int propCount, @Const @GLenum IntBuffer props, @AutoSize(R) @GLsizei int bufSize, @Check(value = R, canBeNull = true) @OutParameter @GLsizei IntBuffer length, @OutParameter IntBuffer params)138 	void glGetProgramResourceiv(@GLuint int program, @GLenum int programInterface,
139 	                            @GLuint int index, @AutoSize("props") @GLsizei int propCount,
140 	                            @Const @GLenum IntBuffer props, @AutoSize("params") @GLsizei int bufSize,
141 	                            @Check(value = "1", canBeNull = true) @OutParameter @GLsizei IntBuffer length, @OutParameter IntBuffer params);
142 
143 	@Reuse("GL43")
glGetProgramResourceLocation(@Luint int program, @GLenum int programInterface, @NullTerminated @Const @GLchar ByteBuffer name)144 	int glGetProgramResourceLocation(@GLuint int program, @GLenum int programInterface,
145 	                                 @NullTerminated @Const @GLchar ByteBuffer name);
146 
147 	@Reuse("GL43")
148 	@Alternate("glGetProgramResourceLocation")
glGetProgramResourceLocation(@Luint int program, @GLenum int programInterface, @NullTerminated CharSequence name)149 	int glGetProgramResourceLocation(@GLuint int program, @GLenum int programInterface,
150 	                                 @NullTerminated CharSequence name);
151 
152 	@Reuse("GL43")
glGetProgramResourceLocationIndex(@Luint int program, @GLenum int programInterface, @NullTerminated @Const @GLchar ByteBuffer name)153 	int glGetProgramResourceLocationIndex(@GLuint int program, @GLenum int programInterface,
154 	                                      @NullTerminated @Const @GLchar ByteBuffer name);
155 
156 	@Reuse("GL43")
157 	@Alternate("glGetProgramResourceLocationIndex")
glGetProgramResourceLocationIndex(@Luint int program, @GLenum int programInterface, @NullTerminated CharSequence name)158 	int glGetProgramResourceLocationIndex(@GLuint int program, @GLenum int programInterface,
159 	                                      @NullTerminated CharSequence name);
160 
161 }