Bugfix: don't read from a write-only VBO when updating grid buffers.
authorNicholas Bishop <nicholasbishop@gmail.com>
Thu, 23 Feb 2012 10:35:23 +0000 (10:35 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Thu, 23 Feb 2012 10:35:23 +0000 (10:35 +0000)
source/blender/gpu/intern/gpu_buffers.c

index 48ab313c589784f5fe640b99c82ad73dfd9aed7f..ff269e2050f7003fb264253a830282cbf8f2a2f7 100644 (file)
@@ -1428,10 +1428,10 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, DMGridData **grids,
                                        for(j = 0; j < gridsize-1; ++j) {
                                                for(k = 0; k < gridsize-1; ++k) {
                                                        normal_quad_v3(vert_data[(j+1)*gridsize + (k+1)].no,
-                                                               vert_data[(j+1)*gridsize + k].co,
-                                                               vert_data[(j+1)*gridsize + k+1].co,
-                                                               vert_data[j*gridsize + k+1].co,
-                                                               vert_data[j*gridsize + k].co);
+                                                               grid[(j+1)*gridsize + k].co,
+                                                               grid[(j+1)*gridsize + k+1].co,
+                                                               grid[j*gridsize + k+1].co,
+                                                               grid[j*gridsize + k].co);
                                                }
                                        }
                                }