1 #ifndef DALI_INTERNAL_GLES2_IMPLEMENTATION_H
2 #define DALI_INTERNAL_GLES2_IMPLEMENTATION_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/integration-api/debug.h>
25 #include <dali/internal/graphics/gles/gl-extensions.h>
26 #include <dali/internal/graphics/gles/gles-abstraction.h>
37 class Gles2Implementation : public GlesAbstraction
41 Gles2Implementation() {}
43 ~Gles2Implementation() override {}
45 void ReadBuffer( GLenum mode ) override
47 DALI_LOG_ERROR( "glReadBuffer is not supported in OpenGL es 2.0\n" );
50 void DrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices ) override
52 DALI_LOG_ERROR( "glDrawRangeElements is not supported in OpenGL es 2.0\n" );
55 void TexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels ) override
57 DALI_LOG_ERROR( "glTexImage3D is not supported in OpenGL es 2.0\n" );
60 void TexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels ) override
62 DALI_LOG_ERROR( "glTexSubImage3D is not supported in OpenGL es 2.0\n" );
65 void CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) override
67 DALI_LOG_ERROR( "glCopyTexSubImage3D is not supported in OpenGL es 2.0\n" );
70 void CompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data ) override
72 DALI_LOG_ERROR( "glCompressedTexImage3D is not supported in OpenGL es 2.0\n" );
75 void CompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data ) override
77 DALI_LOG_ERROR( "glCompressedTexSubImage3D is not supported in OpenGL es 2.0\n" );
80 void GenQueries( GLsizei n, GLuint* ids ) override
82 DALI_LOG_ERROR( "glGenQueries is not supported in OpenGL es 2.0\n" );
85 void DeleteQueries( GLsizei n, const GLuint* ids ) override
87 DALI_LOG_ERROR( "glDeleteQueries is not supported in OpenGL es 2.0\n" );
90 GLboolean IsQuery( GLuint id ) override
92 DALI_LOG_ERROR( "glIsQuery is not supported in OpenGL es 2.0\n" );
96 void BeginQuery( GLenum target, GLuint id ) override
98 DALI_LOG_ERROR( "glBeginQuery is not supported in OpenGL es 2.0\n" );
101 void EndQuery( GLenum target ) override
103 DALI_LOG_ERROR( "glEndQuery is not supported in OpenGL es 2.0\n" );
106 void GetQueryiv( GLenum target, GLenum pname, GLint* params ) override
108 DALI_LOG_ERROR( "glGetQueryiv is not supported in OpenGL es 2.0\n" );
111 void GetQueryObjectuiv( GLuint id, GLenum pname, GLuint* params ) override
113 DALI_LOG_ERROR( "glGetQueryObjectuiv is not supported in OpenGL es 2.0\n" );
116 GLboolean UnmapBuffer( GLenum target ) override
118 DALI_LOG_ERROR( "glUnmapBuffer is not supported in OpenGL es 2.0\n" );
122 void GetBufferPointerv( GLenum target, GLenum pname, GLvoid** params ) override
124 DALI_LOG_ERROR( "glGetBufferPointerv is not supported in OpenGL es 2.0\n" );
127 void DrawBuffers( GLsizei n, const GLenum* bufs ) override
129 DALI_LOG_ERROR( "glDrawBuffers is not supported in OpenGL es 2.0\n" );
132 void UniformMatrix2x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
134 DALI_LOG_ERROR( "glUniformMatrix2x3fv is not supported in OpenGL es 2.0\n" );
137 void UniformMatrix3x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
139 DALI_LOG_ERROR( "glUniformMatrix3x2fv is not supported in OpenGL es 2.0\n" );
142 void UniformMatrix2x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
144 DALI_LOG_ERROR( "glUniformMatrix2x4fv is not supported in OpenGL es 2.0\n" );
147 void UniformMatrix4x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
149 DALI_LOG_ERROR( "glUniformMatrix4x2fv is not supported in OpenGL es 2.0\n" );
152 void UniformMatrix3x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
154 DALI_LOG_ERROR( "glUniformMatrix3x4fv is not supported in OpenGL es 2.0\n" );
157 void UniformMatrix4x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value ) override
159 DALI_LOG_ERROR( "glUniformMatrix4x3fv is not supported in OpenGL es 2.0\n" );
162 void BlitFramebuffer( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) override
164 DALI_LOG_ERROR( "glBlitFramebuffer is not supported in OpenGL es 2.0\n" );
167 void RenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) override
169 DALI_LOG_ERROR( "glRenderbufferStorageMultisample is not supported in OpenGL es 2.0\n" );
172 void FramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) override
174 DALI_LOG_ERROR( "glFramebufferTextureLayer is not supported in OpenGL es 2.0\n" );
177 GLvoid* MapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) override
179 DALI_LOG_ERROR( "glMapBufferRange is not supported in OpenGL es 2.0\n" );
183 void FlushMappedBufferRange( GLenum target, GLintptr offset, GLsizeiptr length ) override
185 DALI_LOG_ERROR( "glFlushMappedBufferRange is not supported in OpenGL es 2.0\n" );
188 void BindVertexArray( GLuint array ) override
190 DALI_LOG_ERROR( "glBindVertexArray is not supported in OpenGL es 2.0\n" );
193 void DeleteVertexArrays( GLsizei n, const GLuint* arrays ) override
195 DALI_LOG_ERROR( "glDeleteVertexArrays is not supported in OpenGL es 2.0\n" );
198 void GenVertexArrays( GLsizei n, GLuint* arrays ) override
200 DALI_LOG_ERROR( "glGenVertexArrays is not supported in OpenGL es 2.0\n" );
203 GLboolean IsVertexArray( GLuint array ) override
205 DALI_LOG_ERROR( "glIsVertexArray is not supported in OpenGL es 2.0\n" );
209 void GetIntegeri_v( GLenum target, GLuint index, GLint* data ) override
211 DALI_LOG_ERROR( "glGetIntegeri_v is not supported in OpenGL es 2.0\n" );
214 void BeginTransformFeedback( GLenum primitiveMode ) override
216 DALI_LOG_ERROR( "glBeginTransformFeedback is not supported in OpenGL es 2.0\n" );
219 void EndTransformFeedback( void ) override
221 DALI_LOG_ERROR( "glEndTransformFeedback is not supported in OpenGL es 2.0\n" );
224 void BindBufferRange( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) override
226 DALI_LOG_ERROR( "glBindBufferRange is not supported in OpenGL es 2.0\n" );
229 void BindBufferBase( GLenum target, GLuint index, GLuint buffer ) override
231 DALI_LOG_ERROR( "glBindBufferBase is not supported in OpenGL es 2.0\n" );
234 void TransformFeedbackVaryings( GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode ) override
236 DALI_LOG_ERROR( "glTransformFeedbackVaryings is not supported in OpenGL es 2.0\n" );
239 void GetTransformFeedbackVarying( GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name ) override
241 DALI_LOG_ERROR( "glGetTransformFeedbackVarying is not supported in OpenGL es 2.0\n" );
244 void VertexAttribIPointer( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer ) override
246 DALI_LOG_ERROR( "glVertexAttribIPointer is not supported in OpenGL es 2.0\n" );
249 void GetVertexAttribIiv( GLuint index, GLenum pname, GLint* params ) override
251 DALI_LOG_ERROR( "glGetVertexAttribIiv is not supported in OpenGL es 2.0\n" );
254 void GetVertexAttribIuiv( GLuint index, GLenum pname, GLuint* params ) override
256 DALI_LOG_ERROR( "glGetVertexAttribIuiv is not supported in OpenGL es 2.0\n" );
259 void VertexAttribI4i( GLuint index, GLint x, GLint y, GLint z, GLint w ) override
261 DALI_LOG_ERROR( "glVertexAttribI4i is not supported in OpenGL es 2.0\n" );
264 void VertexAttribI4ui( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) override
266 DALI_LOG_ERROR( "glVertexAttribI4ui is not supported in OpenGL es 2.0\n" );
269 void VertexAttribI4iv( GLuint index, const GLint* v ) override
271 DALI_LOG_ERROR( "glVertexAttribI4iv is not supported in OpenGL es 2.0\n" );
274 void VertexAttribI4uiv( GLuint index, const GLuint* v ) override
276 DALI_LOG_ERROR( "glVertexAttribI4uiv is not supported in OpenGL es 2.0\n" );
279 void GetUniformuiv( GLuint program, GLint location, GLuint* params ) override
281 DALI_LOG_ERROR( "glGetUniformuiv is not supported in OpenGL es 2.0\n" );
284 GLint GetFragDataLocation( GLuint program, const GLchar *name ) override
286 DALI_LOG_ERROR( "glGetFragDataLocation is not supported in OpenGL es 2.0\n" );
290 void Uniform1ui( GLint location, GLuint v0 ) override
292 DALI_LOG_ERROR( "glUniform1ui is not supported in OpenGL es 2.0\n" );
295 void Uniform2ui( GLint location, GLuint v0, GLuint v1 ) override
297 DALI_LOG_ERROR( "glUniform2ui is not supported in OpenGL es 2.0\n" );
300 void Uniform3ui( GLint location, GLuint v0, GLuint v1, GLuint v2 ) override
302 DALI_LOG_ERROR( "glUniform3ui is not supported in OpenGL es 2.0\n" );
305 void Uniform4ui( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) override
307 DALI_LOG_ERROR( "glUniform4ui is not supported in OpenGL es 2.0\n" );
310 void Uniform1uiv( GLint location, GLsizei count, const GLuint* value ) override
312 DALI_LOG_ERROR( "glUniform1uiv is not supported in OpenGL es 2.0\n" );
315 void Uniform2uiv( GLint location, GLsizei count, const GLuint* value ) override
317 DALI_LOG_ERROR( "glUniform2uiv is not supported in OpenGL es 2.0\n" );
320 void Uniform3uiv( GLint location, GLsizei count, const GLuint* value ) override
322 DALI_LOG_ERROR( "glUniform3uiv is not supported in OpenGL es 2.0\n" );
325 void Uniform4uiv( GLint location, GLsizei count, const GLuint* value ) override
327 DALI_LOG_ERROR( "glUniform4uiv is not supported in OpenGL es 2.0\n" );
330 void ClearBufferiv( GLenum buffer, GLint drawbuffer, const GLint* value ) override
332 DALI_LOG_ERROR( "glClearBufferiv is not supported in OpenGL es 2.0\n" );
335 void ClearBufferuiv( GLenum buffer, GLint drawbuffer, const GLuint* value ) override
337 DALI_LOG_ERROR( "glClearBufferuiv is not supported in OpenGL es 2.0\n" );
340 void ClearBufferfv( GLenum buffer, GLint drawbuffer, const GLfloat* value ) override
342 DALI_LOG_ERROR( "glClearBufferfv is not supported in OpenGL es 2.0\n" );
345 void ClearBufferfi( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) override
347 DALI_LOG_ERROR( "glClearBufferfi is not supported in OpenGL es 2.0\n" );
350 const GLubyte* GetStringi( GLenum name, GLuint index ) override
352 DALI_LOG_ERROR( "glGetStringi is not supported in OpenGL es 2.0\n" );
356 void CopyBufferSubData( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) override
358 DALI_LOG_ERROR( "glCopyBufferSubData is not supported in OpenGL es 2.0\n" );
361 void GetUniformIndices( GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices ) override
363 DALI_LOG_ERROR( "glGetUniformIndices is not supported in OpenGL es 2.0\n" );
366 void GetActiveUniformsiv( GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params ) override
368 DALI_LOG_ERROR( "glGetActiveUniformsiv is not supported in OpenGL es 2.0\n" );
371 GLuint GetUniformBlockIndex( GLuint program, const GLchar* uniformBlockName ) override
373 DALI_LOG_ERROR( "glGetUniformBlockIndex is not supported in OpenGL es 2.0\n" );
377 void GetActiveUniformBlockiv( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params ) override
379 DALI_LOG_ERROR( "glGetActiveUniformBlockiv is not supported in OpenGL es 2.0\n" );
382 void GetActiveUniformBlockName( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName ) override
384 DALI_LOG_ERROR( "glGetActiveUniformBlockName is not supported in OpenGL es 2.0\n" );
387 void UniformBlockBinding( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) override
389 DALI_LOG_ERROR( "glUniformBlockBinding is not supported in OpenGL es 2.0\n" );
392 void DrawArraysInstanced( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) override
394 DALI_LOG_ERROR( "glDrawArraysInstanced is not supported in OpenGL es 2.0\n" );
397 void DrawElementsInstanced( GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount ) override
399 DALI_LOG_ERROR( "glDrawElementsInstanced is not supported in OpenGL es 2.0\n" );
402 GLsync FenceSync( GLenum condition, GLbitfield flags ) override
404 DALI_LOG_ERROR( "glFenceSync is not supported in OpenGL es 2.0\n" );
408 GLboolean IsSync( GLsync sync ) override
410 DALI_LOG_ERROR( "glIsSync is not supported in OpenGL es 2.0\n" );
414 void DeleteSync( GLsync sync ) override
416 DALI_LOG_ERROR( "glDeleteSync is not supported in OpenGL es 2.0\n" );
419 GLenum ClientWaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout ) override
421 DALI_LOG_ERROR( "glClientWaitSync is not supported in OpenGL es 2.0\n" );
425 void WaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout ) override
427 DALI_LOG_ERROR( "glWaitSync is not supported in OpenGL es 2.0\n" );
430 void GetInteger64v( GLenum pname, GLint64* params ) override
432 DALI_LOG_ERROR( "glGetInteger64v is not supported in OpenGL es 2.0\n" );
435 void GetSynciv( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values ) override
437 DALI_LOG_ERROR( "glGetSynciv is not supported in OpenGL es 2.0\n" );
440 void GetInteger64i_v( GLenum target, GLuint index, GLint64* data ) override
442 DALI_LOG_ERROR( "glGetInteger64i_v is not supported in OpenGL es 2.0\n" );
445 void GetBufferParameteri64v( GLenum target, GLenum pname, GLint64* params ) override
447 DALI_LOG_ERROR( "glGetBufferParameteri64v is not supported in OpenGL es 2.0\n" );
450 void GenSamplers( GLsizei count, GLuint* samplers ) override
452 DALI_LOG_ERROR( "glGenSamplers is not supported in OpenGL es 2.0\n" );
455 void DeleteSamplers( GLsizei count, const GLuint* samplers ) override
457 DALI_LOG_ERROR( "glDeleteSamplers is not supported in OpenGL es 2.0\n" );
460 GLboolean IsSampler( GLuint sampler ) override
462 DALI_LOG_ERROR( "glIsSampler is not supported in OpenGL es 2.0\n" );
466 void BindSampler( GLuint unit, GLuint sampler ) override
468 DALI_LOG_ERROR( "glBindSampler is not supported in OpenGL es 2.0\n" );
471 void SamplerParameteri( GLuint sampler, GLenum pname, GLint param ) override
473 DALI_LOG_ERROR( "glSamplerParameteri is not supported in OpenGL es 2.0\n" );
476 void SamplerParameteriv( GLuint sampler, GLenum pname, const GLint* param ) override
478 DALI_LOG_ERROR( "glSamplerParameteriv is not supported in OpenGL es 2.0\n" );
481 void SamplerParameterf( GLuint sampler, GLenum pname, GLfloat param ) override
483 DALI_LOG_ERROR( "glSamplerParameterf is not supported in OpenGL es 2.0\n" );
486 void SamplerParameterfv( GLuint sampler, GLenum pname, const GLfloat* param ) override
488 DALI_LOG_ERROR( "glSamplerParameterfv is not supported in OpenGL es 2.0\n" );
491 void GetSamplerParameteriv( GLuint sampler, GLenum pname, GLint* params ) override
493 DALI_LOG_ERROR( "glGetSamplerParameteriv is not supported in OpenGL es 2.0\n" );
496 void GetSamplerParameterfv( GLuint sampler, GLenum pname, GLfloat* params ) override
498 DALI_LOG_ERROR( "glGetSamplerParameterfv is not supported in OpenGL es 2.0\n" );
501 void VertexAttribDivisor( GLuint index, GLuint divisor ) override
503 DALI_LOG_ERROR( "glVertexAttribDivisor is not supported in OpenGL es 2.0\n" );
506 void BindTransformFeedback( GLenum target, GLuint id ) override
508 DALI_LOG_ERROR( "glBindTransformFeedback is not supported in OpenGL es 2.0\n" );
511 void DeleteTransformFeedbacks( GLsizei n, const GLuint* ids ) override
513 DALI_LOG_ERROR( "glDeleteTransformFeedbacks is not supported in OpenGL es 2.0\n" );
516 void GenTransformFeedbacks( GLsizei n, GLuint* ids ) override
518 DALI_LOG_ERROR( "glGenTransformFeedbacks is not supported in OpenGL es 2.0\n" );
521 GLboolean IsTransformFeedback( GLuint id ) override
523 DALI_LOG_ERROR( "glIsTransformFeedback is not supported in OpenGL es 2.0\n" );
527 void PauseTransformFeedback( void ) override
529 DALI_LOG_ERROR( "glPauseTransformFeedback is not supported in OpenGL es 2.0\n" );
532 void ResumeTransformFeedback( void ) override
534 DALI_LOG_ERROR( "glResumeTransformFeedback is not supported in OpenGL es 2.0\n" );
537 void GetProgramBinary( GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary ) override
539 mGlExtensions.GetProgramBinaryOES( program, bufSize, length, binaryFormat, binary );
542 void ProgramBinary( GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length ) override
544 mGlExtensions.ProgramBinaryOES( program, binaryFormat, binary, length );
547 void ProgramParameteri( GLuint program, GLenum pname, GLint value ) override
549 DALI_LOG_ERROR( "glProgramParameteri is not supported in OpenGL es 2.0\n" );
552 void InvalidateFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments ) override
554 mGlExtensions.DiscardFrameBuffer( target, numAttachments, attachments );
557 void InvalidateSubFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height ) override
559 DALI_LOG_ERROR( "glInvalidateSubFramebuffer is not supported in OpenGL es 2.0\n" );
562 void TexStorage2D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) override
564 DALI_LOG_ERROR( "glTexStorage2D is not supported in OpenGL es 2.0\n" );
567 void TexStorage3D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) override
569 DALI_LOG_ERROR( "glTexStorage3D is not supported in OpenGL es 2.0\n" );
572 void GetInternalformativ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params ) override
574 DALI_LOG_ERROR( "glGetInternalformativ is not supported in OpenGL es 2.0\n" );
578 ECoreX::GlExtensions mGlExtensions;
581 } // namespace Adaptor
583 } // namespace Internal
587 #endif // DALI_INTERNAL_GLES2_IMPLEMENTATION_H