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:
authorClément Foucault <foucault.clem@gmail.com>2018-04-09 19:43:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-10 11:26:09 +0300
commita74e782f5b3e1df763274e3c8f803562dbbd9a89 (patch)
treea9c61170182e8cb7ee8652a6ca352667d17c122c /source/blender/blenfont
parentc0ac908fe864a6156a7307859f6b4744f532c927 (diff)
BLF: Fix broken shadows on certain hardware.
This was due to uninitialized texture space.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 6ab95e0a59a..da9aeaed449 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -242,7 +242,11 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, gc->p2_width, gc->p2_height, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
+
+ unsigned int pix_count = (unsigned int)(gc->p2_width * gc->p2_height);
+ unsigned char *pixels = MEM_callocN(pix_count * sizeof(*pixels), "BLF texture init");
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, gc->p2_width, gc->p2_height, 0, GL_RED, GL_UNSIGNED_BYTE, pixels);
+ MEM_freeN(pixels);
}
GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)