for (i = 0; i < initial_ctx->gl_num_tex_units[0]; i++)
{
_orig_fastpath_glActiveTexture(GL_TEXTURE0 + i);
- _orig_fastpath_glGetIntegerv(pname, &(((GLint *)params)[i]));
+ _orig_fastpath_glGetIntegerv(pname, (GLint *)¶ms[i]);
}
_orig_fastpath_glActiveTexture(cur_active_tex);
}
static void
_state_get_draw_buffers(GLenum *params)
{
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER0, &(((GLint *)params)[0]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER1, &(((GLint *)params)[1]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER2, &(((GLint *)params)[2]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER3, &(((GLint *)params)[3]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER4, &(((GLint *)params)[4]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER5, &(((GLint *)params)[5]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER6, &(((GLint *)params)[6]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER7, &(((GLint *)params)[7]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER8, &(((GLint *)params)[8]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER9, &(((GLint *)params)[9]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER10, &(((GLint *)params)[10]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER11, &(((GLint *)params)[11]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER12, &(((GLint *)params)[12]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER13, &(((GLint *)params)[13]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER14, &(((GLint *)params)[14]));
- _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER15, &(((GLint *)params)[15]));
+ AST(initial_ctx != NULL);
+
+ int i;
+ for (i = 0; i < initial_ctx->gl_num_draw_buffers[0]; i++)
+ {
+ _orig_fastpath_glGetIntegerv(GL_DRAW_BUFFER0 + i, (GLint *)¶ms[i]);
+ }
}
static void
int i;
for (i = 0; i < initial_ctx->gl_num_transform_feedback_separate_attribs[0]; i++)
{
- _orig_fastpath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, i, &(((GLint *)params)[i]));
+ _orig_fastpath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, i, (GLint *)¶ms[i]);
}
}
int i;
for (i = 0; i < initial_ctx->gl_num_transform_feedback_separate_attribs[0]; i++)
{
- _orig_fastpath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_START, i, &(((GLint *)params)[i]));
+ _orig_fastpath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_START, i, (GLint *)¶ms[i]);
}
}
int i;
for (i = 0; i < initial_ctx->gl_num_transform_feedback_separate_attribs[0]; i++)
{
- _orig_fastpath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, i, &(((GLint *)params)[i]));
+ _orig_fastpath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, i, (GLint *)¶ms[i]);
}
}
/////////////////////////////////////////////////////////////////////////////////
// XXXX : AVOID SEGFAULT in ADRENO
((GLint *)params)[i] = 0;
-// _orig_fastpath_glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, i, &(((GLint *)params)[i]));
+// _orig_fastpath_glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, i, (GLint *)¶ms[i]);
/////////////////////////////////////////////////////////////////////////////////
}
}
int i;
for (i = 0; i < initial_ctx->gl_num_uniform_buffer_bindings[0]; i++)
{
- _orig_fastpath_glGetIntegeri_v(GL_UNIFORM_BUFFER_START, i, &(((GLint *)params)[i]));
+ _orig_fastpath_glGetIntegeri_v(GL_UNIFORM_BUFFER_START, i, (GLint *)¶ms[i]);
}
}
int i;
for (i = 0; i < initial_ctx->gl_num_uniform_buffer_bindings[0]; i++)
{
- _orig_fastpath_glGetIntegeri_v(GL_UNIFORM_BUFFER_SIZE, i, &(((GLint *)params)[i]));
+ _orig_fastpath_glGetIntegeri_v(GL_UNIFORM_BUFFER_SIZE, i, (GLint *)¶ms[i]);
}
}
TRACE("\E[40;32;1m State info \E[1;37;1m: <PID = %d> GlueCTX = %p\E[0m\n", getpid(), ctx);
TRACE("\E[0;40;34m========================================================================================================================\E[0m\n");
-#define PRINTF_CHAR_GLenum "%10d"
+#define PRINTF_CHAR_GLenum "0x%8X"
#define PRINTF_CHAR_GLboolean "%10d"
#define PRINTF_CHAR_GLint "%10d"
#define PRINTF_CHAR_GLsizei "%10u"
else \
TRACE(", "); \
} \
+ if (ctx->NAME[i] != value[i]) { TRACE("\E[40;31;1m"); } \
TRACE(PRINTF_CHAR(TYPE), ctx->NAME[i]); \
TRACE("["PRINTF_CHAR(TYPE)"]", value[i]); \
+ if (ctx->NAME[i] != value[i]) { TRACE("\E[0m"); } \
} \
TRACE(" \E[40;37;1m)\E[0m\n"); \
}
{
CHECK_GL_ERROR(_orig_fastpath_glBindBuffer(GL_UNIFORM_BUFFER, newctx->gl_uniform_buffer_binding[0]))
}
- // ANGLE_framebuffer_blit BEGIN
if (newctx->gl_framebuffer_binding_read_used == 1)
{
STATE_COMPARE(gl_framebuffer_binding_read[0])
}
}
else
- // ANGLE_framebuffer_blit END
{
STATE_COMPARE(gl_framebuffer_binding[0])
{
GET_MY_TSTATE(tstate, get_current_thread_state()); \
if (tstate == NULL || tstate->cstate == NULL) \
{ \
- COREGL_WRN("\E[40;31;1m'%s' called when GLES2 context is not binded (Check MakeCurrent)!\E[0m\n", __func__); \
+ COREGL_WRN("\E[40;31;1m'%s' called when GLES context is not binded (Check MakeCurrent)!\E[0m\n", __func__); \
goto finish; \
} \
current_ctx = (GLGlueContext *)tstate->cstate->data; \
IF_GL_SUCCESS(_orig_fastpath_glDisableVertexAttribArray(index))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_array;
current_ctx->gl_vertex_array_enabled[index] = GL_FALSE;
IF_GL_SUCCESS(_orig_fastpath_glEnableVertexAttribArray(index))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_array;
current_ctx->gl_vertex_array_enabled[index] = GL_TRUE;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib1f(index, x))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib1fv(index, values))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib2f(index, x, y))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib2fv(index, values))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib3f(index, x, y, z))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib3fv(index, values))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib4f(index, x, y, z, w))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib4fv(index, values))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribPointer(index, size, type, normalized, stride, pointer))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_array;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribIPointer(index, size, type, stride, pointer))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_array;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribI4i(index, x, y, z, w))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribI4ui(index, x, y, z, w))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribI4iv(index, v))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribI4uiv(index, v))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_attrib_value;
current_ctx->gl_vertex_array_size[index] = 0;
IF_GL_SUCCESS(_orig_fastpath_glVertexAttribDivisor(index, divisor))
{
- if (current_ctx->gl_vertex_array_binding == 0)
+ if (current_ctx->gl_vertex_array_binding[0] == 0)
{
current_ctx->_vattrib_flag |= _VATTRIB_FLAG_BIT_gl_vertex_array;
current_ctx->gl_vertex_array_divisor[index] = divisor;
} \
}
+GLUE_STATE(GLuint, gl_num_draw_buffers, 1, 1,
+ _sym_glGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint *)value); /* DEFAULT NOT EFFECT */,
+ _sym_glGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint *)value);)
+
GLUE_STATE(GLuint, gl_num_tex_units, 1, 1,
_sym_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, (GLint *)value); /* DEFAULT NOT EFFECT */,
_sym_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, (GLint *)value);)
_state_get_uniform_buffer_bindings_size(value);)
GLUE_STATE(GLuint, gl_framebuffer_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *)value);)
-// ANGLE_framebuffer_blit BEGIN (check gl_framebuffer_binding_read_used)
GLUE_STATE(GLuint, gl_framebuffer_binding_read, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING_ANGLE, (GLint *)value);)
GLUE_STATE(GLuint, gl_framebuffer_binding_draw, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING_ANGLE, (GLint *)value);)
-// ANGLE_framebuffer_blit END
GLUE_STATE(GLuint, gl_renderbuffer_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_RENDERBUFFER_BINDING, (GLint *)value);)
GLUE_STATE(GLboolean, gl_blend, 1, 1, SET_1(GL_FALSE), _sym_glGetBooleanv(GL_BLEND, (GLboolean *)value);)
// MISC FLAG 3
GLUE_STATE(GLenum, gl_read_buffer, 1, 1, SET_1(GL_BACK), _sym_glGetIntegerv(GL_READ_BUFFER, (GLint *)value);)
-GLUE_STATE(GLenum, gl_draw_buffers, 16, 16,
- _state_get_draw_buffers(value); /* DEFAULT NOT EFFECT */,
+GLUE_STATE(GLenum, gl_draw_buffers, INITIAL_CTX->gl_num_draw_buffers[0], 16,
+ SET_1(GL_BACK); value++; SET_N(INITIAL_CTX->gl_num_draw_buffers[0] - 1, 1, SET_1(GL_NONE)),
_state_get_draw_buffers(value);)
GLUE_STATE(GLuint, gl_vertex_array_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint *)value);)
GLUE_STATE(GLuint, gl_transform_feedback_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_TRANSFORM_FEEDBACK_BINDING, (GLint *)value);)
typedef struct _GLGlueFakeContext
{
+ GLuint gl_num_draw_buffers[1];
GLuint gl_num_tex_units[1];
GLuint gl_num_vertex_attribs[1];
GLuint gl_num_transform_feedback_separate_attribs[1];
for (i = 0; i < initial_fake_ctx->gl_num_tex_units[0]; i++)
{
_orig_tracepath_glActiveTexture(GL_TEXTURE0 + i);
- _orig_tracepath_glGetIntegerv(pname, &(((GLint *)params)[i]));
+ _orig_tracepath_glGetIntegerv(pname, (GLint *)¶ms[i]);
}
_orig_tracepath_glActiveTexture(cur_active_tex);
}
static void
_state_get_draw_buffers(GLenum *params)
{
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER0, &(((GLint *)params)[0]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER1, &(((GLint *)params)[1]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER2, &(((GLint *)params)[2]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER3, &(((GLint *)params)[3]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER4, &(((GLint *)params)[4]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER5, &(((GLint *)params)[5]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER6, &(((GLint *)params)[6]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER7, &(((GLint *)params)[7]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER8, &(((GLint *)params)[8]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER9, &(((GLint *)params)[9]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER10, &(((GLint *)params)[10]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER11, &(((GLint *)params)[11]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER12, &(((GLint *)params)[12]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER13, &(((GLint *)params)[13]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER14, &(((GLint *)params)[14]));
- _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER15, &(((GLint *)params)[15]));
+ AST(initial_fake_ctx != NULL);
+
+ int i;
+ for (i = 0; i < initial_fake_ctx->gl_num_draw_buffers[0]; i++)
+ {
+ _orig_tracepath_glGetIntegerv(GL_DRAW_BUFFER0 + i, (GLint *)¶ms[i]);
+ }
}
static void
int i;
for (i = 0; i < initial_fake_ctx->gl_num_transform_feedback_separate_attribs[0]; i++)
{
- _orig_tracepath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, i, &(((GLint *)params)[i]));
+ _orig_tracepath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING, i, (GLint *)¶ms[i]);
}
}
int i;
for (i = 0; i < initial_fake_ctx->gl_num_transform_feedback_separate_attribs[0]; i++)
{
- _orig_tracepath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_START, i, &(((GLint *)params)[i]));
+ _orig_tracepath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_START, i, (GLint *)¶ms[i]);
}
}
int i;
for (i = 0; i < initial_fake_ctx->gl_num_transform_feedback_separate_attribs[0]; i++)
{
- _orig_tracepath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, i, &(((GLint *)params)[i]));
+ _orig_tracepath_glGetIntegeri_v(GL_TRANSFORM_FEEDBACK_BUFFER_SIZE, i, (GLint *)¶ms[i]);
}
}
/////////////////////////////////////////////////////////////////////////////////
// XXXX : AVOID SEGFAULT in ADRENO
((GLint *)params)[i] = 0;
-// _orig_tracepath_glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, i, &(((GLint *)params)[i]));
+// _orig_tracepath_glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, i, (GLint *)¶ms[i]);
/////////////////////////////////////////////////////////////////////////////////
}
}
int i;
for (i = 0; i < initial_fake_ctx->gl_num_uniform_buffer_bindings[0]; i++)
{
- _orig_tracepath_glGetIntegeri_v(GL_UNIFORM_BUFFER_START, i, &(((GLint *)params)[i]));
+ _orig_tracepath_glGetIntegeri_v(GL_UNIFORM_BUFFER_START, i, (GLint *)¶ms[i]);
}
}
int i;
for (i = 0; i < initial_fake_ctx->gl_num_uniform_buffer_bindings[0]; i++)
{
- _orig_tracepath_glGetIntegeri_v(GL_UNIFORM_BUFFER_SIZE, i, &(((GLint *)params)[i]));
+ _orig_tracepath_glGetIntegeri_v(GL_UNIFORM_BUFFER_SIZE, i, (GLint *)¶ms[i]);
}
}
if (unlikely(trace_state_flag != 1)) return;
+ _sym_glGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint *)initial_fake_ctx->gl_num_draw_buffers);
_sym_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, (GLint *)initial_fake_ctx->gl_num_tex_units);
_sym_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, (GLint *)initial_fake_ctx->gl_num_vertex_attribs);
+ _sym_glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, (GLint *)initial_fake_ctx->gl_num_transform_feedback_separate_attribs);
+ _sym_glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, (GLint *)initial_fake_ctx->gl_num_uniform_buffer_bindings);
if (!force_output)
{
TRACE("\E[40;32;1m State info \E[1;37;1m: <PID = %d> (CURRENT BINDED CONTEXT)\E[0m\n", getpid());
TRACE("\E[0;40;34m===================================================================================================================\E[0m\n");
-#define PRINTF_CHAR_GLenum "%10d"
+#define PRINTF_CHAR_GLenum "0x%8X"
#define PRINTF_CHAR_GLboolean "%10d"
#define PRINTF_CHAR_GLint "%10d"
#define PRINTF_CHAR_GLsizei "%10u"