#include <assert.h>
#include <stdio.h>
+#include <unistd.h>
#include "util.h"
constexpr unsigned patch_size_pixels = 12;
// Some global OpenGL objects.
-GLuint nearest_sampler, linear_sampler, mipmap_sampler;
+GLuint nearest_sampler, linear_sampler;
GLuint vertex_vbo;
string read_file(const string &filename)
glSamplerParameteri(linear_sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glSamplerParameteri(linear_sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glCreateSamplers(1, &mipmap_sampler);
- glSamplerParameteri(mipmap_sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
- glSamplerParameteri(mipmap_sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glSamplerParameteri(mipmap_sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glSamplerParameteri(mipmap_sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
float vertices[] = {
0.0f, 1.0f,
0.0f, 0.0f,
// Create an output flow texture.
GLuint flow_out_tex;
glCreateTextures(GL_TEXTURE_2D, 1, &flow_out_tex);
- glTextureStorage2D(flow_out_tex, 1, GL_RG16F, width_patches, height_patches);
+ glTextureStorage2D(flow_out_tex, 1, GL_RGB16F, width_patches, height_patches);
// And draw.
motion_search.exec(tex0_view, tex1_view, grad0_tex, prev_level_flow_tex, flow_out_tex, level_width, level_height, width_patches, height_patches);
GLint available;
do {
glGetQueryObjectiv(query, GL_QUERY_RESULT_AVAILABLE, &available);
+ usleep(1000);
} while (!available);
GLuint64 time_elapsed;
glGetQueryObjectui64v(query, GL_QUERY_RESULT, &time_elapsed);