current_ctx = (GLGlueContext *)tstate->cstate->data; \
AST(current_ctx != NULL);
+#define GET_PROG_REAL_OBJ(glue_handle, real_handle) \
+ if (_get_real_obj(¤t_ctx->ostate, GL_OBJECT_TYPE_PROGRAM, glue_handle, real_handle) !=1) { \
+ _set_gl_error(GL_INVALID_VALUE); \
+ goto finish; \
+ }
#define GET_REAL_OBJ(type, glue_handle, real_handle) \
_get_real_obj(¤t_ctx->ostate, type, glue_handle, real_handle)
#define GET_GLUE_OBJ(type, real_handle, glue_handle) \
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(shader, &real_obj);
_orig_fastpath_glShaderSource(real_obj, count, string, length);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(shader, &real_obj);
_orig_fastpath_glCompileShader(real_obj);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glBindAttribLocation(real_obj, index, name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj_program) != 1 ||
- GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj_shader) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj_program);
+ GET_PROG_REAL_OBJ(shader, &real_obj_shader);
IF_GL_SUCCESS(_orig_fastpath_glAttachShader(real_obj_program,
real_obj_shader)) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj_program) != 1 ||
- GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj_shader) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj_program);
+ GET_PROG_REAL_OBJ(shader, &real_obj_shader);
IF_GL_SUCCESS(_orig_fastpath_glDetachShader(real_obj_program,
real_obj_shader)) {
INIT_FASTPATH_GL_FUNC();
if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- ret = GL_FALSE;
+ ret = GL_FALSE;
goto finish;
}
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glLinkProgram(real_obj);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glValidateProgram(real_obj);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
if CURR_STATE_COMPARE(gl_current_program, 0, real_obj) {
IF_GL_SUCCESS(_orig_fastpath_glUseProgram(real_obj)) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetActiveAttrib(real_obj, index, bufsize, length, size, type,
name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetActiveUniform(real_obj, index, bufsize, length, size, type,
name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
IF_GL_SUCCESS(_orig_fastpath_glGetAttachedShaders(real_obj, maxcount,
&real_count, shaders)) {
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
ret = _orig_fastpath_glGetAttribLocation(real_obj, name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(shader, &real_obj);
switch (pname) {
case GL_DELETE_STATUS:
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(shader, &real_obj);
_orig_fastpath_glGetShaderInfoLog(real_obj, bufsize, length, infolog);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (pname) {
case GL_DELETE_STATUS:
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetProgramInfoLog(real_obj, bufsize, length, infolog);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(shader, &real_obj);
_orig_fastpath_glGetShaderSource(real_obj, bufsize, length, source);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetUniformfv(real_obj, location, params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetUniformiv(real_obj, location, params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glUseProgramStagesEXT(pipeline, stages, real_obj);
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_program_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_program_obj);
if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline,
&real_pipeline_obj) != 1) {
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj) ;
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj) ;
_orig_fastpath_glProgramUniformMatrix2fvEXT(real_obj, location, count,
transpose, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix3fvEXT(real_obj, location, count,
transpose, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix4fvEXT(real_obj, location, count,
transpose, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- ret = -1;
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
ret = _orig_fastpath_glGetUniformLocation(real_obj, name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, shader, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(shader, &real_obj);
_detach_program_object(¤t_ctx->ostate, real_obj, 0, 1);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_detach_program_object(¤t_ctx->ostate, real_obj, 1, 1);
_COREGL_FASTPATH_FUNC_END();
}
+static void
+_set_gl_vertex_attrib(GLGlueContext *current_ctx, GLuint index, GLfloat x, GLfloat y,
+ GLfloat z, GLfloat w)
+{
+ 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;
+ current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
+
+ current_ctx->gl_vertex_attrib_value[index * 4 + 0] = x;
+ current_ctx->gl_vertex_attrib_value[index * 4 + 1] = y;
+ current_ctx->gl_vertex_attrib_value[index * 4 + 2] = z;
+ current_ctx->gl_vertex_attrib_value[index * 4 + 3] = w;
+ }
+}
void
fastpath_glVertexAttrib1f(GLuint index, GLfloat x)
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib1f(index, x)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = x;
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = 0;
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = 0;
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = 1;
- }
+ _set_gl_vertex_attrib(current_ctx, index, x, 0, 0, 1);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib1fv(index, values)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = values[0];
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = 0;
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = 0;
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = 1;
- }
+ _set_gl_vertex_attrib(current_ctx, index, values[0], 0, 0, 1);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib2f(index, x, y)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = x;
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = y;
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = 0;
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = 1;
- }
+ _set_gl_vertex_attrib(current_ctx, index, x, y, 0, 1);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib2fv(index, values)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = values[0];
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = values[1];
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = 0;
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = 1;
- }
+ _set_gl_vertex_attrib(current_ctx, index, values[0], values[1], 0, 1);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib3f(index, x, y, z)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = x;
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = y;
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = z;
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = 1;
- }
+ _set_gl_vertex_attrib(current_ctx, index, x, y, z, 1);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib3fv(index, values)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = values[0];
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = values[1];
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = values[2];
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = 1;
- }
+ _set_gl_vertex_attrib(current_ctx, index, values[0], values[1], values[2], 1);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib4f(index, x, y, z, w)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = x;
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = y;
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = z;
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = w;
- }
+ _set_gl_vertex_attrib(current_ctx, index, x, y, z, w);
}
goto finish;
INIT_FASTPATH_GL_FUNC();
IF_GL_SUCCESS(_orig_fastpath_glVertexAttrib4fv(index, values)) {
- 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;
- current_ctx->gl_vertex_array_integer[index] = GL_FALSE;
-
- current_ctx->gl_vertex_attrib_value[index * 4 + 0] = values[0];
- current_ctx->gl_vertex_attrib_value[index * 4 + 1] = values[1];
- current_ctx->gl_vertex_attrib_value[index * 4 + 2] = values[2];
- current_ctx->gl_vertex_attrib_value[index * 4 + 3] = values[3];
- }
+ _set_gl_vertex_attrib(current_ctx, index, values[0], values[1], values[2], values[3]);
}
goto finish;
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
DEFINE_FASTPAH_GL_FUNC();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
switch (ftype) {
case FASTPATH_FUNC_TYPE_STANDARD:
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;
-
- AST(current_ctx->ostate.shared != NULL);
-
- objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
+ objid_array = _init_objid_array(current_ctx, n, arrays);
if (objid_array == NULL) goto finish;
{
int real_n = 0;
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj) ;
_orig_fastpath_glTransformFeedbackVaryings(real_obj, count, varyings,
bufferMode);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetTransformFeedbackVarying(real_obj, index, bufSize, length,
size, type, name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetUniformuiv(real_obj, location, params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
ret = _orig_fastpath_glGetFragDataLocation(real_obj, name);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetUniformIndices(real_obj, uniformCount, uniformNames,
uniformIndices);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetActiveUniformsiv(real_obj, uniformCount, uniformIndices,
pname, params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
ret = _orig_fastpath_glGetUniformBlockIndex(real_obj, uniformBlockName);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetActiveUniformBlockiv(real_obj, uniformBlockIndex, pname,
params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetActiveUniformBlockName(real_obj, uniformBlockIndex, bufSize,
length, uniformBlockName);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glUniformBlockBinding(real_obj, uniformBlockIndex,
uniformBlockBinding);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix2fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix3fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix4fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform1ui(real_obj, location, x);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform2ui(real_obj, location, x, y);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform3ui(real_obj, location, x, y, z);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform4ui(real_obj, location, x, y, z, w);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform1uiv(real_obj, location, count, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform2uiv(real_obj, location, count, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj) ;
_orig_fastpath_glProgramUniform3uiv(real_obj, location, count, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniform4uiv(real_obj, location, count, value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix2x3fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix3x2fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix4x2fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix2x4fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix3x4fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glProgramUniformMatrix4x3fv(real_obj, location, count, transpose,
value);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetnUniformfv(real_obj, location, bufSize, params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetnUniformiv(real_obj, location, bufSize, params);
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
- _set_gl_error(GL_INVALID_VALUE);
- goto finish;
- }
+ GET_PROG_REAL_OBJ(program, &real_obj);
_orig_fastpath_glGetnUniformuiv(real_obj, location, bufSize, params);