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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2015-11-28 03:45:23 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2015-11-28 17:35:34 +0300
commitc76fbf10e2f6dc766763a760e5bb34f64274a253 (patch)
treea0b50faa4223b428151d40a74b0a90159d9efe6b /source/blender/gpu/intern/gpu_extensions.c
parent8e1c63b3962e8e51fca23c19915c8dba675391e8 (diff)
OpenGL: remove unnecessarily paranoid bound texture preservation.
Diffstat (limited to 'source/blender/gpu/intern/gpu_extensions.c')
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index cb7b192b0d9..ddb7aa4cf8f 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -701,17 +701,15 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, int channels, const f
GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, bool is_data, double time, int mipmap)
{
GPUTexture *tex;
- GLint w, h, border, lastbindcode, bindcode;
-
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
+ GLint w, h, border, bindcode;
GPU_update_image_time(ima, time);
- /* this binds a texture, so that's why to restore it with lastbindcode */
+ /* this binds a texture, so that's why to restore it to 0 */
bindcode = GPU_verify_image(ima, iuser, 0, 0, mipmap, is_data);
if (ima->gputexture) {
ima->gputexture->bindcode = bindcode;
- glBindTexture(GL_TEXTURE_2D, lastbindcode);
+ glBindTexture(GL_TEXTURE_2D, 0);
return ima->gputexture;
}
@@ -738,7 +736,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, bool is_data,
tex->h = tex->h_orig = h - border;
}
- glBindTexture(GL_TEXTURE_2D, lastbindcode);
+ glBindTexture(GL_TEXTURE_2D, 0);
return tex;
}
@@ -746,21 +744,19 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, bool is_data,
GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
{
GPUTexture *tex = prv->gputexture[0];
- GLint w, h, lastbindcode;
+ GLint w, h;
GLuint bindcode = 0;
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &lastbindcode);
-
if (tex)
bindcode = tex->bindcode;
- /* this binds a texture, so that's why to restore it */
+ /* this binds a texture, so that's why we restore it to 0 */
if (bindcode == 0) {
GPU_create_gl_tex(&bindcode, prv->rect[0], NULL, prv->w[0], prv->h[0], mipmap, 0, NULL);
}
if (tex) {
tex->bindcode = bindcode;
- glBindTexture(GL_TEXTURE_2D, lastbindcode);
+ glBindTexture(GL_TEXTURE_2D, 0);
return tex;
}
@@ -785,7 +781,7 @@ GPUTexture *GPU_texture_from_preview(PreviewImage *prv, int mipmap)
tex->h = tex->h_orig = h;
}
- glBindTexture(GL_TEXTURE_2D, lastbindcode);
+ glBindTexture(GL_TEXTURE_2D, 0);
return tex;