mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-22 10:42:11 -04:00
feat(getter): implement timer query, fixing GPU util meter
This commit is contained in:
parent
5778f2b90c
commit
3910fb0ca4
@ -69,6 +69,7 @@ void InitGLESBaseExtensions() {
|
|||||||
"GL_ARB_shading_language_100 "
|
"GL_ARB_shading_language_100 "
|
||||||
"ARB_imaging "
|
"ARB_imaging "
|
||||||
"GL_ARB_draw_buffers_blend "
|
"GL_ARB_draw_buffers_blend "
|
||||||
|
"OpenGL15 "
|
||||||
"OpenGL30 "
|
"OpenGL30 "
|
||||||
"OpenGL31 "
|
"OpenGL31 "
|
||||||
"OpenGL32 "
|
"OpenGL32 "
|
||||||
@ -76,7 +77,9 @@ void InitGLESBaseExtensions() {
|
|||||||
"OpenGL40 "
|
"OpenGL40 "
|
||||||
//"OpenGL43 "
|
//"OpenGL43 "
|
||||||
//"ARB_compute_shader "
|
//"ARB_compute_shader "
|
||||||
"GL_ARB_get_program_binary ";
|
"GL_ARB_get_program_binary "
|
||||||
|
"GL_ARB_timer_query "
|
||||||
|
"GL_EXT_timer_query ";
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppendExtension(const char* ext) {
|
void AppendExtension(const char* ext) {
|
||||||
@ -238,4 +241,18 @@ const GLubyte * glGetStringi(GLenum name, GLuint index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
||||||
|
LOG()
|
||||||
|
LOAD_GLES_FUNC(glGetQueryObjectivEXT)
|
||||||
|
|
||||||
|
gles_glGetQueryObjectivEXT(id, pname, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64* params) {
|
||||||
|
LOG()
|
||||||
|
LOAD_GLES_FUNC(glGetQueryObjecti64vEXT)
|
||||||
|
|
||||||
|
gles_glGetQueryObjecti64vEXT(id, pname, params);
|
||||||
|
}
|
||||||
|
@ -21,6 +21,8 @@ GLAPI GLAPIENTRY const GLubyte *glGetString(GLenum name);
|
|||||||
GLAPI GLAPIENTRY const GLubyte *glGetStringi(GLenum name, GLuint index);
|
GLAPI GLAPIENTRY const GLubyte *glGetStringi(GLenum name, GLuint index);
|
||||||
GLAPI GLAPIENTRY GLenum glGetError();
|
GLAPI GLAPIENTRY GLenum glGetError();
|
||||||
GLAPI GLAPIENTRY void glGetIntegerv(GLenum pname, GLint *params);
|
GLAPI GLAPIENTRY void glGetIntegerv(GLenum pname, GLint *params);
|
||||||
|
GLAPI GLAPIENTRY void glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params);
|
||||||
|
GLAPI GLAPIENTRY void glGetQueryObjecti64v(GLuint id, GLenum pname, GLint64* params);
|
||||||
|
|
||||||
void AppendExtension(const char* ext);
|
void AppendExtension(const char* ext);
|
||||||
void InitGLESBaseExtensions();
|
void InitGLESBaseExtensions();
|
||||||
|
@ -462,7 +462,7 @@ STUB_FUNCTION_HEAD(void, glWindowPos3i, GLint x, GLint y, GLint z); STUB_FUNCTIO
|
|||||||
STUB_FUNCTION_HEAD(void, glWindowPos3iv,const GLint* v); STUB_FUNCTION_END_NO_RETURN(void, glWindowPos3iv,v)
|
STUB_FUNCTION_HEAD(void, glWindowPos3iv,const GLint* v); STUB_FUNCTION_END_NO_RETURN(void, glWindowPos3iv,v)
|
||||||
STUB_FUNCTION_HEAD(void, glWindowPos3s, GLshort x, GLshort y, GLshort z); STUB_FUNCTION_END_NO_RETURN(void, glWindowPos3s,x,y,z)
|
STUB_FUNCTION_HEAD(void, glWindowPos3s, GLshort x, GLshort y, GLshort z); STUB_FUNCTION_END_NO_RETURN(void, glWindowPos3s,x,y,z)
|
||||||
STUB_FUNCTION_HEAD(void, glWindowPos3sv,const GLshort* v); STUB_FUNCTION_END_NO_RETURN(void, glWindowPos3sv,v)
|
STUB_FUNCTION_HEAD(void, glWindowPos3sv,const GLshort* v); STUB_FUNCTION_END_NO_RETURN(void, glWindowPos3sv,v)
|
||||||
STUB_FUNCTION_HEAD(void, glGetQueryObjectiv, GLuint id, GLenum pname, GLint* params); STUB_FUNCTION_END_NO_RETURN(void, glGetQueryObjectiv,id,pname,params)
|
//STUB_FUNCTION_HEAD(void, glGetQueryObjectiv, GLuint id, GLenum pname, GLint* params); STUB_FUNCTION_END_NO_RETURN(void, glGetQueryObjectiv,id,pname,params)
|
||||||
STUB_FUNCTION_HEAD(void, glGetBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, void* data); STUB_FUNCTION_END_NO_RETURN(void, glGetBufferSubData,target,offset,size,data)
|
STUB_FUNCTION_HEAD(void, glGetBufferSubData, GLenum target, GLintptr offset, GLsizeiptr size, void* data); STUB_FUNCTION_END_NO_RETURN(void, glGetBufferSubData,target,offset,size,data)
|
||||||
STUB_FUNCTION_HEAD(void, glGetVertexAttribdv, GLuint index, GLenum pname, GLdouble* params); STUB_FUNCTION_END_NO_RETURN(void, glGetVertexAttribdv,index,pname,params)
|
STUB_FUNCTION_HEAD(void, glGetVertexAttribdv, GLuint index, GLenum pname, GLdouble* params); STUB_FUNCTION_END_NO_RETURN(void, glGetVertexAttribdv,index,pname,params)
|
||||||
STUB_FUNCTION_HEAD(void, glVertexAttrib1d, GLuint index, GLdouble x); STUB_FUNCTION_END_NO_RETURN(void, glVertexAttrib1d,index,x)
|
STUB_FUNCTION_HEAD(void, glVertexAttrib1d, GLuint index, GLdouble x); STUB_FUNCTION_END_NO_RETURN(void, glVertexAttrib1d,index,x)
|
||||||
@ -502,7 +502,7 @@ STUB_FUNCTION_HEAD(void, glTexImage3DMultisample, GLenum target, GLsizei samples
|
|||||||
STUB_FUNCTION_HEAD(void, glBindFragDataLocationIndexed, GLuint program, GLuint colorNumber, GLuint index, const GLchar* name); STUB_FUNCTION_END_NO_RETURN(void, glBindFragDataLocationIndexed,program,colorNumber,index,name)
|
STUB_FUNCTION_HEAD(void, glBindFragDataLocationIndexed, GLuint program, GLuint colorNumber, GLuint index, const GLchar* name); STUB_FUNCTION_END_NO_RETURN(void, glBindFragDataLocationIndexed,program,colorNumber,index,name)
|
||||||
STUB_FUNCTION_HEAD(GLint, glGetFragDataIndex, GLuint program, const GLchar* name); STUB_FUNCTION_END_NO_RETURN(GLint, glGetFragDataIndex,program,name)
|
STUB_FUNCTION_HEAD(GLint, glGetFragDataIndex, GLuint program, const GLchar* name); STUB_FUNCTION_END_NO_RETURN(GLint, glGetFragDataIndex,program,name)
|
||||||
STUB_FUNCTION_HEAD(void, glQueryCounter, GLuint id, GLenum target); STUB_FUNCTION_END_NO_RETURN(void, glQueryCounter,id,target)
|
STUB_FUNCTION_HEAD(void, glQueryCounter, GLuint id, GLenum target); STUB_FUNCTION_END_NO_RETURN(void, glQueryCounter,id,target)
|
||||||
STUB_FUNCTION_HEAD(void, glGetQueryObjecti64v, GLuint id, GLenum pname, GLint64* params); STUB_FUNCTION_END_NO_RETURN(void, glGetQueryObjecti64v,id,pname,params)
|
//STUB_FUNCTION_HEAD(void, glGetQueryObjecti64v, GLuint id, GLenum pname, GLint64* params); STUB_FUNCTION_END_NO_RETURN(void, glGetQueryObjecti64v,id,pname,params)
|
||||||
STUB_FUNCTION_HEAD(void, glGetQueryObjectui64v, GLuint id, GLenum pname, GLuint64* params); STUB_FUNCTION_END_NO_RETURN(void, glGetQueryObjectui64v,id,pname,params)
|
STUB_FUNCTION_HEAD(void, glGetQueryObjectui64v, GLuint id, GLenum pname, GLuint64* params); STUB_FUNCTION_END_NO_RETURN(void, glGetQueryObjectui64v,id,pname,params)
|
||||||
STUB_FUNCTION_HEAD(void, glVertexAttribP1ui, GLuint index, GLenum type, GLboolean normalized, GLuint value); STUB_FUNCTION_END_NO_RETURN(void, glVertexAttribP1ui,index,type,normalized,value)
|
STUB_FUNCTION_HEAD(void, glVertexAttribP1ui, GLuint index, GLenum type, GLboolean normalized, GLuint value); STUB_FUNCTION_END_NO_RETURN(void, glVertexAttribP1ui,index,type,normalized,value)
|
||||||
STUB_FUNCTION_HEAD(void, glVertexAttribP1uiv, GLuint index, GLenum type, GLboolean normalized, const GLuint* value); STUB_FUNCTION_END_NO_RETURN(void, glVertexAttribP1uiv,index,type,normalized,value)
|
STUB_FUNCTION_HEAD(void, glVertexAttribP1uiv, GLuint index, GLenum type, GLboolean normalized, const GLuint* value); STUB_FUNCTION_END_NO_RETURN(void, glVertexAttribP1uiv,index,type,normalized,value)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "mg.h"
|
#include "mg.h"
|
||||||
|
|
||||||
#define GLOBAL_DEBUG 0
|
#define GLOBAL_DEBUG 0
|
||||||
#define GLOBAL_DEBUG_FORCE_OFF 1
|
#define GLOBAL_DEBUG_FORCE_OFF 0
|
||||||
|
|
||||||
#if GLOBAL_DEBUG_FORCE_OFF
|
#if GLOBAL_DEBUG_FORCE_OFF
|
||||||
#define LOG() {}
|
#define LOG() {}
|
||||||
|
@ -374,6 +374,8 @@ GL_FUNC_TYPEDEF(void, glTexBufferRange, GLenum target, GLenum internalformat, GL
|
|||||||
GL_FUNC_TYPEDEF(void, glTexStorage3DMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
|
GL_FUNC_TYPEDEF(void, glTexStorage3DMultisample, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
|
||||||
GL_FUNC_TYPEDEF(void*, glMapBufferRange, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
|
GL_FUNC_TYPEDEF(void*, glMapBufferRange, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
|
||||||
GL_FUNC_TYPEDEF(void, glBufferStorageEXT, GLenum target, GLsizeiptr size, const void* data, GLbitfield flags)
|
GL_FUNC_TYPEDEF(void, glBufferStorageEXT, GLenum target, GLsizeiptr size, const void* data, GLbitfield flags)
|
||||||
|
GL_FUNC_TYPEDEF(void, glGetQueryObjectivEXT, GLuint id, GLenum pname, GLint *params)
|
||||||
|
GL_FUNC_TYPEDEF(void, glGetQueryObjecti64vEXT, GLuint id, GLenum pname, GLint64 *params)
|
||||||
|
|
||||||
#define GL_FUNC_DECL(name) \
|
#define GL_FUNC_DECL(name) \
|
||||||
name##_PTR name;
|
name##_PTR name;
|
||||||
@ -741,6 +743,8 @@ struct gles_func_t {
|
|||||||
GL_FUNC_DECL(glTexStorage3DMultisample)
|
GL_FUNC_DECL(glTexStorage3DMultisample)
|
||||||
GL_FUNC_DECL(glMapBufferRange)
|
GL_FUNC_DECL(glMapBufferRange)
|
||||||
GL_FUNC_DECL(glBufferStorageEXT)
|
GL_FUNC_DECL(glBufferStorageEXT)
|
||||||
|
GL_FUNC_DECL(glGetQueryObjectivEXT)
|
||||||
|
GL_FUNC_DECL(glGetQueryObjecti64vEXT)
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct gles_func_t g_gles_func;
|
extern struct gles_func_t g_gles_func;
|
||||||
|
@ -523,7 +523,9 @@ void init_target_gles() {
|
|||||||
INIT_GLES_FUNC(glTexStorage3DMultisample)
|
INIT_GLES_FUNC(glTexStorage3DMultisample)
|
||||||
INIT_GLES_FUNC(glMapBufferRange)
|
INIT_GLES_FUNC(glMapBufferRange)
|
||||||
INIT_GLES_FUNC(glBufferStorageEXT)
|
INIT_GLES_FUNC(glBufferStorageEXT)
|
||||||
|
INIT_GLES_FUNC(glGetQueryObjectivEXT)
|
||||||
|
INIT_GLES_FUNC(glGetQueryObjecti64vEXT)
|
||||||
|
|
||||||
LOG_D("Initializing %s @ hardware", RENDERERNAME);
|
LOG_D("Initializing %s @ hardware", RENDERERNAME);
|
||||||
set_hardware();
|
set_hardware();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user