diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-05 15:01:35 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-05 15:01:35 +0400 |
commit | a53a106065d7d71e2bc9d65668b0e811e8751713 (patch) | |
tree | 94793fe57e048e7150feb48420c71f5f239a0738 /source/blender/editors/screen | |
parent | 898ba93a12117de413a9a5cd7b3fdf8c0d39ee7b (diff) |
Fix #34872: Every images are displayed as black in UV/image editor
Issue was caused by some mesa drivers does not support GL_RGBA16F.
Now added check around glTexImage2D to verify whether requested
internal format is actually supported. If not blender will fall
back to non-GLSL image display.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index ac8f44a3ab1..b6ee9254396 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -540,6 +540,13 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, if (type == GL_FLOAT) { /* need to set internal format to higher range float */ + + /* NOTE: this could fail on some drivers, like mesa, + * but currently this code is only used by color + * management stuff which already checks on whether + * it's possible to use GL_RGBA16F_ARB + */ + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, tex_w, tex_h, 0, format, GL_FLOAT, NULL); } else { |