GPU: only call glShadeModel when needed
authorCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jun 2016 20:11:14 +0000 (06:11 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jun 2016 20:11:14 +0000 (06:11 +1000)
source/blender/gpu/intern/gpu_basic_shader.c

index 1e60944c23d31434270c04c04d61f61789ab441f..4ac1c48f9d27b53013a192c076af1d5dc1d9ced0 100644 (file)
@@ -512,7 +512,7 @@ void GPU_basic_shader_bind(int options)
                if (options & GPU_SHADER_FLAT_NORMAL) {
                        glShadeModel(GL_FLAT);
                }
                if (options & GPU_SHADER_FLAT_NORMAL) {
                        glShadeModel(GL_FLAT);
                }
-               else {
+               else if (bound_options & GPU_SHADER_FLAT_NORMAL) {
                        glShadeModel(GL_SMOOTH);
                }
        }
                        glShadeModel(GL_SMOOTH);
                }
        }