[Bf-blender-cvs] [97fa285ae1] blender2.8: OpenGL: add gpuMatrixUpdate_legacy function
Mike Erwin
noreply at git.blender.org
Tue Feb 7 05:25:04 CET 2017
Commit: 97fa285ae1b9b320f04ac0ac427917abc2de180a
Author: Mike Erwin
Date: Mon Feb 6 23:23:36 2017 -0500
Branches: blender2.8
https://developer.blender.org/rB97fa285ae1b9b320f04ac0ac427917abc2de180a
OpenGL: add gpuMatrixUpdate_legacy function
Marks matrix state as dirty so shader will use the latest values from glScale, glTranslate, etc.
We'll remove this after transitioning 100% to the new matrix API, which handles this sort of thing automatically.
Part of T49450
===================================================================
M source/blender/gpu/GPU_matrix.h
M source/blender/gpu/intern/gpu_matrix.c
===================================================================
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 4390b62379..43a03f8e4b 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -133,6 +133,9 @@ const float *gpuGetNormalMatrixInverse(float m[3][3]);
#if SUPPORT_LEGACY_MATRIX
/* copy top matrix from each legacy stack into new fresh stack */
void gpuMatrixBegin3D_legacy(void);
+
+/* call after using glScale, glTranslate, etc. between draw calls */
+void gpuMatrixUpdate_legacy(void);
#endif
diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c
index b70aa4b770..ba84d3d7e0 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -699,3 +699,11 @@ bool gpuMatricesDirty()
{
return state.dirty;
}
+
+#if SUPPORT_LEGACY_MATRIX
+void gpuMatrixUpdate_legacy()
+{
+ BLI_assert(state.mode == MATRIX_MODE_INACTIVE);
+ state.dirty = true;
+}
+#endif
More information about the Bf-blender-cvs
mailing list