[Bf-blender-cvs] [707ee19] temp_viewport_fx_merge: Trying to solve text crash issues
Antony Riakiotakis
noreply at git.blender.org
Tue Apr 14 18:09:16 CEST 2015
Commit: 707ee19146a52858f4375d45d2f5e39bc1009269
Author: Antony Riakiotakis
Date: Tue Apr 14 18:08:16 2015 +0200
Branches: temp_viewport_fx_merge
https://developer.blender.org/rB707ee19146a52858f4375d45d2f5e39bc1009269
Trying to solve text crash issues
===================================================================
M source/blender/blenfont/intern/blf.c
M source/blender/blenlib/intern/math_matrix.c
M source/blender/gpu/GPU_matrix.h
M source/blender/gpu/intern/gpu_basic.c
M source/blender/gpu/intern/gpu_font.c
M source/blender/gpu/intern/gpu_immediate.c
M source/blender/gpu/intern/gpu_private.h
M source/blender/gpu/intern/gpu_raster.c
M source/blender/gpu/intern/gpu_sprite.c
===================================================================
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 1c003bb..93995eb 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -526,6 +526,8 @@ static void blf_draw__start(FontBLF *font, GLint *param)
/* always bind the texture for the first glyph */
font->tex_bind_state = -1;
+ gpu_commit_matrix();
+
/* Save the current parameter to restore it later. */
glGetTexEnviv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
if (*param != GL_MODULATE)
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 9f5f920..5e510cb 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -2380,20 +2380,20 @@ void pseudoinverse_m3_m3(float Ainv[3][3], float A[3][3], float epsilon)
void mat4_ortho_set(float m[][4], float left, float right, float bottom, float top, float nearVal, float farVal)
{
- m[0][0] = 2.0f/(right-left);
+ m[0][0] = 2.0f / (right - left);
m[1][0] = 0.0f;
m[2][0] = 0.0f;
- m[3][0] = -(right+left)/(right-left);
+ m[3][0] = -(right + left) / (right - left);
m[0][1] = 0.0f;
- m[1][1] = 2.0f/(top-bottom);
+ m[1][1] = 2.0f / (top - bottom);
m[2][1] = 0.0f;
- m[3][1] = -(top+bottom)/(top-bottom);
+ m[3][1] = -(top + bottom) / (top - bottom);
m[0][2] = 0.0f;
m[1][2] = 0.0f;
- m[2][2] = -2.0f/(farVal-nearVal);
- m[3][2] = -(farVal+nearVal)/(farVal-nearVal);
+ m[2][2] = -2.0f / (farVal - nearVal);
+ m[3][2] = -(farVal + nearVal) / (farVal - nearVal);
m[0][3] = 0.0f;
m[1][3] = 0.0f;
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index aeccd19..57a9783 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -74,6 +74,8 @@ void gpuLookAt(eGPUMatrixMode stack, GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, G
void gpuProject(const GLfloat obj[3], const GLfloat model[16], const GLfloat proj[16], const GLint view[4], GLfloat win[3]);
GLboolean gpuUnProject(const GLfloat win[3], const GLfloat model[16], const GLfloat proj[16], const GLint view[4], GLfloat obj[3]);
+void gpu_commit_matrix(void);
+
void GPU_feedback_vertex_3fv(GLenum type, GLfloat x, GLfloat y, GLfloat z, GLfloat out[3]);
void GPU_feedback_vertex_4fv(GLenum type, GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat out[4]);
void GPU_feedback_vertex_4dv(GLenum type, GLdouble x, GLdouble y, GLdouble z, GLdouble w, GLdouble out[4]);
diff --git a/source/blender/gpu/intern/gpu_basic.c b/source/blender/gpu/intern/gpu_basic.c
index 266b217..7389983 100644
--- a/source/blender/gpu/intern/gpu_basic.c
+++ b/source/blender/gpu/intern/gpu_basic.c
@@ -52,6 +52,7 @@
#include "GPU_extensions.h"
#include "GPU_state_latch.h"
#include "GPU_debug.h"
+#include "GPU_matrix.h"
/* internal */
#include "intern/gpu_private.h"
diff --git a/source/blender/gpu/intern/gpu_font.c b/source/blender/gpu/intern/gpu_font.c
index 0948ae0..20a1396 100644
--- a/source/blender/gpu/intern/gpu_font.c
+++ b/source/blender/gpu/intern/gpu_font.c
@@ -37,6 +37,7 @@
#include "GPU_extensions.h"
#include "GPU_debug.h"
#include "GPU_font.h"
+#include "GPU_matrix.h"
/* external */
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 861eb23..b97a33a 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -31,6 +31,7 @@
#include "BLI_sys_types.h"
+#include "GPU_matrix.h"
#include "GPU_aspect.h"
#include "GPU_extensions.h"
#include "GPU_immediate.h"
diff --git a/source/blender/gpu/intern/gpu_private.h b/source/blender/gpu/intern/gpu_private.h
index 0f15f2e..a4fdb38 100644
--- a/source/blender/gpu/intern/gpu_private.h
+++ b/source/blender/gpu/intern/gpu_private.h
@@ -86,8 +86,6 @@ bool gpu_is_select_mode(void);
void gpu_matrix_init(void);
void gpu_matrix_exit(void);
-void gpu_commit_matrix(void);
-
void gpu_font_init(void);
void gpu_font_exit(void);
diff --git a/source/blender/gpu/intern/gpu_raster.c b/source/blender/gpu/intern/gpu_raster.c
index e9a4039..c59786e 100644
--- a/source/blender/gpu/intern/gpu_raster.c
+++ b/source/blender/gpu/intern/gpu_raster.c
@@ -36,6 +36,7 @@
#include "GPU_debug.h"
#include "GPU_raster.h"
#include "GPU_immediate.h"
+#include "GPU_matrix.h"
/* internal */
#include "intern/gpu_private.h"
diff --git a/source/blender/gpu/intern/gpu_sprite.c b/source/blender/gpu/intern/gpu_sprite.c
index 7d698c0..28aaa44 100644
--- a/source/blender/gpu/intern/gpu_sprite.c
+++ b/source/blender/gpu/intern/gpu_sprite.c
@@ -38,6 +38,7 @@
#include "GPU_immediate.h"
#include "GPU_debug.h"
#include "GPU_sprite.h"
+#include "GPU_matrix.h"
#include "intern/gpu_private.h"
More information about the Bf-blender-cvs
mailing list