]> git.sesse.net Git - nageru/blobdiff - flow.cpp
Fix a comment.
[nageru] / flow.cpp
index 05ddfcf2bc370c9b5b3109e8a97782bb14287821..f16eda22ac82e5458a85955bbed8b276c976d21e 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -695,11 +695,8 @@ void SetupEquations::exec(GLuint I_x_y_tex, GLuint I_t_tex, GLuint diff_flow_tex
        glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 }
 
-// Calculate the smoothness constraints between neighboring pixels;
-// s_x(x,y) stores smoothness between pixel (x,y) and (x+1,y),
-// and s_y(x,y) stores between (x,y) and (x,y+1). We'll sample with
-// border color (0,0) later, so that there's zero diffusion out of
-// the border.
+// Actually solve the equation sets made by SetupEquations, by means of
+// successive over-relaxation (SOR).
 //
 // See variational_refinement.txt for more information.
 class SOR {
@@ -913,7 +910,7 @@ void GPUTimers::print()
                for (int i = 0; i < timer.level * 2; ++i) {
                        fprintf(stderr, " ");
                }
-               fprintf(stderr, "%-30s %4.1f ms\n", timer.name.c_str(), (time_end - time_start) / 1e6);
+               fprintf(stderr, "%-30s %4.1f ms\n", timer.name.c_str(), GLint64(time_end - time_start) / 1e6);
        }
 }
 
@@ -1024,6 +1021,7 @@ int main(int argc, char **argv)
        GLuint initial_flow_tex;
        glCreateTextures(GL_TEXTURE_2D, 1, &initial_flow_tex);
        glTextureStorage2D(initial_flow_tex, 1, GL_RG16F, 1, 1);
+       glClearTexImage(initial_flow_tex, 0, GL_RG, GL_FLOAT, nullptr);
        int prev_level_width = 1, prev_level_height = 1;
 
        GLuint prev_level_flow_tex = initial_flow_tex;