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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-04-05 15:01:35 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-04-05 15:01:35 +0400
commita53a106065d7d71e2bc9d65668b0e811e8751713 (patch)
tree94793fe57e048e7150feb48420c71f5f239a0738 /source/blender/editors/screen/glutil.c
parent898ba93a12117de413a9a5cd7b3fdf8c0d39ee7b (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/glutil.c')
-rw-r--r--source/blender/editors/screen/glutil.c7
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 {