xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/ContextImpl.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker //
2*8975f5c5SAndroid Build Coastguard Worker // Copyright 2016 The ANGLE Project Authors. All rights reserved.
3*8975f5c5SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
4*8975f5c5SAndroid Build Coastguard Worker // found in the LICENSE file.
5*8975f5c5SAndroid Build Coastguard Worker //
6*8975f5c5SAndroid Build Coastguard Worker // ContextImpl:
7*8975f5c5SAndroid Build Coastguard Worker //   Implementation-specific functionality associated with a GL Context.
8*8975f5c5SAndroid Build Coastguard Worker //
9*8975f5c5SAndroid Build Coastguard Worker 
10*8975f5c5SAndroid Build Coastguard Worker #ifndef LIBANGLE_RENDERER_CONTEXTIMPL_H_
11*8975f5c5SAndroid Build Coastguard Worker #define LIBANGLE_RENDERER_CONTEXTIMPL_H_
12*8975f5c5SAndroid Build Coastguard Worker 
13*8975f5c5SAndroid Build Coastguard Worker #include <vector>
14*8975f5c5SAndroid Build Coastguard Worker 
15*8975f5c5SAndroid Build Coastguard Worker #include "common/angleutils.h"
16*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/State.h"
17*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/renderer/GLImplFactory.h"
18*8975f5c5SAndroid Build Coastguard Worker 
19*8975f5c5SAndroid Build Coastguard Worker namespace gl
20*8975f5c5SAndroid Build Coastguard Worker {
21*8975f5c5SAndroid Build Coastguard Worker class ErrorSet;
22*8975f5c5SAndroid Build Coastguard Worker class MemoryProgramCache;
23*8975f5c5SAndroid Build Coastguard Worker class Path;
24*8975f5c5SAndroid Build Coastguard Worker class PixelLocalStoragePlane;
25*8975f5c5SAndroid Build Coastguard Worker class Semaphore;
26*8975f5c5SAndroid Build Coastguard Worker struct Workarounds;
27*8975f5c5SAndroid Build Coastguard Worker }  // namespace gl
28*8975f5c5SAndroid Build Coastguard Worker 
29*8975f5c5SAndroid Build Coastguard Worker namespace angle
30*8975f5c5SAndroid Build Coastguard Worker {
31*8975f5c5SAndroid Build Coastguard Worker struct ImageLoadContext;
32*8975f5c5SAndroid Build Coastguard Worker }
33*8975f5c5SAndroid Build Coastguard Worker 
34*8975f5c5SAndroid Build Coastguard Worker namespace rx
35*8975f5c5SAndroid Build Coastguard Worker {
36*8975f5c5SAndroid Build Coastguard Worker class ContextImpl : public GLImplFactory
37*8975f5c5SAndroid Build Coastguard Worker {
38*8975f5c5SAndroid Build Coastguard Worker   public:
39*8975f5c5SAndroid Build Coastguard Worker     ContextImpl(const gl::State &state, gl::ErrorSet *errorSet);
40*8975f5c5SAndroid Build Coastguard Worker     ~ContextImpl() override;
41*8975f5c5SAndroid Build Coastguard Worker 
onDestroy(const gl::Context * context)42*8975f5c5SAndroid Build Coastguard Worker     virtual void onDestroy(const gl::Context *context) {}
43*8975f5c5SAndroid Build Coastguard Worker 
44*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result initialize(const angle::ImageLoadContext &imageLoadContext) = 0;
45*8975f5c5SAndroid Build Coastguard Worker 
46*8975f5c5SAndroid Build Coastguard Worker     // Flush and finish.
47*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result flush(const gl::Context *context)  = 0;
48*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result finish(const gl::Context *context) = 0;
49*8975f5c5SAndroid Build Coastguard Worker 
50*8975f5c5SAndroid Build Coastguard Worker     // Drawing methods.
51*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawArrays(const gl::Context *context,
52*8975f5c5SAndroid Build Coastguard Worker                                      gl::PrimitiveMode mode,
53*8975f5c5SAndroid Build Coastguard Worker                                      GLint first,
54*8975f5c5SAndroid Build Coastguard Worker                                      GLsizei count)                  = 0;
55*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawArraysInstanced(const gl::Context *context,
56*8975f5c5SAndroid Build Coastguard Worker                                               gl::PrimitiveMode mode,
57*8975f5c5SAndroid Build Coastguard Worker                                               GLint first,
58*8975f5c5SAndroid Build Coastguard Worker                                               GLsizei count,
59*8975f5c5SAndroid Build Coastguard Worker                                               GLsizei instanceCount) = 0;
60*8975f5c5SAndroid Build Coastguard Worker     // Necessary for Vulkan since gl_InstanceIndex includes baseInstance
61*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawArraysInstancedBaseInstance(const gl::Context *context,
62*8975f5c5SAndroid Build Coastguard Worker                                                           gl::PrimitiveMode mode,
63*8975f5c5SAndroid Build Coastguard Worker                                                           GLint first,
64*8975f5c5SAndroid Build Coastguard Worker                                                           GLsizei count,
65*8975f5c5SAndroid Build Coastguard Worker                                                           GLsizei instanceCount,
66*8975f5c5SAndroid Build Coastguard Worker                                                           GLuint baseInstance) = 0;
67*8975f5c5SAndroid Build Coastguard Worker 
68*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawElements(const gl::Context *context,
69*8975f5c5SAndroid Build Coastguard Worker                                        gl::PrimitiveMode mode,
70*8975f5c5SAndroid Build Coastguard Worker                                        GLsizei count,
71*8975f5c5SAndroid Build Coastguard Worker                                        gl::DrawElementsType type,
72*8975f5c5SAndroid Build Coastguard Worker                                        const void *indices)                                = 0;
73*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawElementsBaseVertex(const gl::Context *context,
74*8975f5c5SAndroid Build Coastguard Worker                                                  gl::PrimitiveMode mode,
75*8975f5c5SAndroid Build Coastguard Worker                                                  GLsizei count,
76*8975f5c5SAndroid Build Coastguard Worker                                                  gl::DrawElementsType type,
77*8975f5c5SAndroid Build Coastguard Worker                                                  const void *indices,
78*8975f5c5SAndroid Build Coastguard Worker                                                  GLint baseVertex)                         = 0;
79*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawElementsInstanced(const gl::Context *context,
80*8975f5c5SAndroid Build Coastguard Worker                                                 gl::PrimitiveMode mode,
81*8975f5c5SAndroid Build Coastguard Worker                                                 GLsizei count,
82*8975f5c5SAndroid Build Coastguard Worker                                                 gl::DrawElementsType type,
83*8975f5c5SAndroid Build Coastguard Worker                                                 const void *indices,
84*8975f5c5SAndroid Build Coastguard Worker                                                 GLsizei instances)                         = 0;
85*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawElementsInstancedBaseVertex(const gl::Context *context,
86*8975f5c5SAndroid Build Coastguard Worker                                                           gl::PrimitiveMode mode,
87*8975f5c5SAndroid Build Coastguard Worker                                                           GLsizei count,
88*8975f5c5SAndroid Build Coastguard Worker                                                           gl::DrawElementsType type,
89*8975f5c5SAndroid Build Coastguard Worker                                                           const void *indices,
90*8975f5c5SAndroid Build Coastguard Worker                                                           GLsizei instances,
91*8975f5c5SAndroid Build Coastguard Worker                                                           GLint baseVertex)                = 0;
92*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawElementsInstancedBaseVertexBaseInstance(const gl::Context *context,
93*8975f5c5SAndroid Build Coastguard Worker                                                                       gl::PrimitiveMode mode,
94*8975f5c5SAndroid Build Coastguard Worker                                                                       GLsizei count,
95*8975f5c5SAndroid Build Coastguard Worker                                                                       gl::DrawElementsType type,
96*8975f5c5SAndroid Build Coastguard Worker                                                                       const void *indices,
97*8975f5c5SAndroid Build Coastguard Worker                                                                       GLsizei instances,
98*8975f5c5SAndroid Build Coastguard Worker                                                                       GLint baseVertex,
99*8975f5c5SAndroid Build Coastguard Worker                                                                       GLuint baseInstance) = 0;
100*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawRangeElements(const gl::Context *context,
101*8975f5c5SAndroid Build Coastguard Worker                                             gl::PrimitiveMode mode,
102*8975f5c5SAndroid Build Coastguard Worker                                             GLuint start,
103*8975f5c5SAndroid Build Coastguard Worker                                             GLuint end,
104*8975f5c5SAndroid Build Coastguard Worker                                             GLsizei count,
105*8975f5c5SAndroid Build Coastguard Worker                                             gl::DrawElementsType type,
106*8975f5c5SAndroid Build Coastguard Worker                                             const void *indices)                           = 0;
107*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawRangeElementsBaseVertex(const gl::Context *context,
108*8975f5c5SAndroid Build Coastguard Worker                                                       gl::PrimitiveMode mode,
109*8975f5c5SAndroid Build Coastguard Worker                                                       GLuint start,
110*8975f5c5SAndroid Build Coastguard Worker                                                       GLuint end,
111*8975f5c5SAndroid Build Coastguard Worker                                                       GLsizei count,
112*8975f5c5SAndroid Build Coastguard Worker                                                       gl::DrawElementsType type,
113*8975f5c5SAndroid Build Coastguard Worker                                                       const void *indices,
114*8975f5c5SAndroid Build Coastguard Worker                                                       GLint baseVertex)                    = 0;
115*8975f5c5SAndroid Build Coastguard Worker 
116*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawArraysIndirect(const gl::Context *context,
117*8975f5c5SAndroid Build Coastguard Worker                                              gl::PrimitiveMode mode,
118*8975f5c5SAndroid Build Coastguard Worker                                              const void *indirect)   = 0;
119*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result drawElementsIndirect(const gl::Context *context,
120*8975f5c5SAndroid Build Coastguard Worker                                                gl::PrimitiveMode mode,
121*8975f5c5SAndroid Build Coastguard Worker                                                gl::DrawElementsType type,
122*8975f5c5SAndroid Build Coastguard Worker                                                const void *indirect) = 0;
123*8975f5c5SAndroid Build Coastguard Worker 
124*8975f5c5SAndroid Build Coastguard Worker     // MultiDraw* impl added as we need workaround for promoting dynamic attributes in D3D backend
125*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawArrays(const gl::Context *context,
126*8975f5c5SAndroid Build Coastguard Worker                                           gl::PrimitiveMode mode,
127*8975f5c5SAndroid Build Coastguard Worker                                           const GLint *firsts,
128*8975f5c5SAndroid Build Coastguard Worker                                           const GLsizei *counts,
129*8975f5c5SAndroid Build Coastguard Worker                                           GLsizei drawcount)                      = 0;
130*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawArraysIndirect(const gl::Context *context,
131*8975f5c5SAndroid Build Coastguard Worker                                                   gl::PrimitiveMode mode,
132*8975f5c5SAndroid Build Coastguard Worker                                                   const void *indirect,
133*8975f5c5SAndroid Build Coastguard Worker                                                   GLsizei drawcount,
134*8975f5c5SAndroid Build Coastguard Worker                                                   GLsizei stride)                 = 0;
135*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawArraysInstanced(const gl::Context *context,
136*8975f5c5SAndroid Build Coastguard Worker                                                    gl::PrimitiveMode mode,
137*8975f5c5SAndroid Build Coastguard Worker                                                    const GLint *firsts,
138*8975f5c5SAndroid Build Coastguard Worker                                                    const GLsizei *counts,
139*8975f5c5SAndroid Build Coastguard Worker                                                    const GLsizei *instanceCounts,
140*8975f5c5SAndroid Build Coastguard Worker                                                    GLsizei drawcount)             = 0;
141*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawElements(const gl::Context *context,
142*8975f5c5SAndroid Build Coastguard Worker                                             gl::PrimitiveMode mode,
143*8975f5c5SAndroid Build Coastguard Worker                                             const GLsizei *counts,
144*8975f5c5SAndroid Build Coastguard Worker                                             gl::DrawElementsType type,
145*8975f5c5SAndroid Build Coastguard Worker                                             const GLvoid *const *indices,
146*8975f5c5SAndroid Build Coastguard Worker                                             GLsizei drawcount)                    = 0;
147*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawElementsInstanced(const gl::Context *context,
148*8975f5c5SAndroid Build Coastguard Worker                                                      gl::PrimitiveMode mode,
149*8975f5c5SAndroid Build Coastguard Worker                                                      const GLsizei *counts,
150*8975f5c5SAndroid Build Coastguard Worker                                                      gl::DrawElementsType type,
151*8975f5c5SAndroid Build Coastguard Worker                                                      const GLvoid *const *indices,
152*8975f5c5SAndroid Build Coastguard Worker                                                      const GLsizei *instanceCounts,
153*8975f5c5SAndroid Build Coastguard Worker                                                      GLsizei drawcount)           = 0;
154*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawElementsIndirect(const gl::Context *context,
155*8975f5c5SAndroid Build Coastguard Worker                                                     gl::PrimitiveMode mode,
156*8975f5c5SAndroid Build Coastguard Worker                                                     gl::DrawElementsType type,
157*8975f5c5SAndroid Build Coastguard Worker                                                     const void *indirect,
158*8975f5c5SAndroid Build Coastguard Worker                                                     GLsizei drawcount,
159*8975f5c5SAndroid Build Coastguard Worker                                                     GLsizei stride)               = 0;
160*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawArraysInstancedBaseInstance(const gl::Context *context,
161*8975f5c5SAndroid Build Coastguard Worker                                                                gl::PrimitiveMode mode,
162*8975f5c5SAndroid Build Coastguard Worker                                                                const GLint *firsts,
163*8975f5c5SAndroid Build Coastguard Worker                                                                const GLsizei *counts,
164*8975f5c5SAndroid Build Coastguard Worker                                                                const GLsizei *instanceCounts,
165*8975f5c5SAndroid Build Coastguard Worker                                                                const GLuint *baseInstances,
166*8975f5c5SAndroid Build Coastguard Worker                                                                GLsizei drawcount) = 0;
167*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result multiDrawElementsInstancedBaseVertexBaseInstance(
168*8975f5c5SAndroid Build Coastguard Worker         const gl::Context *context,
169*8975f5c5SAndroid Build Coastguard Worker         gl::PrimitiveMode mode,
170*8975f5c5SAndroid Build Coastguard Worker         const GLsizei *counts,
171*8975f5c5SAndroid Build Coastguard Worker         gl::DrawElementsType type,
172*8975f5c5SAndroid Build Coastguard Worker         const GLvoid *const *indices,
173*8975f5c5SAndroid Build Coastguard Worker         const GLsizei *instanceCounts,
174*8975f5c5SAndroid Build Coastguard Worker         const GLint *baseVertices,
175*8975f5c5SAndroid Build Coastguard Worker         const GLuint *baseInstances,
176*8975f5c5SAndroid Build Coastguard Worker         GLsizei drawcount) = 0;
177*8975f5c5SAndroid Build Coastguard Worker 
178*8975f5c5SAndroid Build Coastguard Worker     // Device loss
179*8975f5c5SAndroid Build Coastguard Worker     virtual gl::GraphicsResetStatus getResetStatus() = 0;
180*8975f5c5SAndroid Build Coastguard Worker 
181*8975f5c5SAndroid Build Coastguard Worker     // EXT_debug_marker
182*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result insertEventMarker(GLsizei length, const char *marker) = 0;
183*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result pushGroupMarker(GLsizei length, const char *marker)   = 0;
184*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result popGroupMarker()                                      = 0;
185*8975f5c5SAndroid Build Coastguard Worker 
186*8975f5c5SAndroid Build Coastguard Worker     // KHR_debug
187*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result pushDebugGroup(const gl::Context *context,
188*8975f5c5SAndroid Build Coastguard Worker                                          GLenum source,
189*8975f5c5SAndroid Build Coastguard Worker                                          GLuint id,
190*8975f5c5SAndroid Build Coastguard Worker                                          const std::string &message) = 0;
191*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result popDebugGroup(const gl::Context *context)  = 0;
192*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result handleNoopDrawEvent();
193*8975f5c5SAndroid Build Coastguard Worker 
194*8975f5c5SAndroid Build Coastguard Worker     // KHR_parallel_shader_compile
setMaxShaderCompilerThreads(GLuint count)195*8975f5c5SAndroid Build Coastguard Worker     virtual void setMaxShaderCompilerThreads(GLuint count) {}
196*8975f5c5SAndroid Build Coastguard Worker 
197*8975f5c5SAndroid Build Coastguard Worker     // GL_ANGLE_texture_storage_external
198*8975f5c5SAndroid Build Coastguard Worker     virtual void invalidateTexture(gl::TextureType target);
199*8975f5c5SAndroid Build Coastguard Worker 
200*8975f5c5SAndroid Build Coastguard Worker     // EXT_shader_framebuffer_fetch_non_coherent
framebufferFetchBarrier()201*8975f5c5SAndroid Build Coastguard Worker     virtual void framebufferFetchBarrier() {}
202*8975f5c5SAndroid Build Coastguard Worker 
203*8975f5c5SAndroid Build Coastguard Worker     // KHR_blend_equation_advanced
blendBarrier()204*8975f5c5SAndroid Build Coastguard Worker     virtual void blendBarrier() {}
205*8975f5c5SAndroid Build Coastguard Worker 
206*8975f5c5SAndroid Build Coastguard Worker     // QCOM_tiled_rendering
207*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result startTiling(const gl::Context *context,
208*8975f5c5SAndroid Build Coastguard Worker                                       const gl::Rectangle &area,
209*8975f5c5SAndroid Build Coastguard Worker                                       GLbitfield preserveMask);
210*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result endTiling(const gl::Context *context, GLbitfield preserveMask);
211*8975f5c5SAndroid Build Coastguard Worker 
212*8975f5c5SAndroid Build Coastguard Worker     // State sync with dirty bits.
213*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result syncState(const gl::Context *context,
214*8975f5c5SAndroid Build Coastguard Worker                                     const gl::state::DirtyBits dirtyBits,
215*8975f5c5SAndroid Build Coastguard Worker                                     const gl::state::DirtyBits bitMask,
216*8975f5c5SAndroid Build Coastguard Worker                                     const gl::state::ExtendedDirtyBits extendedDirtyBits,
217*8975f5c5SAndroid Build Coastguard Worker                                     const gl::state::ExtendedDirtyBits extendedBitMask,
218*8975f5c5SAndroid Build Coastguard Worker                                     gl::Command command) = 0;
219*8975f5c5SAndroid Build Coastguard Worker 
220*8975f5c5SAndroid Build Coastguard Worker     // Disjoint timer queries
221*8975f5c5SAndroid Build Coastguard Worker     virtual GLint getGPUDisjoint() = 0;
222*8975f5c5SAndroid Build Coastguard Worker     virtual GLint64 getTimestamp() = 0;
223*8975f5c5SAndroid Build Coastguard Worker 
224*8975f5c5SAndroid Build Coastguard Worker     // Context switching
225*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result onMakeCurrent(const gl::Context *context) = 0;
226*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result onUnMakeCurrent(const gl::Context *context);
227*8975f5c5SAndroid Build Coastguard Worker 
228*8975f5c5SAndroid Build Coastguard Worker     // Native capabilities, unmodified by gl::Context.
229*8975f5c5SAndroid Build Coastguard Worker     virtual gl::Caps getNativeCaps() const                                              = 0;
230*8975f5c5SAndroid Build Coastguard Worker     virtual const gl::TextureCapsMap &getNativeTextureCaps() const                      = 0;
231*8975f5c5SAndroid Build Coastguard Worker     virtual const gl::Extensions &getNativeExtensions() const                           = 0;
232*8975f5c5SAndroid Build Coastguard Worker     virtual const gl::Limitations &getNativeLimitations() const                         = 0;
233*8975f5c5SAndroid Build Coastguard Worker     virtual const ShPixelLocalStorageOptions &getNativePixelLocalStorageOptions() const = 0;
234*8975f5c5SAndroid Build Coastguard Worker 
235*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result dispatchCompute(const gl::Context *context,
236*8975f5c5SAndroid Build Coastguard Worker                                           GLuint numGroupsX,
237*8975f5c5SAndroid Build Coastguard Worker                                           GLuint numGroupsY,
238*8975f5c5SAndroid Build Coastguard Worker                                           GLuint numGroupsZ)         = 0;
239*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result dispatchComputeIndirect(const gl::Context *context,
240*8975f5c5SAndroid Build Coastguard Worker                                                   GLintptr indirect) = 0;
241*8975f5c5SAndroid Build Coastguard Worker 
242*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result memoryBarrier(const gl::Context *context, GLbitfield barriers) = 0;
243*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result memoryBarrierByRegion(const gl::Context *context,
244*8975f5c5SAndroid Build Coastguard Worker                                                 GLbitfield barriers)                     = 0;
245*8975f5c5SAndroid Build Coastguard Worker 
getState()246*8975f5c5SAndroid Build Coastguard Worker     const gl::State &getState() const { return mState; }
getClientMajorVersion()247*8975f5c5SAndroid Build Coastguard Worker     int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
getClientMinorVersion()248*8975f5c5SAndroid Build Coastguard Worker     int getClientMinorVersion() const { return mState.getClientMinorVersion(); }
getCaps()249*8975f5c5SAndroid Build Coastguard Worker     const gl::Caps &getCaps() const { return mState.getCaps(); }
getTextureCaps()250*8975f5c5SAndroid Build Coastguard Worker     const gl::TextureCapsMap &getTextureCaps() const { return mState.getTextureCaps(); }
getExtensions()251*8975f5c5SAndroid Build Coastguard Worker     const gl::Extensions &getExtensions() const { return mState.getExtensions(); }
getLimitations()252*8975f5c5SAndroid Build Coastguard Worker     const gl::Limitations &getLimitations() const { return mState.getLimitations(); }
253*8975f5c5SAndroid Build Coastguard Worker 
254*8975f5c5SAndroid Build Coastguard Worker     // A common GL driver behaviour is to trigger dynamic shader recompilation on a draw call,
255*8975f5c5SAndroid Build Coastguard Worker     // based on the current render states. We store a mutable pointer to the program cache so
256*8975f5c5SAndroid Build Coastguard Worker     // on draw calls we can store the refreshed shaders in the cache.
257*8975f5c5SAndroid Build Coastguard Worker     void setMemoryProgramCache(gl::MemoryProgramCache *memoryProgramCache);
258*8975f5c5SAndroid Build Coastguard Worker 
259*8975f5c5SAndroid Build Coastguard Worker     void handleError(GLenum errorCode,
260*8975f5c5SAndroid Build Coastguard Worker                      const char *message,
261*8975f5c5SAndroid Build Coastguard Worker                      const char *file,
262*8975f5c5SAndroid Build Coastguard Worker                      const char *function,
263*8975f5c5SAndroid Build Coastguard Worker                      unsigned int line);
264*8975f5c5SAndroid Build Coastguard Worker 
265*8975f5c5SAndroid Build Coastguard Worker     virtual egl::ContextPriority getContextPriority() const;
266*8975f5c5SAndroid Build Coastguard Worker 
267*8975f5c5SAndroid Build Coastguard Worker     // EGL_ANGLE_power_preference implementation.
268*8975f5c5SAndroid Build Coastguard Worker     virtual egl::Error releaseHighPowerGPU(gl::Context *context);
269*8975f5c5SAndroid Build Coastguard Worker     virtual egl::Error reacquireHighPowerGPU(gl::Context *context);
270*8975f5c5SAndroid Build Coastguard Worker 
271*8975f5c5SAndroid Build Coastguard Worker     // EGL_ANGLE_external_context_and_surface
272*8975f5c5SAndroid Build Coastguard Worker     virtual void acquireExternalContext(const gl::Context *context);
273*8975f5c5SAndroid Build Coastguard Worker     virtual void releaseExternalContext(const gl::Context *context);
274*8975f5c5SAndroid Build Coastguard Worker 
275*8975f5c5SAndroid Build Coastguard Worker     // GL_ANGLE_vulkan_image
276*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result acquireTextures(const gl::Context *context,
277*8975f5c5SAndroid Build Coastguard Worker                                           const gl::TextureBarrierVector &textureBarriers);
278*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result releaseTextures(const gl::Context *context,
279*8975f5c5SAndroid Build Coastguard Worker                                           gl::TextureBarrierVector *textureBarriers);
280*8975f5c5SAndroid Build Coastguard Worker 
281*8975f5c5SAndroid Build Coastguard Worker     // AMD_performance_monitor
282*8975f5c5SAndroid Build Coastguard Worker     virtual const angle::PerfMonitorCounterGroups &getPerfMonitorCounters();
283*8975f5c5SAndroid Build Coastguard Worker 
284*8975f5c5SAndroid Build Coastguard Worker   protected:
285*8975f5c5SAndroid Build Coastguard Worker     const gl::State &mState;
286*8975f5c5SAndroid Build Coastguard Worker     gl::MemoryProgramCache *mMemoryProgramCache;
287*8975f5c5SAndroid Build Coastguard Worker     gl::ErrorSet *mErrors;
288*8975f5c5SAndroid Build Coastguard Worker };
289*8975f5c5SAndroid Build Coastguard Worker 
290*8975f5c5SAndroid Build Coastguard Worker }  // namespace rx
291*8975f5c5SAndroid Build Coastguard Worker 
292*8975f5c5SAndroid Build Coastguard Worker #endif  // LIBANGLE_RENDERER_CONTEXTIMPL_H_
293