/* API Functions */
/**********************************************************************/
+void GLAPIENTRY
+_mesa_BindBuffer_no_error(GLenum target, GLuint buffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct gl_buffer_object **bindTarget = get_buffer_target(ctx, target);
+ bind_buffer_object(ctx, bindTarget, buffer);
+}
+
+
void GLAPIENTRY
_mesa_BindBuffer(GLenum target, GLuint buffer)
{
return false;
}
- if (bufObj->Immutable) {
+ if (bufObj->Immutable || bufObj->HandleAllocated) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(immutable)", func);
return false;
}
/* Unmap the existing buffer. We'll replace it now. Not an error. */
_mesa_buffer_unmap_all_mappings(ctx, bufObj);
- FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT);
+ FLUSH_VERTICES(ctx, 0);
bufObj->Written = GL_TRUE;
bufObj->Immutable = GL_TRUE;
return;
}
- if (bufObj->Immutable) {
+ if (bufObj->Immutable || bufObj->HandleAllocated) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(immutable)", func);
return;
}
/* Unmap the existing buffer. We'll replace it now. Not an error. */
_mesa_buffer_unmap_all_mappings(ctx, bufObj);
- FLUSH_VERTICES(ctx, _NEW_BUFFER_OBJECT);
+ FLUSH_VERTICES(ctx, 0);
bufObj->Written = GL_TRUE;
bufObj->MinMaxCacheDirty = true;
}
}
+static ALWAYS_INLINE void
+invalidate_buffer_subdata(struct gl_context *ctx,
+ struct gl_buffer_object *bufObj, GLintptr offset,
+ GLsizeiptr length)
+{
+ if (ctx->Driver.InvalidateBufferSubData)
+ ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
+}
+
+void GLAPIENTRY
+_mesa_InvalidateBufferSubData_no_error(GLuint buffer, GLintptr offset,
+ GLsizeiptr length)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
+ invalidate_buffer_subdata(ctx, bufObj, offset, length);
+}
+
void GLAPIENTRY
_mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
GLsizeiptr length)
return;
}
- if (ctx->Driver.InvalidateBufferSubData)
- ctx->Driver.InvalidateBufferSubData(ctx, bufObj, offset, length);
+ invalidate_buffer_subdata(ctx, bufObj, offset, length);
+}
+
+void GLAPIENTRY
+_mesa_InvalidateBufferData_no_error(GLuint buffer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ struct gl_buffer_object *bufObj =_mesa_lookup_bufferobj(ctx, buffer);
+ invalidate_buffer_subdata(ctx, bufObj, 0, bufObj->Size);
}
void GLAPIENTRY
return;
}
- if (ctx->Driver.InvalidateBufferSubData)
- ctx->Driver.InvalidateBufferSubData(ctx, bufObj, 0, bufObj->Size);
+ invalidate_buffer_subdata(ctx, bufObj, 0, bufObj->Size);
}
static void