1 /*
2  * Copyright (c) 2002-2011 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.Buffer;
38 import java.nio.IntBuffer;
39 
40 public interface GL42 {
41 
42 	// ----------------------------------------------------------------------------
43 	// ----------------------[ ARB_texture_compression_bptc ]----------------------
44 	// ----------------------------------------------------------------------------
45 
46 	/**
47 	 * Accepted by the <internalformat> parameter of TexImage2D, TexImage3D,
48 	 * CopyTexImage2D, CopyTexImage3D, CompressedTexImage2DARB, and
49 	 * CompressedTexImage3DARB and the <format> parameter of
50 	 * CompressedTexSubImage2DARB and CompressedTexSubImage3DARB:
51 	 */
52 	int GL_COMPRESSED_RGBA_BPTC_UNORM         = 0x8E8C;
53 	int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM   = 0x8E8D;
54 	int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT   = 0x8E8E;
55 	int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F;
56 
57 	// ------------------------------------------------------------------------------------
58 	// ----------------------[ ARB_compressed_texture_pixel_storage ]----------------------
59 	// ------------------------------------------------------------------------------------
60 
61 	/**
62 	 * Accepted by the <pname> parameter of PixelStore[fi], GetBooleanv,
63 	 * GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev:
64 	 */
65 	int GL_UNPACK_COMPRESSED_BLOCK_WIDTH  = 0x9127,
66 		GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128,
67 		GL_UNPACK_COMPRESSED_BLOCK_DEPTH  = 0x9129,
68 		GL_UNPACK_COMPRESSED_BLOCK_SIZE   = 0x912A,
69 		GL_PACK_COMPRESSED_BLOCK_WIDTH    = 0x912B,
70 		GL_PACK_COMPRESSED_BLOCK_HEIGHT   = 0x912C,
71 		GL_PACK_COMPRESSED_BLOCK_DEPTH    = 0x912D,
72 		GL_PACK_COMPRESSED_BLOCK_SIZE     = 0x912E;
73 
74 	// --------------------------------------------------------------------------
75 	// ----------------------[ ARB_shader_atomic_counters ]----------------------
76 	// --------------------------------------------------------------------------
77 
78 	/** Accepted by the <target> parameter of BindBufferBase and BindBufferRange: */
79 	int GL_ATOMIC_COUNTER_BUFFER = 0x92C0;
80 
81 	/**
82 	 * Accepted by the <pname> parameter of GetBooleani_v, GetIntegeri_v,
83 	 * GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv,
84 	 * GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv:
85 	 */
86 	int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1;
87 
88 	/** Accepted by the <pname> parameter of GetIntegeri_64v: */
89 	int GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2,
90 		GL_ATOMIC_COUNTER_BUFFER_SIZE  = 0x92C3;
91 
92 	/** Accepted by the <pname> parameter of GetActiveAtomicCounterBufferiv: */
93 	int GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE                            = 0x92C4,
94 		GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS               = 0x92C5,
95 		GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES        = 0x92C6,
96 		GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER          = 0x92C7,
97 		GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER    = 0x92C8,
98 		GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9,
99 		GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER        = 0x92CA,
100 		GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER        = 0x92CB;
101 
102 	/**
103 	 * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
104 	 * GetInteger64v, GetFloatv, and GetDoublev:
105 	 */
106 	int GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS          = 0x92CC,
107 		GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS    = 0x92CD,
108 		GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE,
109 		GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS        = 0x92CF,
110 		GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS        = 0x92D0,
111 		GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS        = 0x92D1,
112 		GL_MAX_VERTEX_ATOMIC_COUNTERS                 = 0x92D2,
113 		GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS           = 0x92D3,
114 		GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS        = 0x92D4,
115 		GL_MAX_GEOMETRY_ATOMIC_COUNTERS               = 0x92D5,
116 		GL_MAX_FRAGMENT_ATOMIC_COUNTERS               = 0x92D6,
117 		GL_MAX_COMBINED_ATOMIC_COUNTERS               = 0x92D7,
118 		GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE             = 0x92D8,
119 		GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS         = 0x92DC;
120 
121 	/** Accepted by the <pname> parameter of GetProgramiv: */
122 	int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9;
123 
124 	/** Accepted by the <pname> parameter of GetActiveUniformsiv: */
125 	int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA;
126 
127 	/** Returned in <params> by GetActiveUniform and GetActiveUniformsiv: */
128 	int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB;
129 
130 	@StripPostfix("params")
glGetActiveAtomicCounterBufferiv(@Luint int program, @GLuint int bufferIndex, @GLenum int pname, @Check(R) @OutParameter IntBuffer params)131 	void glGetActiveAtomicCounterBufferiv(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @Check("1") @OutParameter IntBuffer params);
132 
133 	@Alternate("glGetActiveAtomicCounterBufferiv")
134 	@StripPostfix("params")
135 	@GLreturn("params")
glGetActiveAtomicCounterBufferiv2(@Luint int program, @GLuint int bufferIndex, @GLenum int pname, @OutParameter IntBuffer params)136 	void glGetActiveAtomicCounterBufferiv2(@GLuint int program, @GLuint int bufferIndex, @GLenum int pname, @OutParameter IntBuffer params);
137 
138 	// -------------------------------------------------------------------
139 	// ----------------------[ ARB_texture_storage ]----------------------
140 	// -------------------------------------------------------------------
141 
142 	/** Accepted by the <value> parameter of GetTexParameter{if}v: */
143 	int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F;
144 
glTexStorage1D(@Lenum int target, @GLsizei int levels, @GLenum int internalformat, @GLsizei int width)145 	void glTexStorage1D(@GLenum int target, @GLsizei int levels,
146 	                    @GLenum int internalformat,
147 	                    @GLsizei int width);
148 
glTexStorage2D(@Lenum int target, @GLsizei int levels, @GLenum int internalformat, @GLsizei int width, @GLsizei int height)149 	void glTexStorage2D(@GLenum int target, @GLsizei int levels,
150 	                    @GLenum int internalformat,
151 	                    @GLsizei int width, @GLsizei int height);
152 
glTexStorage3D(@Lenum int target, @GLsizei int levels, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLsizei int depth)153 	void glTexStorage3D(@GLenum int target, @GLsizei int levels,
154 	                    @GLenum int internalformat,
155 	                    @GLsizei int width, @GLsizei int height, @GLsizei int depth);
156 
157 	// --------------------------------------------------------------------------------
158 	// ----------------------[ ARB_transform_feedback_instanced ]----------------------
159 	// --------------------------------------------------------------------------------
160 
glDrawTransformFeedbackInstanced(@Lenum int mode, @GLuint int id, @GLsizei int primcount)161 	void glDrawTransformFeedbackInstanced(@GLenum int mode, @GLuint int id, @GLsizei int primcount);
162 
glDrawTransformFeedbackStreamInstanced(@Lenum int mode, @GLuint int id, @GLuint int stream, @GLsizei int primcount)163 	void glDrawTransformFeedbackStreamInstanced(@GLenum int mode, @GLuint int id, @GLuint int stream, @GLsizei int primcount);
164 
165 	// -----------------------------------------------------------------
166 	// ----------------------[ ARB_base_instance ]----------------------
167 	// -----------------------------------------------------------------
168 
glDrawArraysInstancedBaseInstance(@Lenum int mode, int first, @GLsizei int count, @GLsizei int primcount, @GLuint int baseinstance)169 	void glDrawArraysInstancedBaseInstance(@GLenum int mode,
170 	                                       int first,
171 	                                       @GLsizei int count,
172 	                                       @GLsizei int primcount,
173 	                                       @GLuint int baseinstance);
174 
glDrawElementsInstancedBaseInstance(@Lenum int mode, @AutoSize(R) @GLsizei int count, @AutoType(R) @GLenum int type, @Const @BufferObject(BufferKind.ElementVBO) @GLubyte @GLushort @GLuint Buffer indices, @GLsizei int primcount, @GLuint int baseinstance)175 	void glDrawElementsInstancedBaseInstance(@GLenum int mode,
176 	                                         @AutoSize("indices") @GLsizei int count,
177 	                                         @AutoType("indices") @GLenum int type,
178 	                                         @Const
179 	                                         @BufferObject(BufferKind.ElementVBO)
180 	                                         @GLubyte
181 	                                         @GLushort
182 	                                         @GLuint Buffer indices,
183 	                                         @GLsizei int primcount,
184 	                                         @GLuint int baseinstance);
185 
glDrawElementsInstancedBaseVertexBaseInstance(@Lenum int mode, @AutoSize(R) @GLsizei int count, @AutoType(R) @GLenum int type, @Const @BufferObject(BufferKind.ElementVBO) @GLubyte @GLushort @GLuint Buffer indices, @GLsizei int primcount, int basevertex, @GLuint int baseinstance)186 	void glDrawElementsInstancedBaseVertexBaseInstance(@GLenum int mode,
187 	                                                   @AutoSize("indices") @GLsizei int count,
188 	                                                   @AutoType("indices") @GLenum int type,
189 	                                                   @Const
190 	                                                   @BufferObject(BufferKind.ElementVBO)
191 	                                                   @GLubyte
192 	                                                   @GLushort
193 	                                                   @GLuint Buffer indices,
194 	                                                   @GLsizei int primcount,
195 	                                                   int basevertex,
196 	                                                   @GLuint int baseinstance);
197 
198 	// ---------------------------------------------------------------------------
199 	// ----------------------[ ARB_shader_image_load_store ]----------------------
200 	// ---------------------------------------------------------------------------
201 
202 	/**
203 	 * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
204 	 * GetFloatv, GetDoublev, and GetInteger64v:
205 	 */
206 	int GL_MAX_IMAGE_UNITS                               = 0x8F38,
207 		GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39,
208 		GL_MAX_IMAGE_SAMPLES                             = 0x906D,
209 		GL_MAX_VERTEX_IMAGE_UNIFORMS                     = 0x90CA,
210 		GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS               = 0x90CB,
211 		GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS            = 0x90CC,
212 		GL_MAX_GEOMETRY_IMAGE_UNIFORMS                   = 0x90CD,
213 		GL_MAX_FRAGMENT_IMAGE_UNIFORMS                   = 0x90CE,
214 		GL_MAX_COMBINED_IMAGE_UNIFORMS                   = 0x90CF;
215 
216 	/** Accepted by the <target> parameter of GetIntegeri_v and GetBooleani_v: */
217 	int GL_IMAGE_BINDING_NAME    = 0x8F3A,
218 		GL_IMAGE_BINDING_LEVEL   = 0x8F3B,
219 		GL_IMAGE_BINDING_LAYERED = 0x8F3C,
220 		GL_IMAGE_BINDING_LAYER   = 0x8F3D,
221 		GL_IMAGE_BINDING_ACCESS  = 0x8F3E,
222 		GL_IMAGE_BINDING_FORMAT  = 0x906E;
223 
224 	/** Accepted by the <barriers> parameter of MemoryBarrier: */
225 	int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001,
226 		GL_ELEMENT_ARRAY_BARRIER_BIT       = 0x00000002,
227 		GL_UNIFORM_BARRIER_BIT             = 0x00000004,
228 		GL_TEXTURE_FETCH_BARRIER_BIT       = 0x00000008,
229 		GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020,
230 		GL_COMMAND_BARRIER_BIT             = 0x00000040,
231 		GL_PIXEL_BUFFER_BARRIER_BIT        = 0x00000080,
232 		GL_TEXTURE_UPDATE_BARRIER_BIT      = 0x00000100,
233 		GL_BUFFER_UPDATE_BARRIER_BIT       = 0x00000200,
234 		GL_FRAMEBUFFER_BARRIER_BIT         = 0x00000400,
235 		GL_TRANSFORM_FEEDBACK_BARRIER_BIT  = 0x00000800,
236 		GL_ATOMIC_COUNTER_BARRIER_BIT      = 0x00001000,
237 		GL_ALL_BARRIER_BITS                = 0xFFFFFFFF;
238 
239 	/** Returned by the <type> parameter of GetActiveUniform: */
240 	int GL_IMAGE_1D                                = 0x904C,
241 		GL_IMAGE_2D                                = 0x904D,
242 		GL_IMAGE_3D                                = 0x904E,
243 		GL_IMAGE_2D_RECT                           = 0x904F,
244 		GL_IMAGE_CUBE                              = 0x9050,
245 		GL_IMAGE_BUFFER                            = 0x9051,
246 		GL_IMAGE_1D_ARRAY                          = 0x9052,
247 		GL_IMAGE_2D_ARRAY                          = 0x9053,
248 		GL_IMAGE_CUBE_MAP_ARRAY                    = 0x9054,
249 		GL_IMAGE_2D_MULTISAMPLE                    = 0x9055,
250 		GL_IMAGE_2D_MULTISAMPLE_ARRAY              = 0x9056,
251 		GL_INT_IMAGE_1D                            = 0x9057,
252 		GL_INT_IMAGE_2D                            = 0x9058,
253 		GL_INT_IMAGE_3D                            = 0x9059,
254 		GL_INT_IMAGE_2D_RECT                       = 0x905A,
255 		GL_INT_IMAGE_CUBE                          = 0x905B,
256 		GL_INT_IMAGE_BUFFER                        = 0x905C,
257 		GL_INT_IMAGE_1D_ARRAY                      = 0x905D,
258 		GL_INT_IMAGE_2D_ARRAY                      = 0x905E,
259 		GL_INT_IMAGE_CUBE_MAP_ARRAY                = 0x905F,
260 		GL_INT_IMAGE_2D_MULTISAMPLE                = 0x9060,
261 		GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY          = 0x9061,
262 		GL_UNSIGNED_INT_IMAGE_1D                   = 0x9062,
263 		GL_UNSIGNED_INT_IMAGE_2D                   = 0x9063,
264 		GL_UNSIGNED_INT_IMAGE_3D                   = 0x9064,
265 		GL_UNSIGNED_INT_IMAGE_2D_RECT              = 0x9065,
266 		GL_UNSIGNED_INT_IMAGE_CUBE                 = 0x9066,
267 		GL_UNSIGNED_INT_IMAGE_BUFFER               = 0x9067,
268 		GL_UNSIGNED_INT_IMAGE_1D_ARRAY             = 0x9068,
269 		GL_UNSIGNED_INT_IMAGE_2D_ARRAY             = 0x9069,
270 		GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY       = 0x906A,
271 		GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE       = 0x906B,
272 		GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C;
273 
274 	/**
275 	 * Accepted by the <value> parameter of GetTexParameteriv, GetTexParameterfv,
276 	 * GetTexParameterIiv, and GetTexParameterIuiv:
277 	 */
278 	int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7;
279 
280 	/**
281 	 * Returned in the <data> parameter of GetTexParameteriv, GetTexParameterfv,
282 	 * GetTexParameterIiv, and GetTexParameterIuiv when <value> is
283 	 * IMAGE_FORMAT_COMPATIBILITY_TYPE:
284 	 */
285 	int GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8,
286 		IMAGE_FORMAT_COMPATIBILITY_BY_CLASS   = 0x90C9;
287 
glBindImageTexture(@Luint int unit, @GLuint int texture, int level, boolean layered, int layer, @GLenum int access, @GLenum int format)288 	void glBindImageTexture(@GLuint int unit, @GLuint int texture, int level,
289 	                        boolean layered, int layer, @GLenum int access,
290 	                        @GLenum int format);
291 
glMemoryBarrier(@Lbitfield int barriers)292 	void glMemoryBarrier(@GLbitfield int barriers);
293 
294 	// -------------------------------------------------------------------------
295 	// ----------------------[ ARB_internal_format_query ]----------------------
296 	// -------------------------------------------------------------------------
297 
298 	/** Accepted by the <pname> parameter of GetInternalformativ: */
299 	int GL_NUM_SAMPLE_COUNTS = 0x9380;
300 
301 	@StripPostfix("params")
glGetInternalformativ(@Lenum int target, @GLenum int internalformat, @GLenum int pname, @AutoSize(R) @GLsizei int bufSize, @OutParameter IntBuffer params)302 	void glGetInternalformativ(@GLenum int target, @GLenum int internalformat,
303 	                           @GLenum int pname, @AutoSize("params") @GLsizei int bufSize, @OutParameter IntBuffer params);
304 
305 	@Alternate("glGetInternalformativ")
306 	@StripPostfix("params")
307 	@GLreturn("params")
glGetInternalformativ2(@Lenum int target, @GLenum int internalformat, @GLenum int pname, @Constant(R) @GLsizei int bufSize, @OutParameter IntBuffer params)308 	void glGetInternalformativ2(@GLenum int target, @GLenum int internalformat,
309 	                            @GLenum int pname, @Constant("1") @GLsizei int bufSize, @OutParameter IntBuffer params);
310 
311 	// ------------------------------------------------------------------------
312 	// ----------------------[ ARB_map_buffer_alignment ]----------------------
313 	// ------------------------------------------------------------------------
314 
315 	/**
316 	 * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
317 	 * GetInteger64v, GetFloatv, and GetDoublev:
318 	 */
319 	int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC;
320 
321 }