Home | History | Annotate | Download | only in main

Lines Matching refs:ctx

68          GET_CURRENT_CONTEXT(ctx);
69 if (ctx)
70 ctx->Driver.DeleteTransformFeedback(ctx, oldObj);
98 _mesa_validate_transform_feedback_buffers(struct gl_context *ctx)
110 _mesa_init_transform_feedback(struct gl_context *ctx)
113 ASSERT(ctx->Driver.NewTransformFeedback);
115 ctx->TransformFeedback.DefaultObject =
116 ctx->Driver.NewTransformFeedback(ctx, 0);
118 assert(ctx->TransformFeedback.DefaultObject->RefCount == 1);
120 reference_transform_feedback_object(&ctx->TransformFeedback.CurrentObject,
121 ctx->TransformFeedback.DefaultObject);
123 assert(ctx->TransformFeedback.DefaultObject->RefCount == 2);
125 ctx->TransformFeedback.Objects = _mesa_NewHashTable();
127 _mesa_reference_buffer_object(ctx,
128 &ctx->TransformFeedback.CurrentBuffer,
129 ctx->Shared->NullBufferObj);
140 struct gl_context *ctx = (struct gl_context *) userData;
144 ctx->Driver.DeleteTransformFeedback(ctx, obj);
152 _mesa_free_transform_feedback(struct gl_context *ctx)
155 ASSERT(ctx->Driver.NewTransformFeedback);
157 _mesa_reference_buffer_object(ctx,
158 &ctx->TransformFeedback.CurrentBuffer,
162 _mesa_HashDeleteAll(ctx->TransformFeedback.Objects, delete_cb, ctx);
163 _mesa_DeleteHashTable(ctx->TransformFeedback.Objects);
166 assert(ctx->Driver.DeleteTransformFeedback);
167 ctx->Driver.DeleteTransformFeedback(ctx,
168 ctx->TransformFeedback.DefaultObject);
170 ctx->TransformFeedback.CurrentObject = NULL;
178 new_transform_feedback(struct gl_context *ctx, GLuint name);
181 delete_transform_feedback(struct gl_context *ctx,
186 _mesa_init_transform_feedback(struct gl_context *ctx)
188 ctx->TransformFeedback.DefaultObject = new_transform_feedback(ctx, 0);
189 ctx->TransformFeedback.CurrentObject = ctx->TransformFeedback.DefaultObject;
190 _mesa_reference_buffer_object(ctx,
191 &ctx->TransformFeedback.CurrentBuffer,
192 ctx->Shared->NullBufferObj);
196 _mesa_free_transform_feedback(struct gl_context *ctx)
198 _mesa_reference_buffer_object(ctx,
199 &ctx->TransformFeedback.CurrentBuffer,
201 ctx->TransformFeedback.CurrentObject = NULL;
202 delete_transform_feedback(ctx, ctx->TransformFeedback.DefaultObject);
208 /** Default fallback for ctx->Driver.NewTransformFeedback() */
210 new_transform_feedback(struct gl_context *ctx, GLuint name)
221 /** Default fallback for ctx->Driver.DeleteTransformFeedback() */
223 delete_transform_feedback(struct gl_context *ctx,
229 _mesa_reference_buffer_object(ctx, &obj->Buffers[i], NULL);
239 /** Default fallback for ctx->Driver.BeginTransformFeedback() */
241 begin_transform_feedback(struct gl_context *ctx, GLenum mode,
247 /** Default fallback for ctx->Driver.EndTransformFeedback() */
249 end_transform_feedback(struct gl_context *ctx,
255 /** Default fallback for ctx->Driver.PauseTransformFeedback() */
257 pause_transform_feedback(struct gl_context *ctx,
263 /** Default fallback for ctx->Driver.ResumeTransformFeedback() */
265 resume_transform_feedback(struct gl_context *ctx,
318 GET_CURRENT_CONTEXT(ctx);
320 obj = ctx->TransformFeedback.CurrentObject;
322 if (ctx->Shader.CurrentVertexProgram == NULL) {
323 _mesa_error(ctx, GL_INVALID_OPERATION,
328 info = &ctx->Shader.CurrentVertexProgram->LinkedTransformFeedback;
331 _mesa_error(ctx, GL_INVALID_OPERATION,
343 _mesa_error(ctx, GL_INVALID_ENUM, "glBeginTransformFeedback(mode)");
348 _mesa_error(ctx, GL_INVALID_OPERATION,
355 _mesa_error(ctx, GL_INVALID_OPERATION,
362 FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
364 ctx->TransformFeedback.Mode = mode;
366 assert(ctx->Driver.BeginTransformFeedback);
367 ctx->Driver.BeginTransformFeedback(ctx, mode, obj);
375 GET_CURRENT_CONTEXT(ctx);
377 obj = ctx->TransformFeedback.CurrentObject;
380 _mesa_error(ctx, GL_INVALID_OPERATION,
385 FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
386 ctx->TransformFeedback.CurrentObject->Active = GL_FALSE;
387 ctx->TransformFeedback.CurrentObject->Paused = GL_FALSE;
388 ctx->TransformFeedback.CurrentObject->EndedAnytime = GL_TRUE;
390 assert(ctx->Driver.EndTransformFeedback);
391 ctx->Driver.EndTransformFeedback(ctx, obj);
399 bind_buffer_range(struct gl_context *ctx, GLuint index,
404 ctx->TransformFeedback.CurrentObject;
412 _mesa_reference_buffer_object(ctx,
413 &ctx->TransformFeedback.CurrentBuffer,
417 _mesa_reference_buffer_object(ctx,
434 _mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx,
442 obj = ctx->TransformFeedback.CurrentObject;
445 _mesa_error(ctx, GL_INVALID_OPERATION,
450 if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
451 _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(index=%d)", index);
457 _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(size=%d)", (int) size);
463 _mesa_error(ctx, GL_INVALID_VALUE,
468 bind_buffer_range(ctx, index, bufObj, offset, size);
478 _mesa_bind_buffer_base_transform_feedback(struct gl_context *ctx,
485 obj = ctx->TransformFeedback.CurrentObject;
488 _mesa_error(ctx, GL_INVALID_OPERATION,
493 if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
494 _mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferBase(index=%d)", index);
503 bind_buffer_range(ctx, index, bufObj, 0, size);
518 GET_CURRENT_CONTEXT(ctx);
522 _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferOffsetEXT(target)");
526 obj = ctx->TransformFeedback.CurrentObject;
529 _mesa_error(ctx, GL_INVALID_OPERATION,
534 if (index >= ctx->Const.MaxTransformFeedbackBuffers) {
535 _mesa_error(ctx, GL_INVALID_VALUE,
542 _mesa_error(ctx, GL_INVALID_VALUE,
548 bufObj = ctx->Shared->NullBufferObj;
550 bufObj = _mesa_lookup_bufferobj(ctx, buffer);
554 _mesa_error(ctx, GL_INVALID_OPERATION,
564 bind_buffer_range(ctx, index, bufObj, offset, size);
578 GET_CURRENT_CONTEXT(ctx);
586 _mesa_error(ctx, GL_INVALID_ENUM,
593 (GLuint) count > ctx->Const.MaxTransformFeedbackBuffers)) {
594 _mesa_error(ctx, GL_INVALID_VALUE,
599 shProg = _mesa_lookup_shader_program(ctx, program);
601 _mesa_error(ctx, GL_INVALID_VALUE,
606 if (ctx->Extensions.ARB_transform_feedback3) {
615 if (buffers > ctx->Const.MaxTransformFeedbackBuffers) {
616 _mesa_error(ctx, GL_INVALID_OPERATION,
628 _mesa_error(ctx, GL_INVALID_OPERATION,
649 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTransformFeedbackVaryings()");
678 GET_CURRENT_CONTEXT(ctx);
680 shProg = _mesa_lookup_shader_program(ctx, program);
682 _mesa_error(ctx, GL_INVALID_VALUE,
689 _mesa_error(ctx, GL_INVALID_VALUE,
708 _mesa_lookup_transform_feedback_object(struct gl_context *ctx, GLuint name)
711 return ctx->TransformFeedback.DefaultObject;
715 _mesa_HashLookup(ctx->TransformFeedback.Objects, name);
729 GET_CURRENT_CONTEXT(ctx);
731 ASSERT_OUTSIDE_BEGIN_END(ctx);
734 _mesa_error(ctx, GL_INVALID_VALUE, "glGenTransformFeedbacks(n < 0)");
742 first = _mesa_HashFindFreeKeyBlock(ctx->TransformFeedback.Objects, n);
747 = ctx->Driver.NewTransformFeedback(ctx, first + i);
749 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTransformFeedbacks");
753 _mesa_HashInsert(ctx->TransformFeedback.Objects, first + i, obj);
757 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenTransformFeedbacks");
769 GET_CURRENT_CONTEXT(ctx);
771 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
773 if (name && _mesa_lookup_transform_feedback_object(ctx, name))
788 GET_CURRENT_CONTEXT(ctx);
791 _mesa_error(ctx, GL_INVALID_ENUM, "glBindTransformFeedback(target)");
795 if (ctx->TransformFeedback.CurrentObject->Active &&
796 !ctx->TransformFeedback.CurrentObject->Paused) {
797 _mesa_error(ctx, GL_INVALID_OPERATION,
802 obj = _mesa_lookup_transform_feedback_object(ctx, name);
804 _mesa_error(ctx, GL_INVALID_OPERATION,
809 reference_transform_feedback_object(&ctx->TransformFeedback.CurrentObject,
822 GET_CURRENT_CONTEXT(ctx);
824 ASSERT_OUTSIDE_BEGIN_END(ctx);
827 _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteTransformFeedbacks(n < 0)");
837 = _mesa_lookup_transform_feedback_object(ctx, names[i]);
840 _mesa_error(ctx, GL_INVALID_OPERATION,
845 _mesa_HashRemove(ctx->TransformFeedback.Objects, names[i]);
862 GET_CURRENT_CONTEXT(ctx);
864 obj = ctx->TransformFeedback.CurrentObject;
867 _mesa_error(ctx, GL_INVALID_OPERATION,
872 FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
875 assert(ctx->Driver.PauseTransformFeedback);
876 ctx->Driver.PauseTransformFeedback(ctx, obj);
888 GET_CURRENT_CONTEXT(ctx);
890 obj = ctx->TransformFeedback.CurrentObject;
893 _mesa_error(ctx, GL_INVALID_OPERATION,
898 FLUSH_VERTICES(ctx, _NEW_TRANSFORM_FEEDBACK);
901 assert(ctx->Driver.ResumeTransformFeedback);
902 ctx->Driver.ResumeTransformFeedback(ctx, obj);