mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-24 03:31:43 -04:00
misc(buffer, texture): more logs
This commit is contained in:
parent
ee4b73b768
commit
62f8520dd7
@ -21,6 +21,7 @@ static GLenum get_binding_query(GLenum target) {
|
|||||||
|
|
||||||
void* glMapBuffer(GLenum target, GLenum access) {
|
void* glMapBuffer(GLenum target, GLenum access) {
|
||||||
LOG()
|
LOG()
|
||||||
|
LOG_D("glMapBuffer, target = %s, access = %s", glEnumToString(target), glEnumToString(access))
|
||||||
if (get_binding_query(target) == 0) {
|
if (get_binding_query(target) == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -40,7 +41,7 @@ void* glMapBuffer(GLenum target, GLenum access) {
|
|||||||
GLbitfield flags = 0;
|
GLbitfield flags = 0;
|
||||||
switch (access) {
|
switch (access) {
|
||||||
case GL_READ_ONLY: flags = GL_MAP_READ_BIT; break;
|
case GL_READ_ONLY: flags = GL_MAP_READ_BIT; break;
|
||||||
case GL_WRITE_ONLY: flags = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT; break;
|
case GL_WRITE_ONLY: flags = GL_MAP_WRITE_BIT; /*| GL_MAP_INVALIDATE_BUFFER_BIT*/; break;
|
||||||
case GL_READ_WRITE: flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; break;
|
case GL_READ_WRITE: flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; break;
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -105,4 +106,12 @@ void glBufferStorage(GLenum target, GLsizeiptr size, const void* data, GLbitfiel
|
|||||||
LOAD_GLES_FUNC(glBufferStorageEXT)
|
LOAD_GLES_FUNC(glBufferStorageEXT)
|
||||||
gles_glBufferStorageEXT(target,size,data,flags);
|
gles_glBufferStorageEXT(target,size,data,flags);
|
||||||
CHECK_GL_ERROR
|
CHECK_GL_ERROR
|
||||||
|
}
|
||||||
|
|
||||||
|
void glBindBuffer(GLenum target, GLuint buffer) {
|
||||||
|
LOG()
|
||||||
|
LOG_D("glBindBuffer, target = %s, buffer = %d", glEnumToString(target), buffer)
|
||||||
|
|
||||||
|
LOAD_GLES_FUNC(glBindBuffer)
|
||||||
|
gles_glBindBuffer(target, buffer);
|
||||||
}
|
}
|
@ -35,6 +35,8 @@ GLAPI GLAPIENTRY void *glMapBuffer(GLenum target, GLenum access);
|
|||||||
|
|
||||||
GLAPI GLAPIENTRY void glBufferStorage(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags);
|
GLAPI GLAPIENTRY void glBufferStorage(GLenum target, GLsizeiptr size, const void* data, GLbitfield flags);
|
||||||
|
|
||||||
|
GLAPI GLAPIENTRY void glBindBuffer(GLenum target, GLuint buffer);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -287,13 +287,13 @@ void glTexImage2D(GLenum target, GLint level,GLint internalFormat,GLsizei width,
|
|||||||
auto& tex = g_textures[bound_texture];
|
auto& tex = g_textures[bound_texture];
|
||||||
tex.internal_format = internalFormat;
|
tex.internal_format = internalFormat;
|
||||||
tex.format = format;
|
tex.format = format;
|
||||||
LOG_D("mg_glTexImage2D,target: %s,level: %d,internalFormat: %s->%s,width: %d,height: %d,border: %d,format: %s,type: %s",
|
LOG_D("mg_glTexImage2D,target: %s,level: %d,internalFormat: %s->%s,width: %d,height: %d,border: %d,format: %s,type: %s, pixels: 0x%x",
|
||||||
glEnumToString(target),level,glEnumToString(internalFormat),glEnumToString(internalFormat),
|
glEnumToString(target),level,glEnumToString(internalFormat),glEnumToString(internalFormat),
|
||||||
width,height,border,glEnumToString(format),glEnumToString(type));
|
width,height,border,glEnumToString(format),glEnumToString(type), pixels);
|
||||||
internal_convert(reinterpret_cast<GLenum *>(&internalFormat), &type, &format);
|
internal_convert(reinterpret_cast<GLenum *>(&internalFormat), &type, &format);
|
||||||
LOG_D("gles_glTexImage2D,target: %s,level: %d,internalFormat: %s->%s,width: %d,height: %d,border: %d,format: %s,type: %s",
|
LOG_D("gles_glTexImage2D,target: %s,level: %d,internalFormat: %s->%s,width: %d,height: %d,border: %d,format: %s,type: %s, pixels: 0x%x",
|
||||||
glEnumToString(target),level,glEnumToString(internalFormat),glEnumToString(internalFormat),
|
glEnumToString(target),level,glEnumToString(internalFormat),glEnumToString(internalFormat),
|
||||||
width,height,border,glEnumToString(format),glEnumToString(type));
|
width,height,border,glEnumToString(format),glEnumToString(type), pixels);
|
||||||
GLenum rtarget = map_tex_target(target);
|
GLenum rtarget = map_tex_target(target);
|
||||||
if(rtarget == GL_PROXY_TEXTURE_2D) {
|
if(rtarget == GL_PROXY_TEXTURE_2D) {
|
||||||
int max1 = 4096;
|
int max1 = 4096;
|
||||||
@ -304,8 +304,7 @@ void glTexImage2D(GLenum target, GLint level,GLint internalFormat,GLsizei width,
|
|||||||
set_gl_state_proxy_intformat(internalFormat);
|
set_gl_state_proxy_intformat(internalFormat);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOAD_GLES(glTexImage2D, void, GLenum target, GLint level,GLint internalFormat,GLsizei width, GLsizei height,GLint border, GLenum format, GLenum type,const GLvoid* pixels);
|
|
||||||
gles_glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
|
|
||||||
if (tex.format == GL_BGRA && internalFormat == GL_RGBA8 && width <= 128 && height <= 128) { // xaero has 64x64 tiles...hack here
|
if (tex.format == GL_BGRA && internalFormat == GL_RGBA8 && width <= 128 && height <= 128) { // xaero has 64x64 tiles...hack here
|
||||||
LOG_D("Detected GL_BGRA format @ tex = %d, do swizzle", bound_texture);
|
LOG_D("Detected GL_BGRA format @ tex = %d, do swizzle", bound_texture);
|
||||||
if (tex.swizzle_param[0] == 0) { // assert this as never called glTexParameteri(..., GL_TEXTURE_SWIZZLE_R, ...)
|
if (tex.swizzle_param[0] == 0) { // assert this as never called glTexParameteri(..., GL_TEXTURE_SWIZZLE_R, ...)
|
||||||
@ -333,6 +332,9 @@ void glTexImage2D(GLenum target, GLint level,GLint internalFormat,GLsizei width,
|
|||||||
CHECK_GL_ERROR
|
CHECK_GL_ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOAD_GLES(glTexImage2D, void, GLenum target, GLint level,GLint internalFormat,GLsizei width, GLsizei height,GLint border, GLenum format, GLenum type,const GLvoid* pixels);
|
||||||
|
gles_glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
|
||||||
|
|
||||||
CHECK_GL_ERROR
|
CHECK_GL_ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -924,7 +926,7 @@ void glClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, co
|
|||||||
|
|
||||||
void glPixelStorei(GLenum pname, GLint param) {
|
void glPixelStorei(GLenum pname, GLint param) {
|
||||||
LOG_D("glPixelStorei, pname = %s, param = %s", glEnumToString(pname), glEnumToString(param))
|
LOG_D("glPixelStorei, pname = %s, param = %s", glEnumToString(pname), glEnumToString(param))
|
||||||
LOAD_GLES_FUNC(glPixelStorei)
|
|
||||||
|
|
||||||
|
LOAD_GLES_FUNC(glPixelStorei)
|
||||||
gles_glPixelStorei(pname, param);
|
gles_glPixelStorei(pname, param);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user