1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml.
3 //
4 // Copyright 2019 The ANGLE Project Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style license that can be
6 // found in the LICENSE file.
7 //
8 // entry_points_gl_4_4_autogen.cpp:
9 // Defines the GL 4.4 entry points.
10
11 #include "libGL/entry_points_gl_4_4_autogen.h"
12
13 #include "libANGLE/Context.h"
14 #include "libANGLE/Context.inl.h"
15 #include "libANGLE/entry_points_utils.h"
16 #include "libANGLE/gl_enum_utils_autogen.h"
17 #include "libANGLE/validationEGL.h"
18 #include "libANGLE/validationES.h"
19 #include "libANGLE/validationES1.h"
20 #include "libANGLE/validationES2.h"
21 #include "libANGLE/validationES3.h"
22 #include "libANGLE/validationES31.h"
23 #include "libANGLE/validationESEXT.h"
24 #include "libANGLE/validationGL44_autogen.h"
25 #include "libGLESv2/global_state.h"
26
27 namespace gl
28 {
BindBuffersBase(GLenum target,GLuint first,GLsizei count,const GLuint * buffers)29 void GL_APIENTRY BindBuffersBase(GLenum target, GLuint first, GLsizei count, const GLuint *buffers)
30 {
31 EVENT(
32 "(GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint *buffers = "
33 "0x%016" PRIxPTR ")",
34 GLenumToString(GLenumGroup::BufferTargetARB, target), first, count, (uintptr_t)buffers);
35
36 Context *context = GetValidGlobalContext();
37 if (context)
38 {
39 const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
40 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
41 bool isCallValid = (context->skipValidation() ||
42 ValidateBindBuffersBase(context, target, first, count, buffersPacked));
43 if (isCallValid)
44 {
45 context->bindBuffersBase(target, first, count, buffersPacked);
46 }
47 ANGLE_CAPTURE(BindBuffersBase, isCallValid, context, target, first, count, buffersPacked);
48 }
49 }
50
BindBuffersRange(GLenum target,GLuint first,GLsizei count,const GLuint * buffers,const GLintptr * offsets,const GLsizeiptr * sizes)51 void GL_APIENTRY BindBuffersRange(GLenum target,
52 GLuint first,
53 GLsizei count,
54 const GLuint *buffers,
55 const GLintptr *offsets,
56 const GLsizeiptr *sizes)
57 {
58 EVENT(
59 "(GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint *buffers = "
60 "0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
61 ", const GLsizeiptr *sizes = 0x%016" PRIxPTR ")",
62 GLenumToString(GLenumGroup::BufferTargetARB, target), first, count, (uintptr_t)buffers,
63 (uintptr_t)offsets, (uintptr_t)sizes);
64
65 Context *context = GetValidGlobalContext();
66 if (context)
67 {
68 const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
69 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
70 bool isCallValid =
71 (context->skipValidation() || ValidateBindBuffersRange(context, target, first, count,
72 buffersPacked, offsets, sizes));
73 if (isCallValid)
74 {
75 context->bindBuffersRange(target, first, count, buffersPacked, offsets, sizes);
76 }
77 ANGLE_CAPTURE(BindBuffersRange, isCallValid, context, target, first, count, buffersPacked,
78 offsets, sizes);
79 }
80 }
81
BindImageTextures(GLuint first,GLsizei count,const GLuint * textures)82 void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
83 {
84 EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *textures = 0x%016" PRIxPTR ")",
85 first, count, (uintptr_t)textures);
86
87 Context *context = GetValidGlobalContext();
88 if (context)
89 {
90 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
91 bool isCallValid = (context->skipValidation() ||
92 ValidateBindImageTextures(context, first, count, textures));
93 if (isCallValid)
94 {
95 context->bindImageTextures(first, count, textures);
96 }
97 ANGLE_CAPTURE(BindImageTextures, isCallValid, context, first, count, textures);
98 }
99 }
100
BindSamplers(GLuint first,GLsizei count,const GLuint * samplers)101 void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
102 {
103 EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *samplers = 0x%016" PRIxPTR ")",
104 first, count, (uintptr_t)samplers);
105
106 Context *context = GetValidGlobalContext();
107 if (context)
108 {
109 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
110 bool isCallValid =
111 (context->skipValidation() || ValidateBindSamplers(context, first, count, samplers));
112 if (isCallValid)
113 {
114 context->bindSamplers(first, count, samplers);
115 }
116 ANGLE_CAPTURE(BindSamplers, isCallValid, context, first, count, samplers);
117 }
118 }
119
BindTextures(GLuint first,GLsizei count,const GLuint * textures)120 void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *textures)
121 {
122 EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *textures = 0x%016" PRIxPTR ")",
123 first, count, (uintptr_t)textures);
124
125 Context *context = GetValidGlobalContext();
126 if (context)
127 {
128 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
129 bool isCallValid =
130 (context->skipValidation() || ValidateBindTextures(context, first, count, textures));
131 if (isCallValid)
132 {
133 context->bindTextures(first, count, textures);
134 }
135 ANGLE_CAPTURE(BindTextures, isCallValid, context, first, count, textures);
136 }
137 }
138
BindVertexBuffers(GLuint first,GLsizei count,const GLuint * buffers,const GLintptr * offsets,const GLsizei * strides)139 void GL_APIENTRY BindVertexBuffers(GLuint first,
140 GLsizei count,
141 const GLuint *buffers,
142 const GLintptr *offsets,
143 const GLsizei *strides)
144 {
145 EVENT("(GLuint first = %u, GLsizei count = %d, const GLuint *buffers = 0x%016" PRIxPTR
146 ", const GLintptr *offsets = 0x%016" PRIxPTR ", const GLsizei *strides = 0x%016" PRIxPTR
147 ")",
148 first, count, (uintptr_t)buffers, (uintptr_t)offsets, (uintptr_t)strides);
149
150 Context *context = GetValidGlobalContext();
151 if (context)
152 {
153 const BufferID *buffersPacked = FromGL<const BufferID *>(buffers);
154 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
155 bool isCallValid =
156 (context->skipValidation() ||
157 ValidateBindVertexBuffers(context, first, count, buffersPacked, offsets, strides));
158 if (isCallValid)
159 {
160 context->bindVertexBuffers(first, count, buffersPacked, offsets, strides);
161 }
162 ANGLE_CAPTURE(BindVertexBuffers, isCallValid, context, first, count, buffersPacked, offsets,
163 strides);
164 }
165 }
166
BufferStorage(GLenum target,GLsizeiptr size,const void * data,GLbitfield flags)167 void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)
168 {
169 EVENT("(GLenum target = %s, GLsizeiptr size = %llu, const void *data = 0x%016" PRIxPTR
170 ", GLbitfield flags = %s)",
171 GLenumToString(GLenumGroup::BufferStorageTarget, target),
172 static_cast<unsigned long long>(size), (uintptr_t)data,
173 GLbitfieldToString(GLenumGroup::MapBufferUsageMask, flags).c_str());
174
175 Context *context = GetValidGlobalContext();
176 if (context)
177 {
178 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
179 bool isCallValid = (context->skipValidation() ||
180 ValidateBufferStorage(context, target, size, data, flags));
181 if (isCallValid)
182 {
183 context->bufferStorage(target, size, data, flags);
184 }
185 ANGLE_CAPTURE(BufferStorage, isCallValid, context, target, size, data, flags);
186 }
187 }
188
189 void GL_APIENTRY
ClearTexImage(GLuint texture,GLint level,GLenum format,GLenum type,const void * data)190 ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const void *data)
191 {
192 EVENT(
193 "(GLuint texture = %u, GLint level = %d, GLenum format = %s, GLenum type = %s, const void "
194 "*data = 0x%016" PRIxPTR ")",
195 texture, level, GLenumToString(GLenumGroup::PixelFormat, format),
196 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
197
198 Context *context = GetValidGlobalContext();
199 if (context)
200 {
201 TextureID texturePacked = FromGL<TextureID>(texture);
202 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
203 bool isCallValid =
204 (context->skipValidation() ||
205 ValidateClearTexImage(context, texturePacked, level, format, type, data));
206 if (isCallValid)
207 {
208 context->clearTexImage(texturePacked, level, format, type, data);
209 }
210 ANGLE_CAPTURE(ClearTexImage, isCallValid, context, texturePacked, level, format, type,
211 data);
212 }
213 }
214
ClearTexSubImage(GLuint texture,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const void * data)215 void GL_APIENTRY ClearTexSubImage(GLuint texture,
216 GLint level,
217 GLint xoffset,
218 GLint yoffset,
219 GLint zoffset,
220 GLsizei width,
221 GLsizei height,
222 GLsizei depth,
223 GLenum format,
224 GLenum type,
225 const void *data)
226 {
227 EVENT(
228 "(GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset = %d, GLint "
229 "zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, GLenum format "
230 "= %s, GLenum type = %s, const void *data = 0x%016" PRIxPTR ")",
231 texture, level, xoffset, yoffset, zoffset, width, height, depth,
232 GLenumToString(GLenumGroup::PixelFormat, format),
233 GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
234
235 Context *context = GetValidGlobalContext();
236 if (context)
237 {
238 TextureID texturePacked = FromGL<TextureID>(texture);
239 std::unique_lock<std::mutex> shareContextLock = GetShareGroupLock(context);
240 bool isCallValid =
241 (context->skipValidation() ||
242 ValidateClearTexSubImage(context, texturePacked, level, xoffset, yoffset, zoffset,
243 width, height, depth, format, type, data));
244 if (isCallValid)
245 {
246 context->clearTexSubImage(texturePacked, level, xoffset, yoffset, zoffset, width,
247 height, depth, format, type, data);
248 }
249 ANGLE_CAPTURE(ClearTexSubImage, isCallValid, context, texturePacked, level, xoffset,
250 yoffset, zoffset, width, height, depth, format, type, data);
251 }
252 }
253 } // namespace gl
254