Lines Matching full:stack
103 static void matrix_frustum(struct gl_matrix_stack* stack, in matrix_frustum() argument
121 _math_matrix_frustum(stack->Top, in matrix_frustum()
125 stack->ChangedSincePush = true; in matrix_frustum()
126 ctx->NewState |= stack->DirtyFlag; in matrix_frustum()
143 * the top matrix of the current matrix stack and sets
167 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixFrustumEXT() local
169 if (!stack) in _mesa_MatrixFrustumEXT()
172 matrix_frustum(stack, in _mesa_MatrixFrustumEXT()
181 matrix_ortho(struct gl_matrix_stack* stack, in matrix_ortho() argument
203 _math_matrix_ortho( stack->Top, in matrix_ortho()
207 stack->ChangedSincePush = true; in matrix_ortho()
208 ctx->NewState |= stack->DirtyFlag; in matrix_ortho()
225 * the top matrix of the current matrix stack and sets
249 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixOrthoEXT() local
251 if (!stack) in _mesa_MatrixOrthoEXT()
254 matrix_ortho(stack, in _mesa_MatrixOrthoEXT()
263 * Set the current matrix stack.
265 * \param mode matrix stack.
271 * with the specified matrix stack.
276 struct gl_matrix_stack * stack; in _mesa_MatrixMode() local
283 stack = NULL; in _mesa_MatrixMode()
285 stack = get_named_matrix_stack(ctx, mode, "glMatrixMode"); in _mesa_MatrixMode()
288 if (stack) { in _mesa_MatrixMode()
289 ctx->CurrentStack = stack; in _mesa_MatrixMode()
297 push_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in push_matrix() argument
300 if (stack->Depth + 1 >= stack->MaxDepth) { in push_matrix()
311 if (stack->Depth + 1 >= stack->StackSize) { in push_matrix()
312 unsigned new_stack_size = stack->StackSize * 2; in push_matrix()
315 os_realloc_aligned(stack->Stack, stack->StackSize * sizeof(GLmatrix), in push_matrix()
323 for (i = stack->StackSize; i < new_stack_size; i++) in push_matrix()
326 stack->Stack = new_stack; in push_matrix()
327 stack->StackSize = new_stack_size; in push_matrix()
330 _math_matrix_push_copy(&stack->Stack[stack->Depth + 1], in push_matrix()
331 &stack->Stack[stack->Depth]); in push_matrix()
332 stack->Depth++; in push_matrix()
333 stack->Top = &(stack->Stack[stack->Depth]); in push_matrix()
334 stack->ChangedSincePush = false; in push_matrix()
339 * Push the current matrix stack.
343 * Verifies the current matrix stack is not full, and duplicates the top-most
344 * matrix in the stack.
345 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
351 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PushMatrix() local
357 push_matrix(ctx, stack, ctx->Transform.MatrixMode, "glPushMatrix"); in _mesa_PushMatrix()
365 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPushEXT() local
368 if (stack) in _mesa_MatrixPushEXT()
369 push_matrix(ctx, stack, matrixMode, "glMatrixPushEXT"); in _mesa_MatrixPushEXT()
374 pop_matrix( struct gl_context *ctx, struct gl_matrix_stack *stack ) in pop_matrix() argument
376 if (stack->Depth == 0) in pop_matrix()
379 stack->Depth--; in pop_matrix()
384 if (stack->ChangedSincePush && in pop_matrix()
385 memcmp(stack->Top, &stack->Stack[stack->Depth], in pop_matrix()
388 ctx->NewState |= stack->DirtyFlag; in pop_matrix()
391 stack->Top = &(stack->Stack[stack->Depth]); in pop_matrix()
392 stack->ChangedSincePush = true; in pop_matrix()
398 * Pop the current matrix stack.
402 * Flushes the vertices, verifies the current matrix stack is not empty, and
403 * moves the stack head down.
404 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
410 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PopMatrix() local
416 if (!pop_matrix(ctx, stack)) { in _mesa_PopMatrix()
434 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPopEXT() local
436 if (!stack) in _mesa_MatrixPopEXT()
439 if (!pop_matrix(ctx, stack)) { in _mesa_MatrixPopEXT()
454 _mesa_load_identity_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack) in _mesa_load_identity_matrix() argument
458 _math_matrix_set_identity(stack->Top); in _mesa_load_identity_matrix()
459 stack->ChangedSincePush = true; in _mesa_load_identity_matrix()
460 ctx->NewState |= stack->DirtyFlag; in _mesa_load_identity_matrix()
470 * top-most matrix in the current stack.
471 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
488 struct gl_matrix_stack *stack; in _mesa_MatrixLoadIdentityEXT() local
490 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixLoadIdentityEXT"); in _mesa_MatrixLoadIdentityEXT()
491 if (!stack) in _mesa_MatrixLoadIdentityEXT()
494 _mesa_load_identity_matrix(ctx, stack); in _mesa_MatrixLoadIdentityEXT()
499 _mesa_load_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in _mesa_load_matrix() argument
502 if (memcmp(m, stack->Top->m, 16 * sizeof(GLfloat)) != 0) { in _mesa_load_matrix()
504 _math_matrix_loadf(stack->Top, m); in _mesa_load_matrix()
505 stack->ChangedSincePush = true; in _mesa_load_matrix()
506 ctx->NewState |= stack->DirtyFlag; in _mesa_load_matrix()
512 matrix_load(struct gl_context *ctx, struct gl_matrix_stack *stack, in matrix_load() argument
525 _mesa_load_matrix(ctx, stack, m); in matrix_load()
537 * matrix in the current stack and the given matrix.
538 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
560 struct gl_matrix_stack * stack = in _mesa_MatrixLoadfEXT() local
562 if (!stack) in _mesa_MatrixLoadfEXT()
565 matrix_load(ctx, stack, m, "glMatrixLoadfEXT"); in _mesa_MatrixLoadfEXT()
570 matrix_mult(struct gl_matrix_stack *stack, const GLfloat *m, const char* caller) in matrix_mult() argument
588 _math_matrix_mul_floats(stack->Top, m); in matrix_mult()
589 stack->ChangedSincePush = true; in matrix_mult()
590 ctx->NewState |= stack->DirtyFlag; in matrix_mult()
602 * matrix in the current stack and the given matrix. Marks
603 * __struct gl_contextRec::NewState with the dirty stack flag.
617 struct gl_matrix_stack * stack = in _mesa_MatrixMultfEXT() local
619 if (!stack) in _mesa_MatrixMultfEXT()
622 matrix_mult(stack, m, "glMultMatrix"); in _mesa_MatrixMultfEXT()
627 matrix_rotate(struct gl_matrix_stack *stack, GLfloat angle, in matrix_rotate() argument
634 _math_matrix_rotate(stack->Top, angle, x, y, z); in matrix_rotate()
635 stack->ChangedSincePush = true; in matrix_rotate()
636 ctx->NewState |=stack->DirtyFlag; in matrix_rotate()
652 * matrix in the current stack and the given parameters. Marks
653 * __struct gl_contextRec::NewState with the dirty stack flag.
667 struct gl_matrix_stack *stack = in _mesa_MatrixRotatefEXT() local
669 if (!stack) in _mesa_MatrixRotatefEXT()
672 matrix_rotate(stack, angle, x, y, z, "glMatrixRotatefEXT"); in _mesa_MatrixRotatefEXT()
686 * matrix in the current stack and the given parameters. Marks
687 * __struct gl_contextRec::NewState with the dirty stack flag.
704 struct gl_matrix_stack *stack; in _mesa_MatrixScalefEXT() local
707 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixScalefEXT"); in _mesa_MatrixScalefEXT()
708 if (!stack) in _mesa_MatrixScalefEXT()
712 _math_matrix_scale(stack->Top, x, y, z); in _mesa_MatrixScalefEXT()
713 stack->ChangedSincePush = true; in _mesa_MatrixScalefEXT()
714 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixScalefEXT()
728 * matrix in the current stack and the given parameters. Marks
729 * __struct gl_contextRec::NewState with the dirty stack flag.
747 struct gl_matrix_stack *stack = in _mesa_MatrixTranslatefEXT() local
749 if (!stack) in _mesa_MatrixTranslatefEXT()
753 _math_matrix_translate(stack->Top, x, y, z); in _mesa_MatrixTranslatefEXT()
754 stack->ChangedSincePush = true; in _mesa_MatrixTranslatefEXT()
755 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixTranslatefEXT()
927 * Update the projection matrix stack.
990 /** Matrix stack initialization */
995 * Initialize a matrix stack.
997 * \param stack matrix stack.
998 * \param maxDepth maximum stack depth.
1001 * Allocates an array of \p maxDepth elements for the matrix stack and calls
1005 init_matrix_stack(struct gl_matrix_stack *stack, in init_matrix_stack() argument
1008 stack->Depth = 0; in init_matrix_stack()
1009 stack->MaxDepth = maxDepth; in init_matrix_stack()
1010 stack->DirtyFlag = dirtyFlag; in init_matrix_stack()
1011 /* The stack will be dynamically resized at glPushMatrix() time */ in init_matrix_stack()
1012 stack->Stack = os_malloc_aligned(sizeof(GLmatrix), 16); in init_matrix_stack()
1013 stack->StackSize = 1; in init_matrix_stack()
1014 _math_matrix_ctr(&stack->Stack[0]); in init_matrix_stack()
1015 stack->Top = stack->Stack; in init_matrix_stack()
1016 stack->ChangedSincePush = false; in init_matrix_stack()
1020 * Free matrix stack.
1022 * \param stack matrix stack.
1025 free_matrix_stack( struct gl_matrix_stack *stack ) in free_matrix_stack() argument
1027 os_free_aligned(stack->Stack); in free_matrix_stack()
1028 stack->Stack = stack->Top = NULL; in free_matrix_stack()
1029 stack->StackSize = 0; in free_matrix_stack()