[Bf-blender-cvs] [2ff7ba2c6ce] blender2.8: Correct matrix stack assert

Campbell Barton noreply at git.blender.org
Sun Aug 27 03:18:27 CEST 2017


Commit: 2ff7ba2c6ce3af5eed22d5394d1098a3974f268b
Author: Campbell Barton
Date:   Sun Aug 27 11:22:31 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB2ff7ba2c6ce3af5eed22d5394d1098a3974f268b

Correct matrix stack assert

===================================================================

M	source/blender/gpu/intern/gpu_matrix.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c
index 38a55020a5e..11575d8062c 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -121,7 +121,7 @@ static void checkmat(cosnt float *m)
 
 void gpuPushMatrix(void)
 {
-	BLI_assert(ModelViewStack.top < MATRIX_STACK_DEPTH);
+	BLI_assert(ModelViewStack.top + 1 < MATRIX_STACK_DEPTH);
 	ModelViewStack.top++;
 	copy_m4_m4(ModelView, ModelViewStack.stack[ModelViewStack.top - 1]);
 }
@@ -135,7 +135,7 @@ void gpuPopMatrix(void)
 
 void gpuPushProjectionMatrix(void)
 {
-	BLI_assert(ProjectionStack.top < MATRIX_STACK_DEPTH);
+	BLI_assert(ProjectionStack.top + 1 < MATRIX_STACK_DEPTH);
 	ProjectionStack.top++;
 	copy_m4_m4(Projection, ProjectionStack.stack[ProjectionStack.top - 1]);
 }



More information about the Bf-blender-cvs mailing list