#define NO_SDL_GLEXT 1
-#include <epoxy/gl.h>
+#include "flow.h"
+#include "gpu_timers.h"
+#include "util.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_error.h>
#include <SDL2/SDL_keyboard.h>
#include <SDL2/SDL_mouse.h>
#include <SDL2/SDL_video.h>
-
-#include <assert.h>
-#include <getopt.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "flow.h"
-#include "gpu_timers.h"
-#include "util.h"
-
#include <algorithm>
+#include <assert.h>
#include <deque>
-#include <memory>
+#include <epoxy/gl.h>
+#include <getopt.h>
#include <map>
+#include <memory>
#include <stack>
+#include <stdio.h>
+#include <unistd.h>
#include <vector>
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
glCreateTextures(GL_TEXTURE_2D_ARRAY, 1, &tex_gray);
glTextureStorage3D(tex_gray, levels, GL_R8, width1, height1, 2);
- GrayscaleConversion gray;
- gray.exec(image_tex, tex_gray, width1, height1, /*num_layers=*/2);
- glGenerateTextureMipmap(tex_gray);
-
OperatingPoint op = operating_point3;
if (!enable_variational_refinement) {
op.variational_refinement = false;
}
- DISComputeFlow compute_flow(width1, height1, op);
+
+ DISComputeFlow compute_flow(width1, height1, op); // Must be initialized before gray.
+ GrayscaleConversion gray;
+ gray.exec(image_tex, tex_gray, width1, height1, /*num_layers=*/2);
+ glGenerateTextureMipmap(tex_gray);
if (enable_warmup) {
in_warmup = true;
int main(int argc, char **argv)
{
- static const option long_options[] = {
+ static const option long_options[] = {
{ "smoothness-relative-weight", required_argument, 0, 's' }, // alpha.
{ "intensity-relative-weight", required_argument, 0, 'i' }, // delta.
{ "gradient-relative-weight", required_argument, 0, 'g' }, // gamma.