]> git.sesse.net Git - nageru/commitdiff
Remove some duplicate vertex attributes.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 6 Jul 2018 23:10:32 +0000 (01:10 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 6 Jul 2018 23:10:32 +0000 (01:10 +0200)
flow.cpp
motion_search.vert
vs.vert

index dd22a58c902232ecb33c1934e1e91d24dd5f0a1d..74b0fd03375098891bd082fdc3a93779af8ada72 100644 (file)
--- a/flow.cpp
+++ b/flow.cpp
@@ -240,10 +240,6 @@ Sobel::Sobel()
        glEnableVertexArrayAttrib(sobel_vao, position_attrib);
        glVertexAttribPointer(position_attrib, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
 
-       GLint texcoord_attrib = glGetAttribLocation(sobel_program, "texcoord");
-       glEnableVertexArrayAttrib(sobel_vao, texcoord_attrib);
-       glVertexAttribPointer(texcoord_attrib, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
-
        uniform_tex = glGetUniformLocation(sobel_program, "tex");
        uniform_inv_image_size = glGetUniformLocation(sobel_program, "inv_image_size");
 }
@@ -299,10 +295,6 @@ MotionSearch::MotionSearch()
        glEnableVertexArrayAttrib(motion_search_vao, position_attrib);
        glVertexAttribPointer(position_attrib, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
 
-       GLint texcoord_attrib = glGetAttribLocation(motion_search_program, "texcoord");
-       glEnableVertexArrayAttrib(motion_search_vao, texcoord_attrib);
-       glVertexAttribPointer(texcoord_attrib, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
-
        uniform_image_size = glGetUniformLocation(motion_search_program, "image_size");
        uniform_inv_image_size = glGetUniformLocation(motion_search_program, "inv_image_size");
        uniform_image0_tex = glGetUniformLocation(motion_search_program, "image0_tex");
index d08f499a5dce90213969e9d98bb8013c2416e21e..e0f659ea31ecf3c5920b5895d122e06bac252538 100644 (file)
@@ -1,7 +1,6 @@
 #version 450 core
 
 in vec2 position;
-in vec2 texcoord;
 out vec2 flow_tc;
 out vec2 patch_bottom_left_texel;  // Center of bottom-left texel of patch.
 
@@ -17,8 +16,8 @@ void main()
        //   0.000  0.000 -2.000 -1.000
        //   0.000  0.000  0.000  1.000
        gl_Position = vec4(2.0 * position.x - 1.0, 2.0 * position.y - 1.0, -1.0, 1.0);
-       flow_tc = texcoord;
+       flow_tc = position;
 
-       vec2 patch_bottom_left = texcoord - vec2(0.5, 0.5) * vec2(inv_flow_width, inv_flow_height);
+       vec2 patch_bottom_left = position - vec2(0.5, 0.5) * vec2(inv_flow_width, inv_flow_height);
        patch_bottom_left_texel = patch_bottom_left + vec2(0.5, 0.5) * vec2(inv_image_width, inv_image_height);
 }
diff --git a/vs.vert b/vs.vert
index a8bf48e4832c5aec737939852b5c77393819e120..b57341b31502a0efdbbc9c40761227ae4f439d31 100644 (file)
--- a/vs.vert
+++ b/vs.vert
@@ -1,7 +1,6 @@
 #version 450 core
 
 in vec2 position;
-in vec2 texcoord;
 out vec2 tc;
 
 void main()
@@ -13,5 +12,5 @@ void main()
        //   0.000  0.000 -2.000 -1.000
        //   0.000  0.000  0.000  1.000
        gl_Position = vec4(2.0 * position.x - 1.0, 2.0 * position.y - 1.0, -1.0, 1.0);
-       tc = texcoord;
+       tc = position;
 }