diff options
-rw-r--r-- | tests/OffscreenContextGLX.cc | 10 | ||||
-rw-r--r-- | tests/fbo.cc | 18 | ||||
-rwxr-xr-x | tests/test_pretty_print.py | 10 |
3 files changed, 25 insertions, 13 deletions
diff --git a/tests/OffscreenContextGLX.cc b/tests/OffscreenContextGLX.cc index 41f01f7..e607593 100644 --- a/tests/OffscreenContextGLX.cc +++ b/tests/OffscreenContextGLX.cc @@ -135,14 +135,15 @@ bool create_glx_dummy_window(OffscreenContext &ctx) */ int attributes[] = { - GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, + GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT, //support all 3, for OpenCSG GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, - GLX_ALPHA_SIZE, 8, // extra stuff for fbo-disbaled on-screen testing. - GLX_DEPTH_SIZE, 24, + GLX_ALPHA_SIZE, 8, + GLX_DEPTH_SIZE, 24, // depth-stencil for OpenCSG GLX_STENCIL_SIZE, 8, + GLX_DOUBLEBUFFER, True, None }; @@ -169,6 +170,7 @@ bool create_glx_dummy_window(OffscreenContext &ctx) XSetWindowAttributes xwin_attr; int width = ctx.width; int height = ctx.height; + xwin_attr.background_pixmap = None; xwin_attr.background_pixel = 0; xwin_attr.border_pixel = 0; xwin_attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); @@ -270,7 +272,6 @@ OffscreenContext *create_offscreen_context(int w, int h) cerr << "Unable to init GLEW: " << glewGetErrorString(err) << endl; return NULL; } - // cerr << glew_dump(0); ctx->fbo = fbo_new(); if (!fbo_init(ctx->fbo, w, h)) { @@ -299,6 +300,7 @@ bool teardown_offscreen_context(OffscreenContext *ctx) */ bool save_framebuffer(OffscreenContext *ctx, const char *filename) { + glXSwapBuffers(ctx->xdisplay, ctx->xwindow); if (!ctx || !filename) return false; int samplesPerPixel = 4; // R, G, B and A GLubyte pixels[ctx->width * ctx->height * samplesPerPixel]; diff --git a/tests/fbo.cc b/tests/fbo.cc index 2f933d7..a6677c1 100644 --- a/tests/fbo.cc +++ b/tests/fbo.cc @@ -144,7 +144,11 @@ bool fbo_arb_init(fbo_t *fbo, size_t width, size_t height) } //glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + // to prevent Mesa's software renderer from crashing, do this in two stages. + // ie. instead of using GL_DEPTH_STENCIL_ATTACHMENT, do DEPTH then STENCIL. + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_RENDERBUFFER, fbo->depthbuf_id); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fbo->depthbuf_id); if (report_glerror("specifying depth stencil render buffer")) return false; @@ -183,7 +187,7 @@ bool fbo_resize(fbo_t *fbo, size_t width, size_t height) { if (use_ext()) { glBindRenderbufferEXT(GL_RENDERBUFFER, fbo->depthbuf_id); - if (0) { // glewIsSupported("GL_EXT_packed_depth_stencil")) { + if (glewIsSupported("GL_EXT_packed_depth_stencil")) { glRenderbufferStorageEXT(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); if (report_glerror("creating EXT depth stencil render buffer")) return false; } @@ -196,14 +200,14 @@ bool fbo_resize(fbo_t *fbo, size_t width, size_t height) glRenderbufferStorageEXT(GL_RENDERBUFFER, GL_RGBA8, width, height); if (report_glerror("creating EXT color render buffer")) return false; } else { - glBindRenderbuffer(GL_RENDERBUFFER, fbo->depthbuf_id); - //glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT32, width, height); - if (report_glerror("creating depth stencil render buffer")) return false; - glBindRenderbuffer(GL_RENDERBUFFER, fbo->renderbuf_id); glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, width, height); if (report_glerror("creating color render buffer")) return false; + + glBindRenderbuffer(GL_RENDERBUFFER, fbo->depthbuf_id); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); + if (report_glerror("creating depth stencil render buffer")) return false; + } return true; diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py index fce17f5..897f7b8 100755 --- a/tests/test_pretty_print.py +++ b/tests/test_pretty_print.py @@ -14,6 +14,10 @@ # figure out hwo to make the thing run after the test # figure out how CTEST treats the logfiles. # why is hash differing +# instead of having special '-info' prerun, put it as yet-another-test +# and parse the log +# provide option to replace 'expected' images on wiki +# (yes sometimes you do need to change/update them) import string,sys,re,os,hashlib,subprocess @@ -83,7 +87,7 @@ def read_sysinfo(filename): data += read_gitinfo() - data += 'Image comparison: PerceptualDiff' + data += 'Image comparison: PerceptualDiff by H. Yee' return data, sysid class Test: @@ -293,7 +297,8 @@ def upload(wikiurl,api_php_path,wikidata,manifest,wiki_rootpath,sysid,botname,bo skip=True if not skip: print wikifile,'...' - site.upload(localf,wikifile,wiki_rootpath + ' test') + site.upload(localf,wikifile,wiki_rootpath + ' test', ignore=True) + wikisite = 'cakebaby.referata.com' wiki_rootpath = 'OpenSCAD' builddir = os.getcwd() @@ -305,6 +310,7 @@ def main(): startdate, tests, enddate = parselog(testlog) tests = sorted(tests, key = lambda t:t.passed) sysinfo, sysid = read_sysinfo('sysinfo.txt') + if '--hack' in sys.argv: sysid+='_hack' manifest, wikidata = towiki(wiki_rootpath, startdate, tests, enddate, sysinfo, sysid, testlog) trysave(wikidata, os.path.join(logpath,sysid+'.wiki')) htmldata = wikitohtml(wiki_rootpath, sysid, wikidata, manifest) |