From: Steinar H. Gunderson Date: Tue, 23 Oct 2018 20:44:58 +0000 (+0200) Subject: Fix a crash in the sample driver. X-Git-Tag: 1.8.0~76^2~41 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6745f125b516ffca30dc2e7fbc5d396f82149f53;p=nageru Fix a crash in the sample driver. --- diff --git a/flow_main.cpp b/flow_main.cpp index 1ef44ac..dc82d22 100644 --- a/flow_main.cpp +++ b/flow_main.cpp @@ -261,15 +261,15 @@ void compute_flow_only(int argc, char **argv, int optind) 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;