// ==================================================================
// B 12
// ==================================================================
+void __get_context_buf_data(GLenum target, char *buf, int buf_size)
+{
+ GLint n_buffer_size, n_buffer_usage_size;
+ int print_size;
+
+ if (buf == NULL)
+ return;
+
+ real_glGetBufferParameteriv(target, GL_BUFFER_SIZE,
+ &n_buffer_size);
+ real_glGetBufferParameteriv(target, GL_BUFFER_USAGE,
+ &n_buffer_usage_size);
+
+ print_size = snprintf(buf, buf_size, "%u,%u,%u",
+ target, n_buffer_size, n_buffer_usage_size);
+
+ if (print_size >= buf_size) {
+ /* data was truncated. so data is invalid */
+ buf[0]='\0';
+ }
+
+}
void REAL_NAME(glBindAttribLocation)(GLuint program, GLuint index, const char *name)
{
void REAL_NAME(glBindBuffer)(GLenum target, GLuint buffer)
{
+ char context_value[MAX_GL_CONTEXT_VALUE_SIZE] = {0,};
+
TYPEDEF(void (*methodType)(GLenum, GLuint));
BEFORE(glBindBuffer);
CALL_ORIG(glBindBuffer, target, buffer);
+
+ if (blockresult && buffer)
+ __get_context_buf_data(target, &context_value[0],
+ sizeof(context_value));
+
GL_GET_ERROR();
- AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xd",
+ AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, context_value, "xd",
(uint64_t)(target), buffer);
}
TYPEDEF(void (*methodType)(GLenum, GLsizeiptr, const GLvoid *, GLenum));
BEFORE(glBufferData);
CALL_ORIG(glBufferData, target, size, data, usage);
+
+ char context_value[MAX_GL_CONTEXT_VALUE_SIZE];
+ if (blockresult)
+ __get_context_buf_data(target, &context_value[0],
+ sizeof(context_value));
GL_GET_ERROR();
- AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxpx",
+ AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, context_value, "xxpx",
(uint64_t)(target), (uint64_t)(size),
voidp_to_uint64(data), (uint64_t)(usage));
}
TYPEDEF(void (*methodType)(GLenum, GLintptr, GLsizeiptr,
const GLvoid *));
BEFORE(glBufferSubData);
+
+ char context_value[MAX_GL_CONTEXT_VALUE_SIZE];
+ if (blockresult)
+ __get_context_buf_data(target, &context_value[0],
+ sizeof(context_value));
CALL_ORIG(glBufferSubData, target, offset, size, data);
GL_GET_ERROR();
- AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "xxxp",
+ AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, context_value, "xxxp",
(uint64_t)(target), (uint64_t)(offset),
(uint64_t)(size), voidp_to_uint64(data));
}
{
TYPEDEF(void (*methodType)(GLsizei, const GLuint *));
BEFORE(glDeleteBuffers);
+
+ char context_value[MAX_GL_CONTEXT_VALUE_SIZE];
CALL_ORIG(glDeleteBuffers, n, buffers);
GL_GET_ERROR();
- AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, "", "dp",
+ AFTER('v', NO_RETURN_VALUE, APITYPE_CONTEXT, context_value, "dp",
n, voidp_to_uint64(buffers));
}