• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // GENERATED FILE - DO NOT EDIT.
2 // Generated by generate_entry_points.py using data from gl.xml.
3 //
4 // Copyright 2020 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.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/validationES32.h"
24 #include "libANGLE/validationESEXT.h"
25 #include "libANGLE/validationGL44_autogen.h"
26 #include "libGLESv2/global_state.h"
27 
28 namespace gl
29 {
BindBuffersBase(GLenum target,GLuint first,GLsizei count,const GLuint * buffers)30 void GL_APIENTRY BindBuffersBase(GLenum target, GLuint first, GLsizei count, const GLuint *buffers)
31 {
32     Context *context = GetValidGlobalContext();
33     EVENT("glBindBuffersBase",
34           "context = %d, GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint "
35           "*buffers = 0x%016" PRIxPTR "",
36           CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target), first, count,
37           (uintptr_t)buffers);
38 
39     if (context)
40     {
41         const BufferID *buffersPacked                         = FromGL<const BufferID *>(buffers);
42         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
43         bool isCallValid                                      = (context->skipValidation() ||
44                             ValidateBindBuffersBase(context, target, first, count, buffersPacked));
45         if (isCallValid)
46         {
47             context->bindBuffersBase(target, first, count, buffersPacked);
48         }
49         ANGLE_CAPTURE(BindBuffersBase, isCallValid, context, target, first, count, buffersPacked);
50     }
51 }
52 
BindBuffersRange(GLenum target,GLuint first,GLsizei count,const GLuint * buffers,const GLintptr * offsets,const GLsizeiptr * sizes)53 void GL_APIENTRY BindBuffersRange(GLenum target,
54                                   GLuint first,
55                                   GLsizei count,
56                                   const GLuint *buffers,
57                                   const GLintptr *offsets,
58                                   const GLsizeiptr *sizes)
59 {
60     Context *context = GetValidGlobalContext();
61     EVENT("glBindBuffersRange",
62           "context = %d, GLenum target = %s, GLuint first = %u, GLsizei count = %d, const GLuint "
63           "*buffers = 0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
64           ", const GLsizeiptr *sizes = 0x%016" PRIxPTR "",
65           CID(context), GLenumToString(GLenumGroup::BufferTargetARB, target), first, count,
66           (uintptr_t)buffers, (uintptr_t)offsets, (uintptr_t)sizes);
67 
68     if (context)
69     {
70         const BufferID *buffersPacked                         = FromGL<const BufferID *>(buffers);
71         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
72         bool isCallValid =
73             (context->skipValidation() || ValidateBindBuffersRange(context, target, first, count,
74                                                                    buffersPacked, offsets, sizes));
75         if (isCallValid)
76         {
77             context->bindBuffersRange(target, first, count, buffersPacked, offsets, sizes);
78         }
79         ANGLE_CAPTURE(BindBuffersRange, isCallValid, context, target, first, count, buffersPacked,
80                       offsets, sizes);
81     }
82 }
83 
BindImageTextures(GLuint first,GLsizei count,const GLuint * textures)84 void GL_APIENTRY BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
85 {
86     Context *context = GetValidGlobalContext();
87     EVENT("glBindImageTextures",
88           "context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *textures = "
89           "0x%016" PRIxPTR "",
90           CID(context), first, count, (uintptr_t)textures);
91 
92     if (context)
93     {
94         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
95         bool isCallValid                                      = (context->skipValidation() ||
96                             ValidateBindImageTextures(context, first, count, textures));
97         if (isCallValid)
98         {
99             context->bindImageTextures(first, count, textures);
100         }
101         ANGLE_CAPTURE(BindImageTextures, isCallValid, context, first, count, textures);
102     }
103 }
104 
BindSamplers(GLuint first,GLsizei count,const GLuint * samplers)105 void GL_APIENTRY BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
106 {
107     Context *context = GetValidGlobalContext();
108     EVENT("glBindSamplers",
109           "context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *samplers = "
110           "0x%016" PRIxPTR "",
111           CID(context), first, count, (uintptr_t)samplers);
112 
113     if (context)
114     {
115         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
116         bool isCallValid =
117             (context->skipValidation() || ValidateBindSamplers(context, first, count, samplers));
118         if (isCallValid)
119         {
120             context->bindSamplers(first, count, samplers);
121         }
122         ANGLE_CAPTURE(BindSamplers, isCallValid, context, first, count, samplers);
123     }
124 }
125 
BindTextures(GLuint first,GLsizei count,const GLuint * textures)126 void GL_APIENTRY BindTextures(GLuint first, GLsizei count, const GLuint *textures)
127 {
128     Context *context = GetValidGlobalContext();
129     EVENT("glBindTextures",
130           "context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *textures = "
131           "0x%016" PRIxPTR "",
132           CID(context), first, count, (uintptr_t)textures);
133 
134     if (context)
135     {
136         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
137         bool isCallValid =
138             (context->skipValidation() || ValidateBindTextures(context, first, count, textures));
139         if (isCallValid)
140         {
141             context->bindTextures(first, count, textures);
142         }
143         ANGLE_CAPTURE(BindTextures, isCallValid, context, first, count, textures);
144     }
145 }
146 
BindVertexBuffers(GLuint first,GLsizei count,const GLuint * buffers,const GLintptr * offsets,const GLsizei * strides)147 void GL_APIENTRY BindVertexBuffers(GLuint first,
148                                    GLsizei count,
149                                    const GLuint *buffers,
150                                    const GLintptr *offsets,
151                                    const GLsizei *strides)
152 {
153     Context *context = GetValidGlobalContext();
154     EVENT("glBindVertexBuffers",
155           "context = %d, GLuint first = %u, GLsizei count = %d, const GLuint *buffers = "
156           "0x%016" PRIxPTR ", const GLintptr *offsets = 0x%016" PRIxPTR
157           ", const GLsizei *strides = 0x%016" PRIxPTR "",
158           CID(context), first, count, (uintptr_t)buffers, (uintptr_t)offsets, (uintptr_t)strides);
159 
160     if (context)
161     {
162         const BufferID *buffersPacked                         = FromGL<const BufferID *>(buffers);
163         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
164         bool isCallValid =
165             (context->skipValidation() ||
166              ValidateBindVertexBuffers(context, first, count, buffersPacked, offsets, strides));
167         if (isCallValid)
168         {
169             context->bindVertexBuffers(first, count, buffersPacked, offsets, strides);
170         }
171         ANGLE_CAPTURE(BindVertexBuffers, isCallValid, context, first, count, buffersPacked, offsets,
172                       strides);
173     }
174 }
175 
BufferStorage(GLenum target,GLsizeiptr size,const void * data,GLbitfield flags)176 void GL_APIENTRY BufferStorage(GLenum target, GLsizeiptr size, const void *data, GLbitfield flags)
177 {
178     Context *context = GetValidGlobalContext();
179     EVENT("glBufferStorage",
180           "context = %d, GLenum target = %s, GLsizeiptr size = %llu, const void *data = "
181           "0x%016" PRIxPTR ", GLbitfield flags = %s",
182           CID(context), GLenumToString(GLenumGroup::BufferStorageTarget, target),
183           static_cast<unsigned long long>(size), (uintptr_t)data,
184           GLbitfieldToString(GLenumGroup::MapBufferUsageMask, flags).c_str());
185 
186     if (context)
187     {
188         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
189         bool isCallValid                                      = (context->skipValidation() ||
190                             ValidateBufferStorage(context, target, size, data, flags));
191         if (isCallValid)
192         {
193             context->bufferStorage(target, size, data, flags);
194         }
195         ANGLE_CAPTURE(BufferStorage, isCallValid, context, target, size, data, flags);
196     }
197 }
198 
199 void GL_APIENTRY
ClearTexImage(GLuint texture,GLint level,GLenum format,GLenum type,const void * data)200 ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const void *data)
201 {
202     Context *context = GetValidGlobalContext();
203     EVENT("glClearTexImage",
204           "context = %d, GLuint texture = %u, GLint level = %d, GLenum format = %s, GLenum type = "
205           "%s, const void *data = 0x%016" PRIxPTR "",
206           CID(context), texture, level, GLenumToString(GLenumGroup::PixelFormat, format),
207           GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
208 
209     if (context)
210     {
211         TextureID texturePacked                               = FromGL<TextureID>(texture);
212         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
213         bool isCallValid =
214             (context->skipValidation() ||
215              ValidateClearTexImage(context, texturePacked, level, format, type, data));
216         if (isCallValid)
217         {
218             context->clearTexImage(texturePacked, level, format, type, data);
219         }
220         ANGLE_CAPTURE(ClearTexImage, isCallValid, context, texturePacked, level, format, type,
221                       data);
222     }
223 }
224 
ClearTexSubImage(GLuint texture,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const void * data)225 void GL_APIENTRY ClearTexSubImage(GLuint texture,
226                                   GLint level,
227                                   GLint xoffset,
228                                   GLint yoffset,
229                                   GLint zoffset,
230                                   GLsizei width,
231                                   GLsizei height,
232                                   GLsizei depth,
233                                   GLenum format,
234                                   GLenum type,
235                                   const void *data)
236 {
237     Context *context = GetValidGlobalContext();
238     EVENT("glClearTexSubImage",
239           "context = %d, GLuint texture = %u, GLint level = %d, GLint xoffset = %d, GLint yoffset "
240           "= %d, GLint zoffset = %d, GLsizei width = %d, GLsizei height = %d, GLsizei depth = %d, "
241           "GLenum format = %s, GLenum type = %s, const void *data = 0x%016" PRIxPTR "",
242           CID(context), texture, level, xoffset, yoffset, zoffset, width, height, depth,
243           GLenumToString(GLenumGroup::PixelFormat, format),
244           GLenumToString(GLenumGroup::PixelType, type), (uintptr_t)data);
245 
246     if (context)
247     {
248         TextureID texturePacked                               = FromGL<TextureID>(texture);
249         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
250         bool isCallValid =
251             (context->skipValidation() ||
252              ValidateClearTexSubImage(context, texturePacked, level, xoffset, yoffset, zoffset,
253                                       width, height, depth, format, type, data));
254         if (isCallValid)
255         {
256             context->clearTexSubImage(texturePacked, level, xoffset, yoffset, zoffset, width,
257                                       height, depth, format, type, data);
258         }
259         ANGLE_CAPTURE(ClearTexSubImage, isCallValid, context, texturePacked, level, xoffset,
260                       yoffset, zoffset, width, height, depth, format, type, data);
261     }
262 }
263 }  // namespace gl
264