Merge branch 'master' into blender2.8
[blender.git] / source / blender / gpu / intern / gpu_buffers.c
index 2c6f204..6214659 100644 (file)
@@ -1867,8 +1867,10 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial,
 
                if (wireframe)
                        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
-               else
-                       glShadeModel((buffers->smooth || buffers->face_indices_len) ? GL_SMOOTH : GL_FLAT);
+               else {
+                       bound_options = GPU_basic_shader_bound_options();
+                       GPU_basic_shader_bind(bound_options | ((buffers->smooth || buffers->face_indices_len) ? 0 : GPU_SHADER_FLAT_NORMAL));
+               }
 
                if (buffers->tot_quad) {
                        const char *offset = base;