Lines Matching refs:ctx
200 _mesa_lookup_vao(struct gl_context *ctx, GLuint id)
209 if (ctx->API == API_OPENGL_COMPAT)
210 return ctx->Array.DefaultVAO;
216 if (ctx->Array.LastLookedUpVAO &&
217 ctx->Array.LastLookedUpVAO->Name == id) {
218 vao = ctx->Array.LastLookedUpVAO;
221 _mesa_HashLookupLocked(ctx->Array.Objects, id);
223 _mesa_reference_vao(ctx, &ctx->Array.LastLookedUpVAO, vao);
238 * array object when ctx is a compatibility profile context and id is zero.
243 _mesa_lookup_vao_err(struct gl_context *ctx, GLuint id,
253 if (is_ext_dsa || ctx->API == API_OPENGL_CORE) {
254 _mesa_error(ctx, GL_INVALID_OPERATION,
261 return ctx->Array.DefaultVAO;
265 if (ctx->Array.LastLookedUpVAO &&
266 ctx->Array.LastLookedUpVAO->Name == id) {
267 vao = ctx->Array.LastLookedUpVAO;
270 _mesa_HashLookupLocked(ctx->Array.Objects, id);
279 _mesa_error(ctx, GL_INVALID_OPERATION,
295 _mesa_reference_vao(ctx, &ctx->Array.LastLookedUpVAO, vao);
309 _mesa_unbind_array_object_vbos(struct gl_context *ctx,
315 _mesa_reference_buffer_object(ctx, &obj->BufferBinding[i].BufferObj, NULL);
323 _mesa_new_vao(struct gl_context *ctx, GLuint name)
327 _mesa_initialize_vao(ctx, obj, name);
336 _mesa_delete_vao(struct gl_context *ctx, struct gl_vertex_array_object *obj)
338 _mesa_unbind_array_object_vbos(ctx, obj);
339 _mesa_reference_buffer_object(ctx, &obj->IndexBufferObj, NULL);
351 _mesa_reference_vao_(struct gl_context *ctx,
371 _mesa_delete_vao(ctx, oldObj);
395 _mesa_initialize_vao(struct gl_context *ctx,
399 memcpy(vao, &ctx->Array.DefaultVAOState, sizeof(*vao));
447 * GLbitfield vbomask = inputs_read & _mesa_draw_vbo_array_bits(ctx);
471 * GLbitfield usermask = inputs_read & _mesa_draw_user_array_bits(ctx);
495 * GLbitfield curmask = inputs_read & _mesa_draw_current_bits(ctx);
499 * = _mesa_draw_current_attrib(ctx, attr);
517 _mesa_update_vao_derived_arrays(struct gl_context *ctx,
525 ctx->Const.MaxVertexAttribRelativeOffset;
556 if (ctx->Const.AllowDynamicVAOFastPath && ++vao->NumUpdates > 4) {
614 * [0, ctx->Const.MaxVertexAttribRelativeOffset].
811 _mesa_set_vao_immutable(struct gl_context *ctx,
814 _mesa_update_vao_derived_arrays(ctx, vao);
825 _mesa_vao_map_arrays(struct gl_context *ctx, struct gl_vertex_array_object *vao,
841 _mesa_bufferobj_map_range(ctx, 0, bo->Size, access, bo, MAP_INTERNAL);
850 _mesa_vao_map(struct gl_context *ctx, struct gl_vertex_array_object *vao,
857 _mesa_bufferobj_map_range(ctx, 0, bo->Size, access, bo, MAP_INTERNAL);
859 _mesa_vao_map_arrays(ctx, vao, access);
867 _mesa_vao_unmap_arrays(struct gl_context *ctx,
883 _mesa_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
892 _mesa_vao_unmap(struct gl_context *ctx, struct gl_vertex_array_object *vao)
898 _mesa_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
900 _mesa_vao_unmap_arrays(ctx, vao);
913 bind_vertex_array(struct gl_context *ctx, GLuint id, bool no_error)
915 struct gl_vertex_array_object *const oldObj = ctx->Array.VAO;
930 newObj = ctx->Array.DefaultVAO;
934 newObj = _mesa_lookup_vao(ctx, id);
936 _mesa_error(ctx, GL_INVALID_OPERATION,
954 _mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
956 _mesa_reference_vao(ctx, &ctx->Array.VAO, newObj);
961 if (ctx->API == API_OPENGL_CORE &&
962 (oldObj == ctx->Array.DefaultVAO) != (newObj == ctx->Array.DefaultVAO))
963 _mesa_update_valid_to_render_state(ctx);
970 GET_CURRENT_CONTEXT(ctx);
971 bind_vertex_array(ctx, id, true);
978 GET_CURRENT_CONTEXT(ctx);
979 bind_vertex_array(ctx, id, false);
990 delete_vertex_arrays(struct gl_context *ctx, GLsizei n, const GLuint *ids)
999 struct gl_vertex_array_object *obj = _mesa_lookup_vao(ctx, ids[i]);
1008 if (obj == ctx->Array.VAO)
1012 _mesa_HashRemoveLocked(ctx->Array.Objects, obj->Name);
1014 if (ctx->Array.LastLookedUpVAO == obj)
1015 _mesa_reference_vao(ctx, &ctx->Array.LastLookedUpVAO, NULL);
1016 if (ctx->Array._DrawVAO == obj)
1017 _mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
1022 _mesa_reference_vao(ctx, &obj, NULL);
1031 GET_CURRENT_CONTEXT(ctx);
1032 delete_vertex_arrays(ctx, n, ids);
1039 GET_CURRENT_CONTEXT(ctx);
1042 _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArray(n)");
1046 delete_vertex_arrays(ctx, n, ids);
1061 gen_vertex_arrays(struct gl_context *ctx, GLsizei n, GLuint *arrays,
1069 _mesa_HashFindFreeKeys(ctx->Array.Objects, arrays, n);
1078 obj = _mesa_new_vao(ctx, arrays[i]);
1080 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
1084 _mesa_HashInsertLocked(ctx->Array.Objects, obj->Name, obj, true);
1090 gen_vertex_arrays_err(struct gl_context *ctx, GLsizei n, GLuint *arrays,
1094 _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
1098 gen_vertex_arrays(ctx, n, arrays, create, func);
1109 GET_CURRENT_CONTEXT(ctx);
1110 gen_vertex_arrays(ctx, n, arrays, false, "glGenVertexArrays");
1117 GET_CURRENT_CONTEXT(ctx);
1118 gen_vertex_arrays_err(ctx, n, arrays, false, "glGenVertexArrays");
1129 GET_CURRENT_CONTEXT(ctx);
1130 gen_vertex_arrays(ctx, n, arrays, true, "glCreateVertexArrays");
1137 GET_CURRENT_CONTEXT(ctx);
1138 gen_vertex_arrays_err(ctx, n, arrays, true, "glCreateVertexArrays");
1153 GET_CURRENT_CONTEXT(ctx);
1154 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
1156 obj = _mesa_lookup_vao(ctx, id);
1169 vertex_array_element_buffer(struct gl_context *ctx, GLuint vaobj, GLuint buffer,
1175 ASSERT_OUTSIDE_BEGIN_END(ctx);
1184 vao =_mesa_lookup_vao_err(ctx, vaobj, false, "glVertexArrayElementBuffer");
1188 vao = _mesa_lookup_vao(ctx, vaobj);
1198 bufObj = _mesa_lookup_bufferobj_err(ctx, buffer,
1201 bufObj = _mesa_lookup_bufferobj(ctx, buffer);
1210 _mesa_reference_buffer_object(ctx, &vao->IndexBufferObj, bufObj);
1217 GET_CURRENT_CONTEXT(ctx);
1218 vertex_array_element_buffer(ctx, vaobj, buffer, true);
1225 GET_CURRENT_CONTEXT(ctx);
1226 vertex_array_element_buffer(ctx, vaobj, buffer, false);
1233 GET_CURRENT_CONTEXT(ctx);
1236 ASSERT_OUTSIDE_BEGIN_END(ctx);
1244 vao = _mesa_lookup_vao_err(ctx, vaobj, false, "glGetVertexArrayiv");
1254 _mesa_error(ctx, GL_INVALID_ENUM,