CURR_STATE_UPDATE(gl_client_active_texture, 0, texture)
}
}
+
goto finish;
finish:
INIT_FASTPATH_GL_FUNC();
if(CURR_STATE_COMPARE(gl_sample_coverage_value, 0, value) ||
- CURR_STATE_COMPARE(gl_sample_coverage_invert, 0, invert))
- {
+ CURR_STATE_COMPARE(gl_sample_coverage_invert, 0, invert)) {
IF_GL_SUCCESS(_orig_fastpath_glSampleCoveragex(value, invert)) {
current_ctx->_misc_flag1 |=
_MISC_FLAG1_BIT_gl_sample_coverage_value |
CURR_STATE_UPDATE(gl_sample_coverage_invert, 0, invert);
}
}
+
goto finish;
finish:
{
int active_idx;
GLuint real_obj;
+ int i;
DEFINE_FASTPAH_GL_FUNC();
_COREGL_FASTPATH_FUNC_BEGIN();
active_idx = current_ctx->gl_active_texture[0] - GL_TEXTURE0;
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_TEXTURE, texture, &real_obj) != 1) {
- _set_gl_error(GL_OUT_OF_MEMORY);
- goto finish;
- }
-
+ /* in case of user didn't call glGenTextures first */
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_TEXTURE, texture, &real_obj) != 1)
+ real_obj = texture;
#define STATE_PROC(gl_state, flagid, flagbit) \
- if CURR_STATE_COMPARE(gl_state, active_idx, real_obj) { \
+ if(texture == 0) { \
+ IF_GL_SUCCESS(_orig_fastpath_glBindTexture(target, real_obj)) { \
+ current_ctx->flagid &= ~(flagbit##_##gl_state); \
+ for(i = 0; i < current_ctx->gl_tex_units_num[0]; i++) \
+ CURR_STATE_CLEAR(gl_state, i); \
+ } \
+ } \
+ else if CURR_STATE_COMPARE(gl_state, active_idx, real_obj) { \
IF_GL_SUCCESS(_orig_fastpath_glBindTexture(target, real_obj)) { \
current_ctx->flagid |= flagbit##_##gl_state; \
CURR_STATE_UPDATE(gl_state, active_idx, real_obj); \
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES:
STATE_PROC(gl_tex_2d_multisample_array_oes_state, _tex_flag2, _TEX_FLAG2_BIT);
break;
+ case GL_TEXTURE_CUBE_MAP_ARRAY_EXT:
+ STATE_PROC(gl_tex_cube_map_array_ext_state, _tex_flag2, _TEX_FLAG2_BIT);
+ break;
default:
_set_gl_error(GL_INVALID_ENUM);
break;
if (cur_gctx->gl_tex_external_oes_state[j] == objid_array[i]) {
CURR_STATE_CLEAR(gl_tex_external_oes_state, j)
}
+ if (cur_gctx->gl_tex_buffer_ext_state[j] == objid_array[i]) {
+ CURR_STATE_CLEAR(gl_tex_buffer_ext_state, j)
+ }
+ if (cur_gctx->gl_tex_2d_multisample_state[j] == objid_array[i]) {
+ CURR_STATE_CLEAR(gl_tex_2d_multisample_state, j)
+ }
+ if (cur_gctx->gl_tex_2d_multisample_array_oes_state[j] == objid_array[i]) {
+ CURR_STATE_CLEAR(gl_tex_2d_multisample_array_oes_state, j)
+ }
+ if (cur_gctx->gl_tex_cube_map_array_ext_state[j] == objid_array[i]) {
+ CURR_STATE_CLEAR(gl_tex_cube_map_array_ext_state, j)
+ }
}
}
_COREGL_FASTPATH_FUNC_END();
}
-////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGenBuffers(GLsizei n, GLuint *buffers)
{
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) {
- _set_gl_error(GL_OUT_OF_MEMORY);
- goto finish;
- }
+ /* in case of user didn't call glGenBuffer first */
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1)
+ real_obj = buffer;
/* clear states set in fastpath_glBindBufferBase() */
#define BIND_STATE_ARRAY_CLEAR(gl_state) \
_COREGL_FASTPATH_FUNC_END();
}
+void
+fastpath_glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+{
+ GLuint real_obj;
+
+ DEFINE_FASTPAH_GL_FUNC();
+ _COREGL_FASTPATH_FUNC_BEGIN();
+ INIT_FASTPATH_GL_FUNC();
+
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) {
+ _set_gl_error(GL_INVALID_VALUE);
+ goto finish;
+ }
+
+#define STATE_PROC(gl_state, flagid, flagbit) \
+ if CURR_STATE_COMPARE(gl_state##_array, index, real_obj) { \
+ IF_GL_SUCCESS(_orig_fastpath_glBindBufferBase(target, index, real_obj)) { \
+ current_ctx->flagid |= flagbit##_##gl_state; \
+ CURR_STATE_UPDATE(gl_state##_array, index, real_obj) \
+ current_ctx->gl_state##_array_offset[index] = 0; \
+ current_ctx->gl_state##_array_size[index] = 0; \
+ } \
+ }
+
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ STATE_PROC(gl_transform_feedback_buffer_binding, _bind_flag2, _BIND_FLAG2_BIT);
+ break;
+ case GL_UNIFORM_BUFFER:
+ STATE_PROC(gl_uniform_buffer_binding, _bind_flag2, _BIND_FLAG2_BIT);
+ break;
+ case GL_SHADER_STORAGE_BUFFER:
+ STATE_PROC(gl_shader_storage_buffer_binding, _bind_flag3, _BIND_FLAG3_BIT);
+ break;
+ case GL_ATOMIC_COUNTER_BUFFER:
+ STATE_PROC(gl_atomic_counter_buffer_binding, _bind_flag3, _BIND_FLAG3_BIT);
+ break;
+ default:
+ _set_gl_error(GL_INVALID_ENUM);
+ break;
+ }
+
+
+#undef STATE_PROC
+
+ goto finish;
+
+finish:
+ _COREGL_FASTPATH_FUNC_END();
+}
+
+void
+fastpath_glBindBufferRange(GLenum target, GLuint index, GLuint buffer,
+ GLintptr offset, GLsizeiptr size)
+{
+ GLuint real_obj;
+
+ DEFINE_FASTPAH_GL_FUNC();
+ _COREGL_FASTPATH_FUNC_BEGIN();
+ INIT_FASTPATH_GL_FUNC();
+
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) {
+ _set_gl_error(GL_INVALID_VALUE);
+ goto finish;
+ }
+
+#define STATE_PROC(gl_state, flagid, flagbit) \
+ { \
+ if (CURR_STATE_COMPARE(gl_state##_array, index, real_obj) || \
+ current_ctx->gl_state##_array_offset[index] != offset || \
+ current_ctx->gl_state##_array_size[index] != size) { \
+ IF_GL_SUCCESS(_orig_fastpath_glBindBufferRange(target, index, real_obj, offset, size)) { \
+ current_ctx->flagid |= flagbit##gl_state; \
+ CURR_STATE_UPDATE(gl_state##_array, index, real_obj) \
+ current_ctx->gl_state##_array_offset[index] = offset; \
+ current_ctx->gl_state##_array_size[index] = size; \
+ } \
+ } \
+ }
+
+
+ switch (target) {
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ STATE_PROC(gl_transform_feedback_buffer_range_binding, _bind_flag4, _BIND_FLAG4_BIT_);
+ break;
+ case GL_UNIFORM_BUFFER:
+ STATE_PROC(gl_uniform_buffer_range_binding, _bind_flag4, _BIND_FLAG4_BIT_);
+ break;
+ case GL_SHADER_STORAGE_BUFFER:
+ STATE_PROC(gl_shader_storage_buffer_range_binding, _bind_flag4, _BIND_FLAG4_BIT_);
+ break;
+ case GL_ATOMIC_COUNTER_BUFFER:
+ STATE_PROC(gl_atomic_counter_buffer_range_binding, _bind_flag4, _BIND_FLAG4_BIT_);
+ break;
+ default:
+ _set_gl_error(GL_INVALID_ENUM);
+ break;
+ }
+
+#undef STATE_PROC
+
+ goto finish;
+
+finish:
+ _COREGL_FASTPATH_FUNC_END();
+}
GLboolean
fastpath_glIsBuffer(GLuint buffer)
void
fastpath_glDeleteBuffers(GLsizei n, const GLuint *buffers)
{
- int i;
+ int i, j;
GLuint *objid_array = NULL;
DEFINE_FASTPAH_GL_FUNC();
cur_gctx->_bind_flag2 &= (~_BIND_FLAG2_BIT_gl_uniform_buffer_binding);
CURR_STATE_CLEAR(gl_uniform_buffer_binding, 0)
}
+ /* clear states array set in fastpath_glBindBufferBase() */
+ for(j = 0; j < cur_gctx->gl_transform_feedback_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_transform_feedback_buffer_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag2 &=
+ (~_BIND_FLAG2_BIT_gl_transform_feedback_buffer_binding);
+ CURR_STATE_CLEAR(gl_transform_feedback_buffer_binding_array, j)
+ }
+ }
+ for(j = 0; j < cur_gctx->gl_uniform_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_uniform_buffer_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag2 &= (~_BIND_FLAG2_BIT_gl_uniform_buffer_binding);
+ CURR_STATE_CLEAR(gl_uniform_buffer_binding_array, j)
+ }
+ }
+ for(j = 0; j < cur_gctx->gl_shader_storage_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_shader_storage_buffer_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag3 &= (~_BIND_FLAG3_BIT_gl_shader_storage_buffer_binding);
+ CURR_STATE_CLEAR(gl_shader_storage_buffer_binding_array, j)
+ }
+ }
+ for(j = 0; j < cur_gctx->gl_atomic_counter_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_atomic_counter_buffer_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag3 &= (~_BIND_FLAG3_BIT_gl_atomic_counter_buffer_binding);
+ CURR_STATE_CLEAR(gl_atomic_counter_buffer_binding_array, j)
+ }
+ }
+ /* clear states array set in fastpath_glBindBufferRange() */
+ for(j = 0; j < cur_gctx->gl_transform_feedback_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_transform_feedback_buffer_range_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag3 &= (~_BIND_FLAG4_BIT_gl_transform_feedback_buffer_range_binding);
+ CURR_STATE_CLEAR(gl_transform_feedback_buffer_range_binding_array, j)
+ cur_gctx->gl_transform_feedback_buffer_range_binding_array_offset[j] = 0;
+ cur_gctx->gl_transform_feedback_buffer_range_binding_array_size[j] = 0;
+ }
+ }
+ for(j = 0; j < cur_gctx->gl_uniform_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_uniform_buffer_range_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag3 &= (~_BIND_FLAG4_BIT_gl_uniform_buffer_range_binding);
+ CURR_STATE_CLEAR(gl_uniform_buffer_range_binding_array, j)
+ cur_gctx->gl_uniform_buffer_range_binding_array_offset[j] = 0;
+ cur_gctx->gl_uniform_buffer_range_binding_array_size[j] = 0;
+ }
+ }
+ for(j = 0; j < cur_gctx->gl_shader_storage_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_shader_storage_buffer_range_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag4 &= (~_BIND_FLAG4_BIT_gl_shader_storage_buffer_range_binding);
+ CURR_STATE_CLEAR(gl_shader_storage_buffer_range_binding_array, j)
+ cur_gctx->gl_shader_storage_buffer_range_binding_array_offset[j] = 0;
+ cur_gctx->gl_shader_storage_buffer_range_binding_array_size[j] = 0;
+ }
+ }
+ for(j = 0; j < cur_gctx->gl_atomic_counter_buffer_binding_num[0]; j++) {
+ if (cur_gctx->gl_atomic_counter_buffer_range_binding_array[j] == objid_array[i]) {
+ cur_gctx->_bind_flag4 &= (~_BIND_FLAG4_BIT_gl_atomic_counter_buffer_range_binding);
+ CURR_STATE_CLEAR(gl_atomic_counter_buffer_range_binding_array, j)
+ cur_gctx->gl_atomic_counter_buffer_range_binding_array_offset[j] = 0;
+ cur_gctx->gl_atomic_counter_buffer_range_binding_array_size[j] = 0;
+ }
+ }
}
current = current->next;
}
_COREGL_FASTPATH_FUNC_END();
}
-//////////////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGenFramebuffers(GLsizei n, GLuint *framebuffers)
{
_COREGL_FASTPATH_FUNC_END();
}
-
void
fastpath_glBindFramebuffer(GLenum target, GLuint framebuffer)
{
_COREGL_FASTPATH_FUNC_END();
}
-
GLboolean
fastpath_glIsFramebuffer(GLuint framebuffer)
{
_COREGL_FASTPATH_FUNC_END();
}
-//////////////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
{
return ret;
}
-
void
fastpath_glDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
{
_COREGL_FASTPATH_FUNC_END();
}
-
-//////////////////////////////////////////////////////////////////////////////////
-
GLuint
fastpath_glCreateProgram(void)
{
return ret;
}
-
GLuint
fastpath_glCreateShader(GLenum type)
{
return ret;
}
-
void
fastpath_glShaderSource(GLuint shader, GLsizei count, const char **string,
const GLint *length)
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glShaderSource(real_obj, count, string, length);
goto finish;
_COREGL_FASTPATH_FUNC_END();
}
-
void
fastpath_glShaderBinary(GLsizei n, const GLuint *shaders, GLenum binaryformat,
const void *binary, GLsizei length)
void
fastpath_glActiveShaderProgramEXT(GLuint pipeline, GLuint program)
{
- GLuint real_obj;
+ GLuint real_program_obj;
+ GLuint real_pipeline_obj;
DEFINE_FASTPAH_GL_FUNC();
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_program_obj) != 1) {
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
- _orig_fastpath_glActiveShaderProgramEXT(pipeline, real_obj);
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_pipeline_obj) != 1) {
+ _set_gl_error(GL_INVALID_OPERATION);
+ goto finish;
+ }
+
+ _orig_fastpath_glActiveShaderProgramEXT(real_pipeline_obj, real_program_obj);
goto finish;
_COREGL_FASTPATH_FUNC_END();
}
-
void
fastpath_glProgramParameteriEXT(GLuint program, GLenum pname, GLint value)
{
_COREGL_FASTPATH_FUNC_END();
}
-
-
-//////////////////////////////////////////////////////////////////////////////////
-
void
fastpath_glBlendColor(GLclampf red, GLclampf green, GLclampf blue,
GLclampf alpha)
if (CURR_STATE_COMPARE(gl_blend_color, 0, red) ||
CURR_STATE_COMPARE(gl_blend_color, 1, green) ||
CURR_STATE_COMPARE(gl_blend_color, 2, blue) ||
- CURR_STATE_COMPARE(gl_blend_color, 3, alpha)
- ) {
+ CURR_STATE_COMPARE(gl_blend_color, 3, alpha)) {
IF_GL_SUCCESS(_orig_fastpath_glBlendColor(red, green, blue, alpha)) {
current_ctx->_blend_flag |= _BLEND_FLAG_BIT_gl_blend_color;
CURR_STATE_UPDATE(gl_blend_color, 0, red)
_COREGL_FASTPATH_FUNC_END();
}
-
void
fastpath_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
{
case GL_SAMPLE_MASK:
STATE_PROC(gl_sample_mask, _enable_flag2, _ENABLE_FLAG2_BIT);
break;
+ case GL_BLEND_ADVANCED_COHERENT_KHR:
+ STATE_PROC(gl_blend_advanced_coherent_khr, _enable_flag3, _ENABLE_FLAG3_BIT);
+ break;
default:
_set_gl_error(GL_INVALID_ENUM);
break;
INIT_FASTPATH_GL_FUNC();
#define STATE_PROC(gl_state, flagid, flagbit) \
- if CURR_STATE_COMPARE(gl_state, 0, GL_TRUE) \
- { \
+ if CURR_STATE_COMPARE(gl_state, 0, GL_TRUE) { \
_orig_fastpath_glEnable(cap); \
current_ctx->flagid |= flagbit##_##gl_state; \
CURR_STATE_UPDATE(gl_state, 0, GL_TRUE) \
}
-
switch (cap) {
case GL_BLEND:
STATE_PROC(gl_blend, _enable_flag1, _ENABLE_FLAG1_BIT);
case GL_STENCIL_TEST:
STATE_PROC(gl_stencil_test, _enable_flag2, _ENABLE_FLAG2_BIT);
break;
+ case GL_SAMPLE_MASK:
+ STATE_PROC(gl_sample_mask, _enable_flag2, _ENABLE_FLAG2_BIT);
+ break;
case GL_BLEND_ADVANCED_COHERENT_KHR:
STATE_PROC(gl_blend_advanced_coherent_khr, _enable_flag3, _ENABLE_FLAG3_BIT);
break;
+ case GL_SAMPLE_SHADING_OES:
+ STATE_PROC(gl_sample_shading_oes, _enable_flag2, _ENABLE_FLAG2_BIT);
+ break;
default:
_set_gl_error(GL_INVALID_ENUM);
break;
_COREGL_FASTPATH_FUNC_END();
}
-
void
fastpath_glEnableVertexAttribArray(GLuint index)
{
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
-
#define STATE_PROC(gl_state, flagid, flagbit) \
if CURR_STATE_COMPARE(gl_state, 0, mode) { \
IF_GL_SUCCESS(_orig_fastpath_glHint(target, mode)) { \
} \
}
-
switch (target) {
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT:
STATE_PROC_WITH_CHECK(gl_fragment_shader_derivative_hint, _misc_flag1,
goto finish;
}
- _orig_fastpath_glFramebufferTextureLayer(target, attachment, texture, level,
+ _orig_fastpath_glFramebufferTextureLayer(target, attachment, real_obj, level,
layer);
goto finish;
_COREGL_FASTPATH_FUNC_END();
}
-
-////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGenVertexArrays(GLsizei n, GLuint *arrays)
{
_COREGL_FASTPATH_FUNC_END();
}
-////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGetIntegeri_v(GLenum target, GLuint index, GLint *data)
{
_COREGL_FASTPATH_FUNC_END();
}
-////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGenTransformFeedbacks(GLsizei n, GLuint *ids)
{
_COREGL_FASTPATH_FUNC_END();
}
-////////////////////////////////////////////////////////////////////////
-
-
-void
-fastpath_glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
-{
- GLuint real_obj;
-
- DEFINE_FASTPAH_GL_FUNC();
- _COREGL_FASTPATH_FUNC_BEGIN();
- INIT_FASTPATH_GL_FUNC();
-
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) {
- _set_gl_error(GL_OUT_OF_MEMORY);
- goto finish;
- }
-
-#define STATE_PROC(gl_state, flagid, flagbit) \
- if CURR_STATE_COMPARE(gl_state##_array, index, real_obj) { \
- IF_GL_SUCCESS(_orig_fastpath_glBindBufferBase(target, index, real_obj)) { \
- current_ctx->flagid |= flagbit##_##gl_state; \
- CURR_STATE_UPDATE(gl_state##_array, index, real_obj) \
- current_ctx->gl_state##_array_offset[index] = 0; \
- current_ctx->gl_state##_array_size[index] = 0; \
- } \
- }
-
- switch (target) {
- case GL_TRANSFORM_FEEDBACK_BUFFER:
- STATE_PROC(gl_transform_feedback_buffer_binding, _bind_flag2, _BIND_FLAG2_BIT);
- break;
- case GL_UNIFORM_BUFFER:
- STATE_PROC(gl_uniform_buffer_binding, _bind_flag2, _BIND_FLAG2_BIT);
- break;
- case GL_SHADER_STORAGE_BUFFER:
- STATE_PROC(gl_shader_storage_buffer_binding, _bind_flag3, _BIND_FLAG3_BIT);
- break;
- case GL_ATOMIC_COUNTER_BUFFER:
- STATE_PROC(gl_atomic_counter_buffer_binding, _bind_flag3, _BIND_FLAG3_BIT);
- break;
- default:
- _set_gl_error(GL_INVALID_ENUM);
- break;
- }
-
-
-#undef STATE_PROC
-
- goto finish;
-
-finish:
- _COREGL_FASTPATH_FUNC_END();
-}
-
-
-
-void
-fastpath_glBindBufferRange(GLenum target, GLuint index, GLuint buffer,
- GLintptr offset, GLsizeiptr size)
-{
- GLuint real_obj;
-
- DEFINE_FASTPAH_GL_FUNC();
- _COREGL_FASTPATH_FUNC_BEGIN();
- INIT_FASTPATH_GL_FUNC();
-
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) {
- _set_gl_error(GL_OUT_OF_MEMORY);
- goto finish;
- }
-
-#define STATE_PROC(gl_state, flagnum) \
- { \
- if CURR_STATE_COMPARE(gl_state##_array, index, real_obj) { \
- IF_GL_SUCCESS(_orig_fastpath_glBindBufferRange(target, index, real_obj, offset, size)) { \
- current_ctx->_bind_flag2 |= _BIND_FLAG2_BIT_##gl_state; \
- CURR_STATE_UPDATE(gl_state##_array, index, real_obj) \
- current_ctx->gl_state##_array_offset[index] = offset; \
- current_ctx->gl_state##_array_size[index] = size; \
- } \
- } \
- }
-
-
- switch (target) {
- case GL_TRANSFORM_FEEDBACK_BUFFER:
- STATE_PROC(gl_transform_feedback_buffer_binding, 0);
- break;
- case GL_UNIFORM_BUFFER:
- STATE_PROC(gl_uniform_buffer_binding, 0);
- break;
- default:
- _set_gl_error(GL_INVALID_ENUM);
- break;
- }
-
-
-#undef STATE_PROC
-
- goto finish;
-
-finish:
- _COREGL_FASTPATH_FUNC_END();
-}
-
-
void
fastpath_glTransformFeedbackVaryings(GLuint program, GLsizei count,
const GLchar *const *varyings, GLenum bufferMode)
_COREGL_FASTPATH_FUNC_END();
}
-
-////////////////////////////////////////////////////////////////////////
-
void
fastpath_glGenSamplers(GLsizei n, GLuint *samplers)
{
}
_orig_fastpath_glBindSampler(unit, real_obj);
+
goto finish;
finish:
_COREGL_FASTPATH_FUNC_END();
}
-////////////////////////////////////////////////////////////////////////
-
-
void
fastpath_glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
{
goto finish;
}
- _orig_fastpath_glGetSamplerParameteriv(real_obj, pname, params);
+ IF_GL_SUCCESS(_orig_fastpath_glGetSamplerParameteriv(real_obj, pname, params)) {
+ _modify_get_value(pname, params, GL_INT, GL_FALSE);
+ }
goto finish;
goto finish;
}
- _orig_fastpath_glGetSamplerParameterfv(real_obj, pname, params);
+ IF_GL_SUCCESS(_orig_fastpath_glGetSamplerParameterfv(real_obj, pname, params)) {
+ _modify_get_value(pname, params, GL_FLOAT, GL_FALSE);
+ }
goto finish;
case GL_COMPUTE_SHADER:
case GL_INFO_LOG_LENGTH:
case GL_VALIDATE_STATUS:
- _orig_fastpath_glGetProgramPipelineiv(real_obj, pname, params);
+ case GL_TESS_CONTROL_SHADER_EXT:
+ case GL_TESS_EVALUATION_SHADER_EXT:
+ case GL_GEOMETRY_SHADER_EXT:
+ IF_GL_SUCCESS(_orig_fastpath_glGetProgramPipelineiv(real_obj, pname, params)) {
+ if(pname != GL_INFO_LOG_LENGTH && pname != GL_VALIDATE_STATUS)
+ _modify_get_value(pname, params, GL_INT, GL_FALSE);
+ }
break;
default:
_set_gl_error(GL_INVALID_ENUM);
void
fastpath_glActiveShaderProgram(GLuint pipeline, GLuint program)
{
- GLuint real_obj;
+ GLuint real_program_obj;
+ GLuint real_pipeline_obj;
DEFINE_FASTPAH_GL_FUNC();
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) {
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_program_obj) != 1) {
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
- _orig_fastpath_glActiveShaderProgram(pipeline, real_obj);
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_pipeline_obj) != 1) {
+ _set_gl_error(GL_INVALID_OPERATION);
+ goto finish;
+ }
+
+ _orig_fastpath_glActiveShaderProgram(real_pipeline_obj, real_program_obj);
goto finish;
fastpath_glBindImageTexture(GLuint unit, GLuint texture, GLint level,
GLboolean layered, GLint layer, GLenum access, GLenum format)
{
+ GLuint real_obj;
+
DEFINE_FASTPAH_GL_FUNC();
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- _orig_fastpath_glBindImageTexture(unit, texture, level, layered, layer, access,
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_TEXTURE, texture, &real_obj) != 1) {
+ _set_gl_error(GL_INVALID_VALUE);
+ goto finish;
+ }
+
+ _orig_fastpath_glBindImageTexture(unit, real_obj, level, layered, layer, access,
format);
goto finish;
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- _orig_fastpath_glGetTexLevelParameteriv (target, level, pname, params);
+ IF_GL_SUCCESS(_orig_fastpath_glGetTexLevelParameteriv (target, level, pname, params)) {
+ _modify_get_value(pname, params, GL_INT, GL_FALSE);
+ }
goto finish;
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- _orig_fastpath_glGetTexLevelParameterfv (target, level, pname, params);
+ IF_GL_SUCCESS(_orig_fastpath_glGetTexLevelParameterfv (target, level, pname, params)) {
+ _modify_get_value(pname, params, GL_FLOAT, GL_FALSE);
+ }
goto finish;
fastpath_glBindVertexBuffer (GLuint bindingindex, GLuint buffer,
GLintptr offset, GLsizei stride)
{
+ GLuint real_obj;
+
DEFINE_FASTPAH_GL_FUNC();
_COREGL_FASTPATH_FUNC_BEGIN();
INIT_FASTPATH_GL_FUNC();
- _orig_fastpath_glBindVertexBuffer(bindingindex, buffer, offset, stride);
+ if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) {
+ _set_gl_error(GL_INVALID_OPERATION);
+ goto finish;
+ }
+
+ _orig_fastpath_glBindVertexBuffer(bindingindex, real_obj, offset, stride);
goto finish;
{
int i;
GLuint *objid_array = NULL;
+ int real_n = 0;
DEFINE_FASTPAH_GL_FUNC();
_COREGL_FASTPATH_FUNC_BEGIN();
AST(current_ctx->ostate.shared != NULL);
objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n);
- {
- int real_n = 0;
- for (i = 0; i < n; i++) {
- int real_objid = _COREGL_INT_INIT_VALUE;
- if (ids[i] == 0) continue;
+ for (i = 0; i < n; i++) {
+ GLuint real_obj;
+ if (ids[i] == 0)
+ continue;
- real_objid = fastpath_ostate_get_object(¤t_ctx->ostate,
- GL_OBJECT_TYPE_QUERY, ids[i]);
- if (real_objid == 0) continue;
+ if(GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, ids[i], &real_obj) != 1)
+ continue;
AST(fastpath_ostate_remove_object(¤t_ctx->ostate, GL_OBJECT_TYPE_QUERY,
ids[i]) == 1);
- objid_array[real_n++] = real_objid;
- }
-
- _orig_fastpath_glDeleteQueriesEXT(real_n, objid_array);
+ objid_array[real_n++] = real_obj;
}
+ _orig_fastpath_glDeleteQueriesEXT(real_n, objid_array);
+
goto finish;
finish:
int real_n = 0;
for (i = 0; i < n; i++) {
- int real_objid = _COREGL_INT_INIT_VALUE;
- if (arrays[i] == 0) continue;
+ GLuint real_objid;
- real_objid = fastpath_ostate_get_object(¤t_ctx->ostate,
- GL_OBJECT_TYPE_VERTEXARRAY, arrays[i]);
- if (real_objid == 0) continue;
+ if (arrays[i] == 0)
+ continue;
+
+ if(GET_REAL_OBJ(GL_OBJECT_TYPE_VERTEXARRAY, arrays[i],&real_objid) != 1)
+ continue;
AST(fastpath_ostate_remove_object(¤t_ctx->ostate,
GL_OBJECT_TYPE_VERTEXARRAY, arrays[i]) == 1);
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glBlendEquationi(real_obj, mode);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glBlendEquationSeparatei(real_obj, modeRGB, modeAlpha);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_OPERATION);
goto finish;
}
+
_orig_fastpath_glTexBuffer(target, internalformat, real_obj);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_OPERATION);
goto finish;
}
+
_orig_fastpath_glTexBufferRange(target, internalformat, real_obj, offset, size);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glGetnUniformfv(real_obj, location, bufSize, params);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glGetnUniformiv(real_obj, location, bufSize, params);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glGetnUniformuiv(real_obj, location, bufSize, params);
+
goto finish;
finish:
}
_orig_fastpath_glSamplerParameterIiv(real_obj, pname, param);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glSamplerParameterIuiv(real_obj, pname, param);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_OPERATION);
goto finish;
}
+
_orig_fastpath_glGetSamplerParameterIiv(real_obj, pname, params);
+
goto finish;
finish:
_set_gl_error(GL_INVALID_VALUE);
goto finish;
}
+
_orig_fastpath_glGetSamplerParameterIuiv(real_obj, pname, params);
+
goto finish;
finish: