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:
authorRay Molenkamp <github@lazydodo.com>2018-06-22 23:35:32 +0300
committerRay Molenkamp <github@lazydodo.com>2018-06-22 23:35:32 +0300
commit575c71b6701fc6480428c08d2af1a45afedbd09e (patch)
tree161baaacb48598e79afefe4c69290b991e2c0994 /source/blender/blenfont/intern/blf_glyph.c
parent2d7606daa508cedb98b6ce84a27d39515925cab0 (diff)
Blenfont: Fix texture not being initialized in recent refactor.
Caused some gpus to have issues with the font shadows. thanks @fclem for helping tracking this one down.
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 02d166739ec..51b43d0d168 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -238,7 +238,9 @@ static void blf_glyph_cache_texture(FontBLF *font, GlyphCacheBLF *gc)
gc->p2_height = font->tex_size_max;
}
- GPUTexture *tex = GPU_texture_create_2D(gc->p2_width, gc->p2_height, GPU_R8, NULL, error);;
+ unsigned char *pixels = MEM_callocN((size_t)gc->p2_width * (size_t)gc->p2_height, "BLF texture init");
+ GPUTexture *tex = GPU_texture_create_2D(gc->p2_width, gc->p2_height, GPU_R8, (const float*)pixels, error);
+ MEM_freeN(pixels);
gc->textures[gc->texture_current] = tex;
GPU_texture_bind(tex, 0);
GPU_texture_wrap_mode(tex, false);