General_Trace_List *context_state_trace_list = NULL;
int current_gl_api_version = 0;
+static void
+_dump_glue_ctx_list(GLContextState *cur_cstate)
+{
+ General_Trace_List *current = NULL;
+ current = glue_ctx_trace_list;
+
+ while (current != NULL) {
+ GLGlueContext *cur_gctx = (GLGlueContext *)current->value;
+
+ if (cur_gctx->cstate == cur_cstate) {
+ TRACE(" -%c GlueCTX [%12p] : EGLDPY=[%12p] TID=[%12d] <MC count [%10d]>",
+ (cur_cstate->data == cur_gctx) ? '>' : '-',
+ cur_gctx,
+ cur_gctx->rdpy,
+ cur_gctx->thread_id,
+ cur_gctx->used_count);
+
+ TRACE(" <Ref [%2d]>\E[0m\n", cur_gctx->ref_count);
+ }
+
+ current = current->next;
+ }
+}
static void
_dump_thread_state_list(MY_MODULE_TSTATE *tstate)
cur_cstate->ref_count);
// Binded Glue Context List
- {
- General_Trace_List *current = NULL;
- current = glue_ctx_trace_list;
-
- while (current != NULL) {
- GLGlueContext *cur_gctx = (GLGlueContext *)current->value;
-
- if (cur_gctx->cstate == cur_cstate) {
- TRACE(" -%c GlueCTX [%12p] : EGLDPY=[%12p] TID=[%12d] <MC count [%10d]>",
- (cur_cstate->data == cur_gctx) ? '>' : '-',
- cur_gctx,
- cur_gctx->rdpy,
- cur_gctx->thread_id,
- cur_gctx->used_count);
-
- TRACE(" <Ref [%2d]>\E[0m\n", cur_gctx->ref_count);
- }
-
- current = current->next;
- }
- }
+ _dump_glue_ctx_list(cur_cstate);
}
current = current->next;
cur_cstate->ref_count);
// Binded Glue Context List
- {
- General_Trace_List *current = NULL;
- current = glue_ctx_trace_list;
-
- while (current != NULL) {
- GLGlueContext *cur_gctx = (GLGlueContext *)current->value;
-
- if (cur_gctx->cstate == cur_cstate) {
- TRACE(" -%c GlueCTX [%12p] : EGLDPY=[%12p] TID=[%12d] <MC count [%10d]>",
- (cur_cstate->data == cur_gctx) ? '>' : '-',
- cur_gctx,
- cur_gctx->rdpy,
- cur_gctx->thread_id,
- cur_gctx->used_count);
-
- TRACE(" <Ref [%2d]>\E[0m\n", cur_gctx->ref_count);
- }
-
- current = current->next;
- }
- }
+ _dump_glue_ctx_list(cur_cstate);
}
current = current->next;
_COREGL_FASTPATH_FUNC_END();
}
+static GLuint *_init_objid_array(GLGlueContext *current_ctx, GLsizei n, const GLuint *item)
+{
+ GLuint *objid_array = NULL;
+ if (n < 0) {
+ _set_gl_error(GL_INVALID_VALUE);
+ return NULL;
+ }
+ if (n == 0 || item == NULL) return NULL;
+
+ AST(current_ctx->ostate.shared != NULL);
+
+ objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ return objid_array;
+}
void
fastpath_glGenTextures(GLsizei n, GLuint *textures)
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (textures == NULL) goto finish;
+ objid_array = _init_objid_array(current_ctx, n, textures);
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ if (!objid_array)
+ goto finish;
IF_GL_SUCCESS(_orig_fastpath_glGenTextures(n, objid_array)) {
for (i = 0; i < n; i++) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (textures == NULL) goto finish;
+ objid_array = _init_objid_array(current_ctx, n, textures);
- AST(current_ctx->ostate.shared != NULL);
+ if (!objid_array)
+ goto finish;
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
- if (objid_array == NULL) goto finish;
{
int real_n = 0;
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (buffers == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, buffers);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ if (!objid_array)
+ goto finish;
IF_GL_SUCCESS(_orig_fastpath_glGenBuffers(n, objid_array)) {
for (i = 0; i < n; i++) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- } else if (n == 0) {
- goto finish;
- }
-
- if (buffers == NULL) {
- goto finish;
- }
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, buffers);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
if (objid_array == NULL) {
goto finish;
}
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
+ objid_array = _init_objid_array(current_ctx, n, framebuffers);
+
+ if (objid_array == NULL) {
goto finish;
}
- if (n == 0) goto finish;
- if (framebuffers == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
_get_gl_error();
switch (ftype) {
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (framebuffers == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, framebuffers);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
if (objid_array == NULL) goto finish;
{
int real_n = 0;
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
+ objid_array = _init_objid_array(current_ctx, n, renderbuffers);
+
+ if (objid_array == NULL) {
goto finish;
}
- if (n == 0) goto finish;
- if (renderbuffers == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
_get_gl_error();
switch (ftype) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (shaders == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, shaders);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
if (objid_array == NULL) goto finish;
for (i = 0; i < n; i++) {
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (ids == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, ids);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ if (objid_array == NULL) goto finish;
_get_gl_error();
switch (ftype) {
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (ids == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, ids);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
if (objid_array == NULL) goto finish;
for (i = 0; i < n; i++) {
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (arrays == NULL) goto finish;
+ objid_array = _init_objid_array(current_ctx, n, arrays);
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ if (objid_array == NULL) goto finish;
_get_gl_error();
switch (ftype) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
+ objid_array = _init_objid_array(current_ctx, n, ids);
+ if (!objid_array)
goto finish;
- }
- if (n == 0) goto finish;
- if (ids == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
IF_GL_SUCCESS(_orig_fastpath_glGenTransformFeedbacks(n, objid_array)) {
for (i = 0; i < n; i++) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
+ objid_array = _init_objid_array(current_ctx, n, ids);
+ if (!objid_array)
goto finish;
- }
- if (n == 0) goto finish;
- if (ids == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
- if (objid_array == NULL) goto finish;
{
int real_n = 0;
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (samplers == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, samplers);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ if (objid_array == NULL) goto finish;
IF_GL_SUCCESS(_orig_fastpath_glGenSamplers(n, objid_array)) {
for (i = 0; i < n; i++) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
- if (n == 0) goto finish;
- if (samplers == NULL) goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
+ objid_array = _init_objid_array(current_ctx, n, samplers);
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
if (objid_array == NULL) goto finish;
{
int real_n = 0;
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (n < 0 || pipelines == NULL) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ objid_array = _init_objid_array(current_ctx, n, pipelines);
- if (n == 0)
- goto finish;
-
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
if (objid_array == NULL) goto finish;
{
int real_n = 0;
void (*dl_png_write_end) (png_structp png_ptr, png_infop info_ptr);
};
+static GLboolean
+_validate_surface_param(Surface_Data *sdata, char name[], int *alldumpcount, int force_output)
+{
+ if (sdata->width <= 0 || sdata->height <= 0 || sdata->channel <= 0) {
+ return EGL_FALSE;
+ }
+
+ if (trace_surface_filter_size_w > 0 && trace_surface_filter_size_h > 0 &&
+ (trace_surface_filter_size_w != sdata->width || trace_surface_filter_size_h != sdata->height)) {
+ return EGL_FALSE;
+ }
+
+ if ((trace_surface_filter_period_begin > 0 ||
+ trace_surface_filter_period_end > 0) &&
+ (trace_surface_filter_period_begin > *alldumpcount ||
+ trace_surface_filter_period_end < *alldumpcount)) {
+ *alldumpcount = *alldumpcount + 1;
+ sdata->dump_count++;
+ return EGL_FALSE;
+ }
+
+ TRACE("\E[40;31;1m[[TRACE SURFACE]] : '%s' is dumped (%dx%dx%d).\E[0m\n", name,
+ sdata->width, sdata->height, sdata->channel);
+ if (trace_surface_print_only_flag == 1 && force_output == 0) {
+ *alldumpcount = *alldumpcount + 1;
+ sdata->dump_count++;
+ return EGL_FALSE;
+ }
+ return EGL_TRUE;
+}
+
static int
_dump_surface_egl(Surface_Data *sdata, char name[], unsigned char **data, int *alldumpcount, int force_output)
{
sdata->channel = 0;
}
- if (sdata->width <= 0 || sdata->height <= 0 || sdata->channel <= 0) {
- return EGL_FALSE;
- }
-
- if (trace_surface_filter_size_w > 0 && trace_surface_filter_size_h > 0 &&
- (trace_surface_filter_size_w != sdata->width || trace_surface_filter_size_h != sdata->height)) {
- return EGL_FALSE;
- }
-
- if ((trace_surface_filter_period_begin > 0 ||
- trace_surface_filter_period_end > 0) &&
- (trace_surface_filter_period_begin > *alldumpcount ||
- trace_surface_filter_period_end < *alldumpcount)) {
- *alldumpcount = *alldumpcount + 1;
- sdata->dump_count++;
- return EGL_FALSE;
- }
-
- TRACE("\E[40;31;1m[[TRACE SURFACE]] : '%s' is dumped (%dx%dx%d).\E[0m\n",
- name, sdata->width, sdata->height, sdata->channel);
-
- if (trace_surface_print_only_flag == 1 && force_output == 0) {
- *alldumpcount = *alldumpcount + 1;
- sdata->dump_count++;
+ if (_validate_surface_param(sdata, name, alldumpcount, force_output) == EGL_FALSE)
return EGL_FALSE;
- }
*data = (unsigned char *)calloc(1, sdata->width * sdata->height * sdata->channel * sizeof(unsigned char));
if (*data == NULL) {
sdata->channel = 3;
}
- if (sdata->width <= 0 || sdata->height <= 0 || sdata->channel <= 0) {
- return EGL_FALSE;
- }
-
- if (trace_surface_filter_size_w > 0 && trace_surface_filter_size_h > 0 &&
- (trace_surface_filter_size_w != sdata->width || trace_surface_filter_size_h != sdata->height)) {
+ if (_validate_surface_param(sdata, name, alldumpcount, force_output) == EGL_FALSE)
return EGL_FALSE;
- }
-
- if ((trace_surface_filter_period_begin > 0 ||
- trace_surface_filter_period_end > 0) &&
- (trace_surface_filter_period_begin > *alldumpcount ||
- trace_surface_filter_period_end < *alldumpcount)) {
- *alldumpcount = *alldumpcount + 1;
- sdata->dump_count++;
- return EGL_FALSE;
- }
-
- TRACE("\E[40;31;1m[[TRACE SURFACE]] : '%s' is dumped (%dx%dx%d).\E[0m\n", name,
- sdata->width, sdata->height, sdata->channel);
- if (trace_surface_print_only_flag == 1 && force_output == 0) {
- *alldumpcount = *alldumpcount + 1;
- sdata->dump_count++;
- return EGL_FALSE;
- }
if (sdata->channel == 3) {
sdata->channel = 4;
return ret;
}
+static void
+_trace_after_swap()
+{
+ if (unlikely(get_trace_api_frame_flag() == 1)) {
+ if (unlikely(get_trace_api_all_flag() == 1)) {
+ _COREGL_TRACE_API_OUTPUT(1);
+ } else {
+ _COREGL_TRACE_API_OUTPUT(0);
+ }
+ _COREGL_TRACE_API_RESET_FRAME();
+ } else {
+ _COREGL_TRACE_API_OUTPUT(0);
+ }
+ _COREGL_TRACE_MEM_OUTPUT(0);
+}
+
EGLBoolean
tracepath_eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
{
finish:
_COREGL_TRACEPATH_FUNC_END();
- if (unlikely(get_trace_api_frame_flag() == 1)) {
- if (unlikely(get_trace_api_all_flag() == 1)) {
- _COREGL_TRACE_API_OUTPUT(1);
- } else {
- _COREGL_TRACE_API_OUTPUT(0);
- }
- _COREGL_TRACE_API_RESET_FRAME();
- } else {
- _COREGL_TRACE_API_OUTPUT(0);
- }
- _COREGL_TRACE_MEM_OUTPUT(0);
+ _trace_after_swap();
return ret;
}
finish:
_COREGL_TRACEPATH_FUNC_END();
- if (unlikely(get_trace_api_frame_flag() == 1)) {
- if (unlikely(get_trace_api_all_flag() == 1)) {
- _COREGL_TRACE_API_OUTPUT(1);
- } else {
- _COREGL_TRACE_API_OUTPUT(0);
- }
- _COREGL_TRACE_API_RESET_FRAME();
- } else {
- _COREGL_TRACE_API_OUTPUT(0);
- }
- _COREGL_TRACE_MEM_OUTPUT(0);
+ _trace_after_swap();
return ret;
}
finish:
_COREGL_TRACEPATH_FUNC_END();
- if (unlikely(get_trace_api_frame_flag() == 1)) {
- if (unlikely(get_trace_api_all_flag() == 1)) {
- _COREGL_TRACE_API_OUTPUT(1);
- } else {
- _COREGL_TRACE_API_OUTPUT(0);
- }
- _COREGL_TRACE_API_RESET_FRAME();
- } else {
- _COREGL_TRACE_API_OUTPUT(0);
- }
- _COREGL_TRACE_MEM_OUTPUT(0);
+ _trace_after_swap();
return ret;
}
_COREGL_TRACEPATH_FUNC_END();
}
-void
-tracepath_glDrawArrays(GLenum mode, GLint first, GLsizei count)
-{
- _COREGL_TRACEPATH_FUNC_BEGIN();
- _orig_tracepath_glDrawArrays(mode, first, count);
-
- goto finish;
-
-finish:
- _COREGL_TRACEPATH_FUNC_END();
#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
+static void
+_trace_surface_draw()
+{
if (get_trace_surface_flag() == 1) {
GLint fbname = _COREGL_INT_INIT_VALUE;
_orig_tracepath_glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fbname);
_orig_tracepath_eglGetCurrentSurface(EGL_DRAW), 0, 0, 0, 0, 0, 0, NULL);
}
}
+}
+#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO
+
+void
+tracepath_glDrawArrays(GLenum mode, GLint first, GLsizei count)
+{
+ _COREGL_TRACEPATH_FUNC_BEGIN();
+ _orig_tracepath_glDrawArrays(mode, first, count);
+
+ goto finish;
+
+finish:
+ _COREGL_TRACEPATH_FUNC_END();
+#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
+ _trace_surface_draw();
#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO
}
finish:
_COREGL_TRACEPATH_FUNC_END();
#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
- if (get_trace_surface_flag() == 1) {
- GLint fbname = _COREGL_INT_INIT_VALUE;
- _orig_tracepath_glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fbname);
- AST(fbname != _COREGL_INT_INIT_VALUE);
- if (fbname == 0) {
- char name[256];
- EGLint btype;
- _orig_tracepath_eglQuerySurface(_orig_tracepath_eglGetCurrentDisplay(),
- _orig_tracepath_eglGetCurrentSurface(EGL_DRAW), EGL_RENDER_BUFFER, &btype);
- if (btype == EGL_SINGLE_BUFFER)
- snprintf(name, sizeof(name), "EGLPIXMAP_%p",
- _orig_tracepath_eglGetCurrentSurface(EGL_DRAW));
- else
- snprintf(name, sizeof(name), "EGLWINDOW_%p",
- _orig_tracepath_eglGetCurrentSurface(EGL_DRAW));
- tracepath_surface_trace_add(name, _orig_tracepath_eglGetCurrentDisplay(),
- _orig_tracepath_eglGetCurrentContext(),
- _orig_tracepath_eglGetCurrentSurface(EGL_DRAW), 0, 0, 0, 0, 0, 0, NULL);
- }
- }
+ _trace_surface_draw();
#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO
}
_COREGL_TRACEPATH_FUNC_END();
}
+static void
+_trace_renderbuffer(GLenum internalformat, GLsizei width, GLsizei height)
+{
+#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO
+ if (get_trace_mem_flag() == 1) {
+ MY_MODULE_TSTATE* tstate = _get_my_state();
+ if (tstate && tstate->ctx != NULL) {
+ struct _Glbuf_Data data = _get_glbuf_data(GL_RENDERBUFFER_BINDING, internalformat);
+ _add_glbuf_object(tstate->ctx->sostate->glbuf_rb, data.obj_idx, "Renderbuffer", width,
+ height, data.bpp, data.format);
+ }
+ }
+#endif // COREGL_TRACEPATH_TRACE_MEMUSE_INFO
+#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
+ if (get_trace_surface_flag() == 1) {
+ MY_MODULE_TSTATE* tstate = _get_my_state();
+ if (tstate && tstate->ctx != NULL) {
+ int objidx = _COREGL_INT_INIT_VALUE;
+ _orig_tracepath_glGetIntegerv(GL_RENDERBUFFER_BINDING, &objidx);
+ AST(objidx != _COREGL_INT_INIT_VALUE);
+
+ {
+ int channel = _get_channel_by_format(internalformat);
+ char name[256];
+ snprintf(name, sizeof(name), "FBORB_%d", objidx);
+ tracepath_surface_trace_add(name, tstate->ctx->dpy, tstate->ctx->handle,
+ tstate->surf_draw, -1, 0, objidx, width, height, channel, NULL);
+ }
+ }
+ }
+#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO
+}
+
void
tracepath_glRenderbufferStorage(GLenum target, GLenum internalformat,
GLsizei width, GLsizei height)
finish:
_COREGL_TRACEPATH_FUNC_END();
-#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO
- if (get_trace_mem_flag() == 1) {
- MY_MODULE_TSTATE* tstate = _get_my_state();
- if (tstate && tstate->ctx != NULL) {
- struct _Glbuf_Data data = _get_glbuf_data(GL_RENDERBUFFER_BINDING, internalformat);
- _add_glbuf_object(tstate->ctx->sostate->glbuf_rb, data.obj_idx, "Renderbuffer", width,
- height, data.bpp, data.format);
- }
- }
-#endif // COREGL_TRACEPATH_TRACE_MEMUSE_INFO
-#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
- if (get_trace_surface_flag() == 1) {
- MY_MODULE_TSTATE* tstate = _get_my_state();
- if (tstate && tstate->ctx != NULL) {
- int objidx = _COREGL_INT_INIT_VALUE;
- _orig_tracepath_glGetIntegerv(GL_RENDERBUFFER_BINDING, &objidx);
- AST(objidx != _COREGL_INT_INIT_VALUE);
-
- {
- int channel = _get_channel_by_format(internalformat);
- char name[256];
- snprintf(name, sizeof(name), "FBORB_%d", objidx);
- tracepath_surface_trace_add(name, tstate->ctx->dpy, tstate->ctx->handle,
- tstate->surf_draw, -1, 0, objidx, width, height, channel, NULL);
- }
- }
- }
-#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO
+ _trace_renderbuffer(internalformat, width, height);
}
void
goto finish;
finish:
-#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO
- if (get_trace_mem_flag() == 1) {
- MY_MODULE_TSTATE* tstate = _get_my_state();
- if (tstate && tstate->ctx != NULL) {
- struct _Glbuf_Data data = _get_glbuf_data(GL_RENDERBUFFER_BINDING, internalformat);
- _add_glbuf_object(tstate->ctx->sostate->glbuf_rb, data.obj_idx, "Renderbuffer", width,
- height, data.bpp, data.format);
- }
- }
-#endif // COREGL_TRACEPATH_TRACE_MEMUSE_INFO
-#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO
- if (get_trace_surface_flag() == 1) {
- MY_MODULE_TSTATE* tstate = _get_my_state();
- if (tstate && tstate->ctx != NULL) {
- int objidx = _COREGL_INT_INIT_VALUE;
- _orig_tracepath_glGetIntegerv(GL_RENDERBUFFER_BINDING, &objidx);
- AST(objidx != _COREGL_INT_INIT_VALUE);
+ _trace_renderbuffer(internalformat, width, height);
- {
- int channel = _get_channel_by_format(internalformat);
- char name[256];
- snprintf(name, sizeof(name), "FBORB_0x%X", objidx);
- tracepath_surface_trace_add(name, tstate->ctx->dpy, tstate->ctx->handle,
- tstate->surf_draw, -1, 0, objidx, width, height, channel, NULL);
- }
- }
- }
-#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO
}
void