]> git.sesse.net Git - nageru/commitdiff
Remove an unused uniform.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 1 Aug 2018 23:15:30 +0000 (01:15 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 1 Aug 2018 23:15:30 +0000 (01:15 +0200)
densify.vert
flow.cpp

index 1859dfc2a0a33e0638ffd393263f7fa426116944..73d696a16c1a5cf642823cb5e9856c874618b5e4 100644 (file)
@@ -6,7 +6,6 @@ flat out vec2 flow_du;
 flat out float mean_diff;
 
 uniform vec2 patch_size;  // In 0..1 coordinates.
-uniform vec2 patch_spacing;  // In 0..1 coordinates.
 uniform sampler2D flow_tex;
 
 void main()
index 04e9c2f4a5b79857c588b7f7902122fe094f5c59..740b23672be7c1cee7db1eb3e88f63004a9c836c 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -489,7 +489,7 @@ private:
        GLuint densify_program;
        GLuint densify_vao;
 
-       GLuint uniform_patch_size, uniform_patch_spacing;
+       GLuint uniform_patch_size;
        GLuint uniform_image0_tex, uniform_image1_tex, uniform_flow_tex;
 };
 
@@ -509,7 +509,6 @@ Densify::Densify()
        glVertexAttribPointer(position_attrib, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
 
        uniform_patch_size = glGetUniformLocation(densify_program, "patch_size");
-       uniform_patch_spacing = glGetUniformLocation(densify_program, "patch_spacing");
        uniform_image0_tex = glGetUniformLocation(densify_program, "image0_tex");
        uniform_image1_tex = glGetUniformLocation(densify_program, "image1_tex");
        uniform_flow_tex = glGetUniformLocation(densify_program, "flow_tex");
@@ -527,14 +526,6 @@ void Densify::exec(GLuint tex0_view, GLuint tex1_view, GLuint flow_tex, GLuint d
                float(patch_size_pixels) / level_width,
                float(patch_size_pixels) / level_height);
 
-       float patch_spacing_x = float(level_width - patch_size_pixels) / (width_patches - 1);
-       float patch_spacing_y = float(level_height - patch_size_pixels) / (height_patches - 1);
-       if (width_patches == 1) patch_spacing_x = 0.0f;  // Avoid infinities.
-       if (height_patches == 1) patch_spacing_y = 0.0f;
-       glProgramUniform2f(densify_program, uniform_patch_spacing,
-               patch_spacing_x / level_width,
-               patch_spacing_y / level_height);
-
        glViewport(0, 0, level_width, level_height);
        glEnable(GL_BLEND);
        glBlendFunc(GL_ONE, GL_ONE);