Merge branch 'master' into blender2.8
[blender.git] / source / blender / gpu / intern / gpu_buffers.c
index f80ce3c1fab8cd4f5b6b007536ab13944a162b47..bd7a3b628c8af03d587dc7ecb7ff787ebc700a1e 100644 (file)
@@ -1863,8 +1863,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;