mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-23 19:22:35 -04:00
[Fix] (texture.cpp|loader.h): Fix the compilation when DEBUG is enabled.
Signed-off-by: BZLZHH <admin@bzlzhh.top>
This commit is contained in:
parent
5771bdc4e0
commit
9575e7d7ca
@ -80,8 +80,9 @@ void internal_convert(GLenum* internal_format, GLenum* type, GLenum* format) {
|
|||||||
|
|
||||||
case GL_DEPTH_COMPONENT:
|
case GL_DEPTH_COMPONENT:
|
||||||
LOG_D("Find GL_DEPTH_COMPONENT: internalFormat: %s, format: %s, type: %s", glEnumToString(*internal_format), glEnumToString(*format), glEnumToString(*type))
|
LOG_D("Find GL_DEPTH_COMPONENT: internalFormat: %s, format: %s, type: %s", glEnumToString(*internal_format), glEnumToString(*format), glEnumToString(*type))
|
||||||
if(type)
|
if(type) {
|
||||||
*type = GL_UNSIGNED_INT;
|
*type = GL_UNSIGNED_INT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_DEPTH_STENCIL:
|
case GL_DEPTH_STENCIL:
|
||||||
@ -567,7 +568,7 @@ void glRenderbufferStorage(GLenum target, GLenum internalFormat, GLsizei width,
|
|||||||
if (realInternalFormat != 0 && ERR == GL_NO_ERROR)
|
if (realInternalFormat != 0 && ERR == GL_NO_ERROR)
|
||||||
internalFormat = (GLenum)realInternalFormat;
|
internalFormat = (GLenum)realInternalFormat;
|
||||||
else
|
else
|
||||||
internalFormat = GL_DEPTH_COMPONENT24;
|
internalFormat = GL_DEPTH_COMPONENT;
|
||||||
|
|
||||||
CLEAR_GL_ERROR_NO_INIT
|
CLEAR_GL_ERROR_NO_INIT
|
||||||
|
|
||||||
@ -594,7 +595,7 @@ void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum int
|
|||||||
if (realInternalFormat != 0 && ERR == GL_NO_ERROR)
|
if (realInternalFormat != 0 && ERR == GL_NO_ERROR)
|
||||||
internalFormat = (GLenum)realInternalFormat;
|
internalFormat = (GLenum)realInternalFormat;
|
||||||
else
|
else
|
||||||
internalFormat = GL_DEPTH_COMPONENT24;
|
internalFormat = GL_DEPTH_COMPONENT;
|
||||||
|
|
||||||
|
|
||||||
LOG_D("glRenderbufferStorageMultisample, target: %d, samples: %d, internalFormat: %d, width: %d, height: %d",
|
LOG_D("glRenderbufferStorageMultisample, target: %d, samples: %d, internalFormat: %d, width: %d, height: %d",
|
||||||
@ -826,7 +827,8 @@ void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format
|
|||||||
x, y, width, height, format, type, pixels)
|
x, y, width, height, format, type, pixels)
|
||||||
|
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
|
GLenum prevFormat = format;
|
||||||
|
|
||||||
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) {
|
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8) {
|
||||||
format = GL_RGBA;
|
format = GL_RGBA;
|
||||||
type = GL_UNSIGNED_BYTE;
|
type = GL_UNSIGNED_BYTE;
|
||||||
|
@ -53,7 +53,7 @@ static name##_PTR egl_##name = NULL; \
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define CLEAR_GL_ERROR \
|
#define CLEAR_GL_ERROR \
|
||||||
LOAD_GLES_FUNC(glGetError) \
|
LOAD_GLES_FUNC(glGetError) \
|
||||||
GLenum ERR = gles_glGetError(); \
|
GLenum ERR = gles_glGetError(); \
|
||||||
while (ERR != GL_NO_ERROR) \
|
while (ERR != GL_NO_ERROR) \
|
||||||
ERR = gles_glGetError();
|
ERR = gles_glGetError();
|
||||||
@ -65,7 +65,7 @@ static name##_PTR egl_##name = NULL; \
|
|||||||
|
|
||||||
#if GLOBAL_DEBUG
|
#if GLOBAL_DEBUG
|
||||||
#define CHECK_GL_ERROR \
|
#define CHECK_GL_ERROR \
|
||||||
LOAD_GLES_FUNC(glGetError) \
|
LOAD_GLES_FUNC(glGetError) \
|
||||||
GLenum ERR = gles_glGetError(); \
|
GLenum ERR = gles_glGetError(); \
|
||||||
while (ERR != GL_NO_ERROR) { \
|
while (ERR != GL_NO_ERROR) { \
|
||||||
LOG_E("ERROR: %d @ %s:%d", ERR, __FILE__, __LINE__) \
|
LOG_E("ERROR: %d @ %s:%d", ERR, __FILE__, __LINE__) \
|
||||||
@ -73,14 +73,14 @@ static name##_PTR egl_##name = NULL; \
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define INIT_CHECK_GL_ERROR \
|
#define INIT_CHECK_GL_ERROR \
|
||||||
LOAD_GLES_FUNC(glGetError) \
|
LOAD_GLES_FUNC(glGetError) \
|
||||||
GLenum ERR = GL_NO_ERROR;
|
GLenum ERR = GL_NO_ERROR;
|
||||||
|
|
||||||
#define CHECK_GL_ERROR_NO_INIT \
|
#define CHECK_GL_ERROR_NO_INIT \
|
||||||
ERR = gles_glGetError(); \
|
ERR = gles_glGetError(); \
|
||||||
while (ERR != GL_NO_ERROR) { \
|
while (ERR != GL_NO_ERROR) { \
|
||||||
LOG_E("ERROR: %d @ %s:%d", ERR, __FILE__, __LINE__) \
|
LOG_E("ERROR: %d @ %s:%d", ERR, __FILE__, __LINE__) \
|
||||||
ERR = gles_glGetError(); \
|
ERR = gles_glGetError(); \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define CHECK_GL_ERROR {}
|
#define CHECK_GL_ERROR {}
|
||||||
@ -89,20 +89,20 @@ static name##_PTR egl_##name = NULL; \
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INIT_CHECK_GL_ERROR_FORCE \
|
#define INIT_CHECK_GL_ERROR_FORCE \
|
||||||
LOAD_GLES_FUNC(glGetError) \
|
LOAD_GLES_FUNC(glGetError) \
|
||||||
GLenum ERR = GL_NO_ERROR;
|
GLenum ERR = GL_NO_ERROR;
|
||||||
|
|
||||||
|
|
||||||
#define NATIVE_FUNCTION_HEAD(type,name,...) \
|
#define NATIVE_FUNCTION_HEAD(type,name,...) \
|
||||||
GLAPI GLAPIENTRY type name##ARB(__VA_ARGS__) __attribute__((alias(#name))); \
|
extern "C" GLAPI GLAPIENTRY type name##ARB(__VA_ARGS__) __attribute__((alias(#name))); \
|
||||||
GLAPI GLAPIENTRY type name(__VA_ARGS__) {
|
extern "C" GLAPI GLAPIENTRY type name(__VA_ARGS__) {
|
||||||
|
|
||||||
#if GLOBAL_DEBUG
|
#if GLOBAL_DEBUG
|
||||||
#define NATIVE_FUNCTION_END(type,name,...) \
|
#define NATIVE_FUNCTION_END(type,name,...) \
|
||||||
LOG_D("Use native function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
LOG_D("Use native function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
||||||
LOAD_RAW_GLES(name, type, __VA_ARGS__); \
|
LOAD_GLES_FUNC(name); \
|
||||||
type ret = gles_##name(__VA_ARGS__); \
|
type ret = gles_##name(__VA_ARGS__); \
|
||||||
LOAD_GLES_FUNC(glGetError) \
|
LOAD_GLES_FUNC(glGetError) \
|
||||||
GLenum ERR = gles_glGetError(); \
|
GLenum ERR = gles_glGetError(); \
|
||||||
if (ERR != GL_NO_ERROR) \
|
if (ERR != GL_NO_ERROR) \
|
||||||
LOG_E("ERROR: %d", ERR) \
|
LOG_E("ERROR: %d", ERR) \
|
||||||
@ -121,7 +121,7 @@ GLAPI GLAPIENTRY type name(__VA_ARGS__) {
|
|||||||
#if GLOBAL_DEBUG
|
#if GLOBAL_DEBUG
|
||||||
#define NATIVE_FUNCTION_END_NO_RETURN(type,name,...) \
|
#define NATIVE_FUNCTION_END_NO_RETURN(type,name,...) \
|
||||||
LOG_D("Use native function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
LOG_D("Use native function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
||||||
LOAD_RAW_GLES(name, type, __VA_ARGS__); \
|
LOAD_GLES_FUNC(name); \
|
||||||
gles_##name(__VA_ARGS__); \
|
gles_##name(__VA_ARGS__); \
|
||||||
CHECK_GL_ERROR \
|
CHECK_GL_ERROR \
|
||||||
}
|
}
|
||||||
@ -134,15 +134,15 @@ GLAPI GLAPIENTRY type name(__VA_ARGS__) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define STUB_FUNCTION_HEAD(type,name,...) \
|
#define STUB_FUNCTION_HEAD(type,name,...) \
|
||||||
GLAPI GLAPIENTRY type name(__VA_ARGS__) {
|
extern "C" GLAPI GLAPIENTRY type name(__VA_ARGS__) {
|
||||||
|
|
||||||
#define STUB_FUNCTION_END(type,name,...) \
|
#define STUB_FUNCTION_END(type,name,...) \
|
||||||
LOG_W("Stub function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
LOG_W("Stub function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
||||||
return (type)0; \
|
return (type)0; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define STUB_FUNCTION_END_NO_RETURN(type,name,...) \
|
#define STUB_FUNCTION_END_NO_RETURN(type,name,...) \
|
||||||
LOG_W("Stub function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
LOG_W("Stub function: %s @ %s(...)", RENDERERNAME, __FUNCTION__); \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct gles_caps_t {
|
struct gles_caps_t {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user