Loading opengl/libs/EGL/getProcAddress.cpp +21 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,27 @@ namespace android { : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ [api] "J"(__builtin_offsetof(gl_hooks_t, \ ext.extensions[_api])) \ : "r12" \ ); #elif defined(__aarch64__) #define API_ENTRY(_api) __attribute__((noinline)) _api #define CALL_GL_EXTENSION_API(_api) \ asm volatile( \ "mrs x16, tpidr_el0\n" \ "ldr x16, [x16, %[tls]]\n" \ "cbz x16, 1f\n" \ "ldr x16, [x16, %[api]]\n" \ "cbz x16, 1f\n" \ "br x16\n" \ "1:\n" \ : \ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \ [api] "i" (__builtin_offsetof(gl_hooks_t, \ ext.extensions[_api])) \ : "x16" \ ); #elif defined(__i386__) Loading opengl/libs/GLES2/gl2.cpp +31 −13 Original line number Diff line number Diff line Loading @@ -36,7 +36,15 @@ using namespace android; #undef CALL_GL_API #undef CALL_GL_API_RETURN #if defined(__arm__) && !USE_SLOW_BINDING #if USE_SLOW_BINDING #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #elif defined(__arm__) #define GET_TLS(reg) "mrc p15, 0, " #reg ", c13, c0, 3 \n" Loading @@ -51,10 +59,28 @@ using namespace android; : \ : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \ : "r12" \ ); #elif defined(__aarch64__) #define API_ENTRY(_api) __attribute__((noinline)) _api #define CALL_GL_API(_api, ...) \ asm volatile( \ "mrs x16, tpidr_el0\n" \ "ldr x16, [x16, %[tls]]\n" \ "cbz x16, 1f\n" \ "ldr x16, [x16, %[api]]\n" \ "br x16\n" \ "1:\n" \ : \ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \ [api] "i" (__builtin_offsetof(gl_hooks_t, gl._api)) \ : "x16" \ ); #elif defined(__i386__) && !USE_SLOW_BINDING #elif defined(__i386__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -73,7 +99,7 @@ using namespace android; : "cc" \ ); #elif defined(__x86_64__) && !USE_SLOW_BINDING #elif defined(__x86_64__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -92,7 +118,7 @@ using namespace android; : "cc" \ ); #elif defined(__mips__) && !USE_SLOW_BINDING #elif defined(__mips__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading Loading @@ -124,14 +150,6 @@ using namespace android; : \ ); #else #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #endif #define CALL_GL_API_RETURN(_api, ...) \ Loading opengl/libs/GLES_CM/gl.cpp +31 −13 Original line number Diff line number Diff line Loading @@ -92,7 +92,15 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, #undef CALL_GL_API #undef CALL_GL_API_RETURN #if defined(__arm__) && !USE_SLOW_BINDING #if USE_SLOW_BINDING #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #elif defined(__arm__) #define GET_TLS(reg) "mrc p15, 0, " #reg ", c13, c0, 3 \n" Loading @@ -107,10 +115,28 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : \ : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \ : "r12" \ ); #elif defined(__aarch64__) #define API_ENTRY(_api) __attribute__((noinline)) _api #define CALL_GL_API(_api, ...) \ asm volatile( \ "mrs x16, tpidr_el0\n" \ "ldr x16, [x16, %[tls]]\n" \ "cbz x16, 1f\n" \ "ldr x16, [x16, %[api]]\n" \ "br x16\n" \ "1:\n" \ : \ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \ [api] "i" (__builtin_offsetof(gl_hooks_t, gl._api)) \ : "x16" \ ); #elif defined(__i386__) && !USE_SLOW_BINDING #elif defined(__i386__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -129,7 +155,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : "cc" \ ); #elif defined(__x86_64__) && !USE_SLOW_BINDING #elif defined(__x86_64__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -148,7 +174,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : "cc" \ ); #elif defined(__mips__) && !USE_SLOW_BINDING #elif defined(__mips__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading Loading @@ -180,14 +206,6 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : \ ); #else #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #endif #define CALL_GL_API_RETURN(_api, ...) \ Loading Loading
opengl/libs/EGL/getProcAddress.cpp +21 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,27 @@ namespace android { : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ [api] "J"(__builtin_offsetof(gl_hooks_t, \ ext.extensions[_api])) \ : "r12" \ ); #elif defined(__aarch64__) #define API_ENTRY(_api) __attribute__((noinline)) _api #define CALL_GL_EXTENSION_API(_api) \ asm volatile( \ "mrs x16, tpidr_el0\n" \ "ldr x16, [x16, %[tls]]\n" \ "cbz x16, 1f\n" \ "ldr x16, [x16, %[api]]\n" \ "cbz x16, 1f\n" \ "br x16\n" \ "1:\n" \ : \ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \ [api] "i" (__builtin_offsetof(gl_hooks_t, \ ext.extensions[_api])) \ : "x16" \ ); #elif defined(__i386__) Loading
opengl/libs/GLES2/gl2.cpp +31 −13 Original line number Diff line number Diff line Loading @@ -36,7 +36,15 @@ using namespace android; #undef CALL_GL_API #undef CALL_GL_API_RETURN #if defined(__arm__) && !USE_SLOW_BINDING #if USE_SLOW_BINDING #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #elif defined(__arm__) #define GET_TLS(reg) "mrc p15, 0, " #reg ", c13, c0, 3 \n" Loading @@ -51,10 +59,28 @@ using namespace android; : \ : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \ : "r12" \ ); #elif defined(__aarch64__) #define API_ENTRY(_api) __attribute__((noinline)) _api #define CALL_GL_API(_api, ...) \ asm volatile( \ "mrs x16, tpidr_el0\n" \ "ldr x16, [x16, %[tls]]\n" \ "cbz x16, 1f\n" \ "ldr x16, [x16, %[api]]\n" \ "br x16\n" \ "1:\n" \ : \ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \ [api] "i" (__builtin_offsetof(gl_hooks_t, gl._api)) \ : "x16" \ ); #elif defined(__i386__) && !USE_SLOW_BINDING #elif defined(__i386__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -73,7 +99,7 @@ using namespace android; : "cc" \ ); #elif defined(__x86_64__) && !USE_SLOW_BINDING #elif defined(__x86_64__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -92,7 +118,7 @@ using namespace android; : "cc" \ ); #elif defined(__mips__) && !USE_SLOW_BINDING #elif defined(__mips__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading Loading @@ -124,14 +150,6 @@ using namespace android; : \ ); #else #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #endif #define CALL_GL_API_RETURN(_api, ...) \ Loading
opengl/libs/GLES_CM/gl.cpp +31 −13 Original line number Diff line number Diff line Loading @@ -92,7 +92,15 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, #undef CALL_GL_API #undef CALL_GL_API_RETURN #if defined(__arm__) && !USE_SLOW_BINDING #if USE_SLOW_BINDING #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #elif defined(__arm__) #define GET_TLS(reg) "mrc p15, 0, " #reg ", c13, c0, 3 \n" Loading @@ -107,10 +115,28 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : \ : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ [api] "J"(__builtin_offsetof(gl_hooks_t, gl._api)) \ : "r12" \ ); #elif defined(__aarch64__) #define API_ENTRY(_api) __attribute__((noinline)) _api #define CALL_GL_API(_api, ...) \ asm volatile( \ "mrs x16, tpidr_el0\n" \ "ldr x16, [x16, %[tls]]\n" \ "cbz x16, 1f\n" \ "ldr x16, [x16, %[api]]\n" \ "br x16\n" \ "1:\n" \ : \ : [tls] "i" (TLS_SLOT_OPENGL_API * sizeof(void*)), \ [api] "i" (__builtin_offsetof(gl_hooks_t, gl._api)) \ : "x16" \ ); #elif defined(__i386__) && !USE_SLOW_BINDING #elif defined(__i386__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -129,7 +155,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : "cc" \ ); #elif defined(__x86_64__) && !USE_SLOW_BINDING #elif defined(__x86_64__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading @@ -148,7 +174,7 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : "cc" \ ); #elif defined(__mips__) && !USE_SLOW_BINDING #elif defined(__mips__) #define API_ENTRY(_api) __attribute__((noinline)) _api Loading Loading @@ -180,14 +206,6 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, : \ ); #else #define API_ENTRY(_api) _api #define CALL_GL_API(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ if (_c) return _c->_api(__VA_ARGS__); #endif #define CALL_GL_API_RETURN(_api, ...) \ Loading