• 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_6_autogen.cpp:
9 //   Defines the GL 4.6 entry points.
10 
11 #include "libGL/entry_points_gl_4_6_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/validationGL46_autogen.h"
26 #include "libGLESv2/global_state.h"
27 
28 namespace gl
29 {
MultiDrawArraysIndirectCount(GLenum mode,const void * indirect,GLintptr drawcount,GLsizei maxdrawcount,GLsizei stride)30 void GL_APIENTRY MultiDrawArraysIndirectCount(GLenum mode,
31                                               const void *indirect,
32                                               GLintptr drawcount,
33                                               GLsizei maxdrawcount,
34                                               GLsizei stride)
35 {
36     Context *context = GetValidGlobalContext();
37     EVENT("glMultiDrawArraysIndirectCount",
38           "context = %d, GLenum mode = %s, const void *indirect = 0x%016" PRIxPTR
39           ", GLintptr drawcount = %llu, GLsizei maxdrawcount = %d, GLsizei stride = %d",
40           CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode), (uintptr_t)indirect,
41           static_cast<unsigned long long>(drawcount), maxdrawcount, stride);
42 
43     if (context)
44     {
45         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
46         bool isCallValid                                      = (context->skipValidation() ||
47                             ValidateMultiDrawArraysIndirectCount(context, mode, indirect, drawcount,
48                                                                  maxdrawcount, stride));
49         if (isCallValid)
50         {
51             context->multiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride);
52         }
53         ANGLE_CAPTURE(MultiDrawArraysIndirectCount, isCallValid, context, mode, indirect, drawcount,
54                       maxdrawcount, stride);
55     }
56 }
57 
MultiDrawElementsIndirectCount(GLenum mode,GLenum type,const void * indirect,GLintptr drawcount,GLsizei maxdrawcount,GLsizei stride)58 void GL_APIENTRY MultiDrawElementsIndirectCount(GLenum mode,
59                                                 GLenum type,
60                                                 const void *indirect,
61                                                 GLintptr drawcount,
62                                                 GLsizei maxdrawcount,
63                                                 GLsizei stride)
64 {
65     Context *context = GetValidGlobalContext();
66     EVENT("glMultiDrawElementsIndirectCount",
67           "context = %d, GLenum mode = %s, GLenum type = %s, const void *indirect = 0x%016" PRIxPTR
68           ", GLintptr drawcount = %llu, GLsizei maxdrawcount = %d, GLsizei stride = %d",
69           CID(context), GLenumToString(GLenumGroup::PrimitiveType, mode),
70           GLenumToString(GLenumGroup::DefaultGroup, type), (uintptr_t)indirect,
71           static_cast<unsigned long long>(drawcount), maxdrawcount, stride);
72 
73     if (context)
74     {
75         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
76         bool isCallValid                                      = (context->skipValidation() ||
77                             ValidateMultiDrawElementsIndirectCount(
78                                 context, mode, type, indirect, drawcount, maxdrawcount, stride));
79         if (isCallValid)
80         {
81             context->multiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount,
82                                                     stride);
83         }
84         ANGLE_CAPTURE(MultiDrawElementsIndirectCount, isCallValid, context, mode, type, indirect,
85                       drawcount, maxdrawcount, stride);
86     }
87 }
88 
PolygonOffsetClamp(GLfloat factor,GLfloat units,GLfloat clamp)89 void GL_APIENTRY PolygonOffsetClamp(GLfloat factor, GLfloat units, GLfloat clamp)
90 {
91     Context *context = GetValidGlobalContext();
92     EVENT("glPolygonOffsetClamp",
93           "context = %d, GLfloat factor = %f, GLfloat units = %f, GLfloat clamp = %f", CID(context),
94           factor, units, clamp);
95 
96     if (context)
97     {
98         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
99         bool isCallValid                                      = (context->skipValidation() ||
100                             ValidatePolygonOffsetClamp(context, factor, units, clamp));
101         if (isCallValid)
102         {
103             context->polygonOffsetClamp(factor, units, clamp);
104         }
105         ANGLE_CAPTURE(PolygonOffsetClamp, isCallValid, context, factor, units, clamp);
106     }
107 }
108 
SpecializeShader(GLuint shader,const GLchar * pEntryPoint,GLuint numSpecializationConstants,const GLuint * pConstantIndex,const GLuint * pConstantValue)109 void GL_APIENTRY SpecializeShader(GLuint shader,
110                                   const GLchar *pEntryPoint,
111                                   GLuint numSpecializationConstants,
112                                   const GLuint *pConstantIndex,
113                                   const GLuint *pConstantValue)
114 {
115     Context *context = GetValidGlobalContext();
116     EVENT("glSpecializeShader",
117           "context = %d, GLuint shader = %u, const GLchar *pEntryPoint = 0x%016" PRIxPTR
118           ", GLuint numSpecializationConstants = %u, const GLuint *pConstantIndex = 0x%016" PRIxPTR
119           ", const GLuint *pConstantValue = 0x%016" PRIxPTR "",
120           CID(context), shader, (uintptr_t)pEntryPoint, numSpecializationConstants,
121           (uintptr_t)pConstantIndex, (uintptr_t)pConstantValue);
122 
123     if (context)
124     {
125         std::unique_lock<angle::GlobalMutex> shareContextLock = GetShareGroupLock(context);
126         bool isCallValid =
127             (context->skipValidation() ||
128              ValidateSpecializeShader(context, shader, pEntryPoint, numSpecializationConstants,
129                                       pConstantIndex, pConstantValue));
130         if (isCallValid)
131         {
132             context->specializeShader(shader, pEntryPoint, numSpecializationConstants,
133                                       pConstantIndex, pConstantValue);
134         }
135         ANGLE_CAPTURE(SpecializeShader, isCallValid, context, shader, pEntryPoint,
136                       numSpecializationConstants, pConstantIndex, pConstantValue);
137     }
138 }
139 }  // namespace gl
140