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:
authorMike Erwin <significant.bit@gmail.com>2016-10-25 08:02:41 +0300
committerMike Erwin <significant.bit@gmail.com>2016-10-25 08:02:41 +0300
commitc5072941c3902bd91824a7d8756933dbf97f78cf (patch)
tree87491f54e59c99616b863041e7df5f71c2fe4bcf /source/blender/gpu/intern/gpu_viewport.c
parent4d11b2fb9172789cd0171712ae88e6aa98eb3743 (diff)
OpenGL: clean up glActiveTexture usage
Removed some of my earlier glActiveTexture calls. After reviewing the code I now trust that GL_TEXTURE0 is active by default. Fewer GL calls, same results. Fixed some misuse of glActiveTexture & glUniformi, mostly my fault. Caught by --debug-gpu on Windows. Don't know why this appeared to be working previously! Plus some easy cleanup nearby.
Diffstat (limited to 'source/blender/gpu/intern/gpu_viewport.c')
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index 6cad0506cf4..ea54f3cc57c 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -89,9 +89,6 @@ void GPU_viewport_debug_depth_draw(GPUViewport *viewport, const float znear, con
const float w = (float)GPU_texture_width(viewport->debug_depth);
const float h = (float)GPU_texture_height(viewport->debug_depth);
- const int activeTex = GL_TEXTURE0;
- glActiveTexture(activeTex);
-
VertexFormat *format = immVertexFormat();
unsigned texcoord = add_attrib(format, "texCoord", GL_FLOAT, 2, KEEP_FLOAT);
unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT);
@@ -102,7 +99,7 @@ void GPU_viewport_debug_depth_draw(GPUViewport *viewport, const float znear, con
immUniform1f("znear", znear);
immUniform1f("zfar", zfar);
- immUniform1i("image", activeTex);
+ immUniform1i("image", 0); /* default GL_TEXTURE0 unit */
immBegin(GL_QUADS, 4);