From c5072941c3902bd91824a7d8756933dbf97f78cf Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Tue, 25 Oct 2016 01:02:41 -0400 Subject: 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. --- source/blender/gpu/intern/gpu_viewport.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source/blender/gpu/intern/gpu_viewport.c') 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); -- cgit v1.2.3