Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-08-20 10:23:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-20 10:26:51 +0300
commit8037f3602f12080a1692746e5ee0b6c46c7c3d76 (patch)
treecbad4e4bffc75d264b21f2c9133ad28f22bd78de /source/blender/gpu/GPU_matrix.h
parent33b265c4fb532523b8707d99799bf36b25b7b1e3 (diff)
PyAPI: Add exceptions to stack push/pop
Raise exception when stack limits are reached.
Diffstat (limited to 'source/blender/gpu/GPU_matrix.h')
-rw-r--r--source/blender/gpu/GPU_matrix.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 219c7b1c6c1..4e136ed34b2 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -113,6 +113,16 @@ const float (*gpuGetNormalMatrixInverse(float m[3][3]))[3];
void gpuBindMatrices(const Gwn_ShaderInterface*);
bool gpuMatricesDirty(void); /* since last bind */
+
+/* Python API needs to be able to inspect the stack so errors raise exceptions instead of crashing. */
+#ifdef USE_GPU_PY_MATRIX_API
+int GPU_matrix_stack_level_get_model_view(void);
+int GPU_matrix_stack_level_get_projection(void);
+/* static assert ensures this doesn't change! */
+#define GPU_PY_MATRIX_STACK_LEN 31
+#endif /* USE_GPU_PY_MATRIX_API */
+
+
#ifdef __cplusplus
}
#endif