@@ -365,10 +365,10 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings, public WithPe
365365 Texture<U16C1> input_data;
366366
367367 Texture<F32C4> stage1_debug;
368- Texture<F32C3 > stage1_data[3 ];
368+ Texture<F32C4 > stage1_data[3 ];
369369 Texture<F32C1> stage1_infrared;
370370
371- Texture<F32C3 > filter1_data[2 ];
371+ Texture<F32C4 > filter1_data[2 ];
372372 Texture<U8C1> filter1_max_edge_test;
373373 Texture<F32C4> filter1_debug;
374374
@@ -455,6 +455,16 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings, public WithPe
455455 debug.gl (b);
456456 }
457457
458+ void checkFBO (GLenum target)
459+ {
460+ GLenum status = gl ()->glCheckFramebufferStatus (target);
461+ if (status != GL_FRAMEBUFFER_COMPLETE)
462+ {
463+ LOG_ERROR << " incomplete FBO " << status;
464+ exit (-1 );
465+ }
466+ }
467+
458468 void initialize ()
459469 {
460470 ChangeCurrentOpenGLContext ctx (opengl_context_ptr);
@@ -539,6 +549,7 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings, public WithPe
539549 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_RECTANGLE, stage1_data[1 ].texture , 0 );
540550 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_RECTANGLE, stage1_data[2 ].texture , 0 );
541551 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT4, GL_TEXTURE_RECTANGLE, stage1_infrared.texture , 0 );
552+ checkFBO (GL_DRAW_FRAMEBUFFER);
542553
543554 gl ()->glGenFramebuffers (1 , &filter1_framebuffer);
544555 gl ()->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, filter1_framebuffer);
@@ -550,6 +561,7 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings, public WithPe
550561 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_RECTANGLE, filter1_data[0 ].texture , 0 );
551562 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_RECTANGLE, filter1_data[1 ].texture , 0 );
552563 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_RECTANGLE, filter1_max_edge_test.texture , 0 );
564+ checkFBO (GL_DRAW_FRAMEBUFFER);
553565
554566 gl ()->glGenFramebuffers (1 , &stage2_framebuffer);
555567 gl ()->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, stage2_framebuffer);
@@ -560,6 +572,7 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings, public WithPe
560572 if (do_debug) gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE, stage2_debug.texture , 0 );
561573 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_RECTANGLE, stage2_depth.texture , 0 );
562574 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_RECTANGLE, stage2_depth_and_ir_sum.texture , 0 );
575+ checkFBO (GL_DRAW_FRAMEBUFFER);
563576
564577 gl ()->glGenFramebuffers (1 , &filter2_framebuffer);
565578 gl ()->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, filter2_framebuffer);
@@ -569,6 +582,7 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings, public WithPe
569582
570583 if (do_debug) gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE, filter2_debug.texture , 0 );
571584 gl ()->glFramebufferTexture2D (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_RECTANGLE, filter2_depth.texture , 0 );
585+ checkFBO (GL_DRAW_FRAMEBUFFER);
572586
573587 Vertex bl = {-1 .0f , -1 .0f , 0 .0f , 0 .0f }, br = { 1 .0f , -1 .0f , 512 .0f , 0 .0f }, tl = {-1 .0f , 1 .0f , 0 .0f , 424 .0f }, tr = { 1 .0f , 1 .0f , 512 .0f , 424 .0f };
574588 Vertex vertices[] = {
0 commit comments