mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-19 00:45:45 -04:00
Merge branch 'plugin' of https://github.com/Swung0x48/MobileGlues into plugin
This commit is contained in:
commit
c66a53befe
71
mg_full.pbtx
Normal file
71
mg_full.pbtx
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
buffers: {
|
||||||
|
size_kb: 522240
|
||||||
|
fill_policy: RING_BUFFER
|
||||||
|
}
|
||||||
|
buffers: {
|
||||||
|
size_kb: 2048
|
||||||
|
fill_policy: RING_BUFFER
|
||||||
|
}
|
||||||
|
data_sources {
|
||||||
|
config {
|
||||||
|
name: "track_event"
|
||||||
|
track_event_config {
|
||||||
|
enabled_categories: "glcalls"
|
||||||
|
disabled_categories: "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_sources: {
|
||||||
|
config {
|
||||||
|
name: "android.packages_list"
|
||||||
|
target_buffer: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_sources: {
|
||||||
|
config {
|
||||||
|
name: "linux.system_info"
|
||||||
|
target_buffer: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_sources: {
|
||||||
|
config {
|
||||||
|
name: "linux.process_stats"
|
||||||
|
target_buffer: 1
|
||||||
|
process_stats_config {
|
||||||
|
scan_all_processes_on_start: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_sources: {
|
||||||
|
config {
|
||||||
|
name: "android.surfaceflinger.frametimeline"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data_sources: {
|
||||||
|
config {
|
||||||
|
name: "linux.ftrace"
|
||||||
|
ftrace_config {
|
||||||
|
ftrace_events: "sched/sched_switch"
|
||||||
|
ftrace_events: "power/suspend_resume"
|
||||||
|
ftrace_events: "sched/sched_wakeup"
|
||||||
|
ftrace_events: "sched/sched_wakeup_new"
|
||||||
|
ftrace_events: "sched/sched_waking"
|
||||||
|
ftrace_events: "power/cpu_frequency"
|
||||||
|
ftrace_events: "power/cpu_idle"
|
||||||
|
ftrace_events: "power/gpu_frequency"
|
||||||
|
ftrace_events: "power/gpu_work_period"
|
||||||
|
ftrace_events: "sched/sched_process_exit"
|
||||||
|
ftrace_events: "sched/sched_process_free"
|
||||||
|
ftrace_events: "task/task_newtask"
|
||||||
|
ftrace_events: "task/task_rename"
|
||||||
|
ftrace_events: "ftrace/print"
|
||||||
|
atrace_categories: "gfx"
|
||||||
|
atrace_apps: "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
duration_ms: 600000
|
||||||
|
flush_period_ms: 30000
|
||||||
|
incremental_state_config {
|
||||||
|
clear_period_ms: 5000
|
||||||
|
}
|
@ -25,6 +25,7 @@ void init_settings() {
|
|||||||
int enableNoError = success ? config_get_int("enableNoError") : 0;
|
int enableNoError = success ? config_get_int("enableNoError") : 0;
|
||||||
int enableExtGL43 = success ? config_get_int("enableExtGL43") : 0;
|
int enableExtGL43 = success ? config_get_int("enableExtGL43") : 0;
|
||||||
int enableExtComputeShader = success ? config_get_int("enableExtComputeShader") : 0;
|
int enableExtComputeShader = success ? config_get_int("enableExtComputeShader") : 0;
|
||||||
|
int enableCompatibleMode = success ? config_get_int("enableCompatibleMode") : 0;
|
||||||
size_t maxGlslCacheSize = 0;
|
size_t maxGlslCacheSize = 0;
|
||||||
if (config_get_int("maxGlslCacheSize") > 0)
|
if (config_get_int("maxGlslCacheSize") > 0)
|
||||||
maxGlslCacheSize = success ? config_get_int("maxGlslCacheSize") * 1024 * 1024 : 0;
|
maxGlslCacheSize = success ? config_get_int("maxGlslCacheSize") * 1024 * 1024 : 0;
|
||||||
@ -37,6 +38,8 @@ void init_settings() {
|
|||||||
enableExtGL43 = 0;
|
enableExtGL43 = 0;
|
||||||
if (enableExtComputeShader < 0 || enableExtComputeShader > 1)
|
if (enableExtComputeShader < 0 || enableExtComputeShader > 1)
|
||||||
enableExtComputeShader = 0;
|
enableExtComputeShader = 0;
|
||||||
|
if (enableCompatibleMode < 0 || enableCompatibleMode > 1)
|
||||||
|
enableCompatibleMode = 0;
|
||||||
|
|
||||||
// 1205
|
// 1205
|
||||||
int fclVersion = 0;
|
int fclVersion = 0;
|
||||||
@ -55,6 +58,7 @@ void init_settings() {
|
|||||||
enableExtGL43 = 0;
|
enableExtGL43 = 0;
|
||||||
enableExtComputeShader = 0;
|
enableExtComputeShader = 0;
|
||||||
maxGlslCacheSize = 0;
|
maxGlslCacheSize = 0;
|
||||||
|
enableCompatibleMode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* gpuString = getGPUInfo();
|
const char* gpuString = getGPUInfo();
|
||||||
@ -111,4 +115,6 @@ void init_settings() {
|
|||||||
global_settings.ext_compute_shader = enableExtComputeShader;
|
global_settings.ext_compute_shader = enableExtComputeShader;
|
||||||
|
|
||||||
global_settings.maxGlslCacheSize = maxGlslCacheSize;
|
global_settings.maxGlslCacheSize = maxGlslCacheSize;
|
||||||
|
|
||||||
|
global_settings.enableCompatibleMode = enableCompatibleMode;
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ struct global_settings_t {
|
|||||||
int ext_gl43; // 0, 1
|
int ext_gl43; // 0, 1
|
||||||
int ext_compute_shader; // 0, 1
|
int ext_compute_shader; // 0, 1
|
||||||
size_t maxGlslCacheSize; // 0~
|
size_t maxGlslCacheSize; // 0~
|
||||||
|
int enableCompatibleMode; // 0, 1
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct global_settings_t global_settings;
|
extern struct global_settings_t global_settings;
|
||||||
|
@ -12,10 +12,12 @@
|
|||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
|
|
||||||
|
|
||||||
|
static EGLDisplay eglDisplay = EGL_NO_DISPLAY;
|
||||||
|
static EGLSurface eglSurface = EGL_NO_SURFACE;
|
||||||
|
static EGLContext eglContext = EGL_NO_CONTEXT;
|
||||||
|
|
||||||
void init_target_egl() {
|
void init_target_egl() {
|
||||||
EGLDisplay eglDisplay = EGL_NO_DISPLAY;
|
|
||||||
EGLSurface eglSurface = EGL_NO_SURFACE;
|
|
||||||
EGLContext eglContext = EGL_NO_CONTEXT;
|
|
||||||
|
|
||||||
LOAD_EGL(eglGetProcAddress);
|
LOAD_EGL(eglGetProcAddress);
|
||||||
LOAD_EGL(eglBindAPI);
|
LOAD_EGL(eglBindAPI);
|
||||||
@ -115,4 +117,17 @@ cleanup:
|
|||||||
egl_eglTerminate(eglDisplay);
|
egl_eglTerminate(eglDisplay);
|
||||||
}
|
}
|
||||||
LOG_E("EGL initialization failed");
|
LOG_E("EGL initialization failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void destroy_temp_egl_ctx() {
|
||||||
|
LOAD_EGL(eglDestroySurface);
|
||||||
|
LOAD_EGL(eglDestroyContext);
|
||||||
|
LOAD_EGL(eglMakeCurrent);
|
||||||
|
LOAD_EGL(eglTerminate);
|
||||||
|
|
||||||
|
egl_eglMakeCurrent(eglDisplay, 0, 0, EGL_NO_CONTEXT);
|
||||||
|
egl_eglDestroySurface(eglDisplay, eglSurface);
|
||||||
|
egl_eglDestroyContext(eglDisplay, eglContext);
|
||||||
|
|
||||||
|
egl_eglTerminate(eglDisplay);
|
||||||
}
|
}
|
@ -173,6 +173,7 @@ EGLBoolean mglues_eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface rea
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void init_target_egl();
|
void init_target_egl();
|
||||||
|
void destroy_temp_egl_ctx();
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -79,6 +79,7 @@ void internal_convert(GLenum* internal_format, GLenum* type, GLenum* format) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_DEPTH_COMPONENT:
|
case GL_DEPTH_COMPONENT:
|
||||||
|
// TODO: Add enableCompatibleMode option
|
||||||
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;
|
||||||
@ -598,7 +599,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_COMPONENT;
|
internalFormat = GL_DEPTH_COMPONENT24;
|
||||||
|
|
||||||
|
|
||||||
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",
|
||||||
|
@ -85,5 +85,7 @@ void proc_init() {
|
|||||||
init_perfetto();
|
init_perfetto();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Cleanup
|
||||||
|
destroy_temp_egl_ctx();
|
||||||
g_initialized = 1;
|
g_initialized = 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user