#include "glformats.h"
#include "texstore.h"
#include "transformfeedback.h"
+#include "varray.h"
/* Debug flags */
bindTarget = get_buffer_target(ctx, target);
if (!bindTarget) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target 0x%x)", target);
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target %s)",
+ _mesa_enum_to_string(target));
return;
}
*/
static void
unbind(struct gl_context *ctx,
- struct gl_buffer_object **ptr,
+ struct gl_vertex_array_object *vao, unsigned index,
struct gl_buffer_object *obj)
{
- if (*ptr == obj) {
- _mesa_reference_buffer_object(ctx, ptr, ctx->Shared->NullBufferObj);
+ if (vao->BufferBinding[index].BufferObj == obj) {
+ _mesa_bind_vertex_buffer(ctx, vao, index, ctx->Shared->NullBufferObj,
+ vao->BufferBinding[index].Offset,
+ vao->BufferBinding[index].Stride);
}
}
_mesa_buffer_unmap_all_mappings(ctx, bufObj);
/* unbind any vertex pointers bound to this buffer */
- for (j = 0; j < ARRAY_SIZE(vao->VertexBinding); j++) {
- unbind(ctx, &vao->VertexBinding[j].BufferObj, bufObj);
+ for (j = 0; j < ARRAY_SIZE(vao->BufferBinding); j++) {
+ unbind(ctx, vao, j, bufObj);
}
if (ctx->Array.ArrayBufferObj == bufObj) {
const char *func)
{
if (!buffer_object_subdata_range_good(ctx, bufObj, offset, size,
- false, func)) {
+ true, func)) {
/* error already recorded */
return;
}
const GLsizeiptr *sizes)
{
if (offsets[index] < 0) {
- /* The ARB_multi_bind spec says:
- *
- * "An INVALID_VALUE error is generated by BindBuffersRange if any
- * value in <offsets> is less than zero (per binding)."
- */
+ /* The ARB_multi_bind spec says:
+ *
+ * "An INVALID_VALUE error is generated by BindBuffersRange if any
+ * value in <offsets> is less than zero (per binding)."
+ */
_mesa_error(ctx, GL_INVALID_VALUE,
"glBindBuffersRange(offsets[%u]=%" PRId64 " < 0)",
index, (int64_t) offsets[index]);
}
if (sizes[index] <= 0) {
- /* The ARB_multi_bind spec says:
- *
- * "An INVALID_VALUE error is generated by BindBuffersRange if any
- * value in <sizes> is less than or equal to zero (per binding)."
- */
+ /* The ARB_multi_bind spec says:
+ *
+ * "An INVALID_VALUE error is generated by BindBuffersRange if any
+ * value in <sizes> is less than or equal to zero (per binding)."
+ */
_mesa_error(ctx, GL_INVALID_VALUE,
"glBindBuffersRange(sizes[%u]=%" PRId64 " <= 0)",
index, (int64_t) sizes[index]);
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!bufObj || bufObj == &DummyBufferObject) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "glInvalidateBufferSubData(name = 0x%x) invalid object",
+ "glInvalidateBufferSubData(name = %u) invalid object",
buffer);
return;
}
bufObj = _mesa_lookup_bufferobj(ctx, buffer);
if (!bufObj || bufObj == &DummyBufferObject) {
_mesa_error(ctx, GL_INVALID_VALUE,
- "glInvalidateBufferData(name = 0x%x) invalid object",
+ "glInvalidateBufferData(name = %u) invalid object",
buffer);
return;
}