glapi: Make GL_ARB_direct_state_access functions exclusive to core profile
[mesa.git] / src / mapi / glapi / gen / apiexec.py
1 # Copyright (C) 2015 Intel Corporation
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 class exec_info():
23 """Information relating GL APIs to a function.
24
25 Each of the four attributes of this class, compatibility, core, es1, and
26 es2, specify the minimum API version where a function can possibly exist
27 in Mesa. The version is specified as an integer of (real GL version *
28 10). For example, glCreateProgram was added in OpenGL 2.0, so
29 compatibility=20 and core=31.
30
31 If the attribute is None, then it cannot be supported by that
32 API. For example, glNewList was removed from core profiles, so
33 compatibility=10 and core=None.
34
35 Each of the attributes that is not None must have a valid value. The
36 valid ranges are:
37
38 compatiblity: [10, 30]
39 core: [31, )
40 es1: [10, 11]
41 es2: [20, )
42
43 These ranges are enforced by the constructor.
44 """
45 def __init__(self, compatibility=None, core=None, es1=None, es2=None):
46 if compatibility is not None:
47 assert isinstance(compatibility, int)
48 assert compatibility >= 10
49 assert compatibility <= 30
50
51 if core is not None:
52 assert isinstance(core, int)
53 assert core >= 31
54
55 if es1 is not None:
56 assert isinstance(es1, int)
57 assert es1 == 10 or es1 == 11
58
59 if es2 is not None:
60 assert isinstance(es2, int)
61 assert es2 >= 20
62
63 self.compatibility = compatibility
64 self.core = core
65 self.es1 = es1
66 self.es2 = es2
67
68 functions = {
69 # OpenGL 3.1 / GL_ARB_texture_buffer_object. Mesa only exposes this
70 # extension with core profile.
71 "TexBuffer": exec_info(core=31),
72
73 # OpenGL 3.2 / GL_ARB_geometry_shader4. Mesa does not support
74 # GL_ARB_geometry_shader4, so OpenGL 3.2 is required.
75 "FramebufferTexture": exec_info(core=32),
76
77 # OpenGL 4.0 / GL_ARB_gpu_shader_fp64. The extension spec says:
78 #
79 # "OpenGL 3.2 and GLSL 1.50 are required."
80 "Uniform1d": exec_info(core=32),
81 "Uniform2d": exec_info(core=32),
82 "Uniform3d": exec_info(core=32),
83 "Uniform4d": exec_info(core=32),
84 "Uniform1dv": exec_info(core=32),
85 "Uniform2dv": exec_info(core=32),
86 "Uniform3dv": exec_info(core=32),
87 "Uniform4dv": exec_info(core=32),
88 "UniformMatrix2dv": exec_info(core=32),
89 "UniformMatrix3dv": exec_info(core=32),
90 "UniformMatrix4dv": exec_info(core=32),
91 "UniformMatrix2x3dv": exec_info(core=32),
92 "UniformMatrix2x4dv": exec_info(core=32),
93 "UniformMatrix3x2dv": exec_info(core=32),
94 "UniformMatrix3x4dv": exec_info(core=32),
95 "UniformMatrix4x2dv": exec_info(core=32),
96 "UniformMatrix4x3dv": exec_info(core=32),
97 "GetUniformdv": exec_info(core=32),
98
99 # OpenGL 4.1 / GL_ARB_vertex_attrib_64bit. The extension spec says:
100 #
101 # "OpenGL 3.0 and GLSL 1.30 are required.
102 #
103 # ARB_gpu_shader_fp64 (or equivalent functionality) is required."
104 #
105 # For Mesa this effectively means OpenGL 3.2 is required. It seems
106 # unlikely that Mesa will ever get support for any of the NV extensions
107 # that add "equivalent functionality."
108 "VertexAttribL1d": exec_info(core=32),
109 "VertexAttribL2d": exec_info(core=32),
110 "VertexAttribL3d": exec_info(core=32),
111 "VertexAttribL4d": exec_info(core=32),
112 "VertexAttribL1dv": exec_info(core=32),
113 "VertexAttribL2dv": exec_info(core=32),
114 "VertexAttribL3dv": exec_info(core=32),
115 "VertexAttribL4dv": exec_info(core=32),
116 "VertexAttribLPointer": exec_info(core=32),
117 "GetVertexAttribLdv": exec_info(core=32),
118
119 # OpenGL 4.1 / GL_ARB_viewport_array. The extension spec says:
120 #
121 # "OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4
122 # extensions are required."
123 #
124 # Mesa does not support either of the geometry shader extensions, so
125 # OpenGL 3.2 is required.
126 "ViewportArrayv": exec_info(core=32),
127 "ViewportIndexedf": exec_info(core=32),
128 "ViewportIndexedfv": exec_info(core=32),
129 "ScissorArrayv": exec_info(core=32),
130 "ScissorIndexed": exec_info(core=32),
131 "ScissorIndexedv": exec_info(core=32),
132 "DepthRangeArrayv": exec_info(core=32),
133 "DepthRangeIndexed": exec_info(core=32),
134 # GetFloati_v also GL_ARB_shader_atomic_counters
135 # GetDoublei_v also GL_ARB_shader_atomic_counters
136
137 # OpenGL 4.3 / GL_ARB_texture_buffer_range. Mesa can expose the extension
138 # with OpenGL 3.1.
139 "TexBufferRange": exec_info(core=31),
140
141 # OpenGL 4.5 / GL_ARB_direct_state_access. Mesa can expose the extension
142 # with core profile.
143 "CreateTransformFeedbacks": exec_info(core=31),
144 "TransformFeedbackBufferBase": exec_info(core=31),
145 "TransformFeedbackBufferRange": exec_info(core=31),
146 "GetTransformFeedbackiv": exec_info(core=31),
147 "GetTransformFeedbacki_v": exec_info(core=31),
148 "GetTransformFeedbacki64_v": exec_info(core=31),
149 "CreateBuffers": exec_info(core=31),
150 "NamedBufferStorage": exec_info(core=31),
151 "NamedBufferData": exec_info(core=31),
152 "NamedBufferSubData": exec_info(core=31),
153 "CopyNamedBufferSubData": exec_info(core=31),
154 "ClearNamedBufferData": exec_info(core=31),
155 "ClearNamedBufferSubData": exec_info(core=31),
156 "MapNamedBuffer": exec_info(core=31),
157 "MapNamedBufferRange": exec_info(core=31),
158 "UnmapNamedBuffer": exec_info(core=31),
159 "FlushMappedNamedBufferRange": exec_info(core=31),
160 "GetNamedBufferParameteriv": exec_info(core=31),
161 "GetNamedBufferParameteri64v": exec_info(core=31),
162 "GetNamedBufferPointerv": exec_info(core=31),
163 "GetNamedBufferSubData": exec_info(core=31),
164 "CreateFramebuffers": exec_info(core=31),
165 "NamedFramebufferRenderbuffer": exec_info(core=31),
166 "NamedFramebufferParameteri": exec_info(core=31),
167 "NamedFramebufferTexture": exec_info(core=31),
168 "NamedFramebufferTextureLayer": exec_info(core=31),
169 "NamedFramebufferDrawBuffer": exec_info(core=31),
170 "NamedFramebufferDrawBuffers": exec_info(core=31),
171 "NamedFramebufferReadBuffer": exec_info(core=31),
172 "InvalidateNamedFramebufferData": exec_info(core=31),
173 "InvalidateNamedFramebufferSubData": exec_info(core=31),
174 "ClearNamedFramebufferiv": exec_info(core=31),
175 "ClearNamedFramebufferuiv": exec_info(core=31),
176 "ClearNamedFramebufferfv": exec_info(core=31),
177 "ClearNamedFramebufferfi": exec_info(core=31),
178 "BlitNamedFramebuffer": exec_info(core=31),
179 "CheckNamedFramebufferStatus": exec_info(core=31),
180 "GetNamedFramebufferParameteriv": exec_info(core=31),
181 "GetNamedFramebufferAttachmentParameteriv": exec_info(core=31),
182 "CreateRenderbuffers": exec_info(core=31),
183 "NamedRenderbufferStorage": exec_info(core=31),
184 "NamedRenderbufferStorageMultisample": exec_info(core=31),
185 "GetNamedRenderbufferParameteriv": exec_info(core=31),
186 "CreateTextures": exec_info(core=31),
187 "TextureBuffer": exec_info(core=31),
188 "TextureBufferRange": exec_info(core=31),
189 "TextureStorage1D": exec_info(core=31),
190 "TextureStorage2D": exec_info(core=31),
191 "TextureStorage3D": exec_info(core=31),
192 "TextureStorage2DMultisample": exec_info(core=31),
193 "TextureStorage3DMultisample": exec_info(core=31),
194 "TextureSubImage1D": exec_info(core=31),
195 "TextureSubImage2D": exec_info(core=31),
196 "TextureSubImage3D": exec_info(core=31),
197 "CompressedTextureSubImage1D": exec_info(core=31),
198 "CompressedTextureSubImage2D": exec_info(core=31),
199 "CompressedTextureSubImage3D": exec_info(core=31),
200 "CopyTextureSubImage1D": exec_info(core=31),
201 "CopyTextureSubImage2D": exec_info(core=31),
202 "CopyTextureSubImage3D": exec_info(core=31),
203 "TextureParameterf": exec_info(core=31),
204 "TextureParameterfv": exec_info(core=31),
205 "TextureParameteri": exec_info(core=31),
206 "TextureParameterIiv": exec_info(core=31),
207 "TextureParameterIuiv": exec_info(core=31),
208 "TextureParameteriv": exec_info(core=31),
209 "GenerateTextureMipmap": exec_info(core=31),
210 "BindTextureUnit": exec_info(core=31),
211 "GetTextureImage": exec_info(core=31),
212 "GetCompressedTextureImage": exec_info(core=31),
213 "GetTextureLevelParameterfv": exec_info(core=31),
214 "GetTextureLevelParameteriv": exec_info(core=31),
215 "GetTextureParameterfv": exec_info(core=31),
216 "GetTextureParameterIiv": exec_info(core=31),
217 "GetTextureParameterIuiv": exec_info(core=31),
218 "GetTextureParameteriv": exec_info(core=31),
219 "CreateVertexArrays": exec_info(core=31),
220 "DisableVertexArrayAttrib": exec_info(core=31),
221 "EnableVertexArrayAttrib": exec_info(core=31),
222 "VertexArrayElementBuffer": exec_info(core=31),
223 "VertexArrayVertexBuffer": exec_info(core=31),
224 "VertexArrayVertexBuffers": exec_info(core=31),
225 "VertexArrayAttribFormat": exec_info(core=31),
226 "VertexArrayAttribIFormat": exec_info(core=31),
227 "VertexArrayAttribLFormat": exec_info(core=31),
228 "VertexArrayAttribBinding": exec_info(core=31),
229 "VertexArrayBindingDivisor": exec_info(core=31),
230 "GetVertexArrayiv": exec_info(core=31),
231 "GetVertexArrayIndexediv": exec_info(core=31),
232 "GetVertexArrayIndexed64iv": exec_info(core=31),
233 "CreateSamplers": exec_info(core=31),
234 "CreateProgramPipelines": exec_info(core=31),
235 "CreateQueries": exec_info(core=31),
236 "GetQueryBufferObjectiv": exec_info(core=31),
237 "GetQueryBufferObjectuiv": exec_info(core=31),
238 "GetQueryBufferObjecti64v": exec_info(core=31),
239 "GetQueryBufferObjectui64v": exec_info(core=31),
240 }