Bug 63117 - OSMesa Gallium Empty Output
Summary: OSMesa Gallium Empty Output
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-04 13:07 UTC by Kevin Hobbs
Modified: 2013-04-10 00:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch for osmesa.c (3.27 KB, patch)
2013-04-09 01:20 UTC, Brian Paul
Details | Splinter Review

Description Kevin Hobbs 2013-04-04 13:07:21 UTC

    
Comment 1 Kevin Hobbs 2013-04-04 13:16:25 UTC
Since OSMesa switched to the Gallium driver VTK tests which use OSMesa produce black output images.

Before the change VTK's LoadOpenGLExtension test had : 

GL_VERSION: 2.1 Mesa 9.2-devel (git-6173cc1)
GL_RENDERER: Mesa OffScreen

in the output, and after the change it had :

GL_VERSION: 2.1 Mesa 9.2.0 (git-f7ef83c)
GL_RENDERER: Gallium 0.4 on llvmpipe (LLVM 3.0, 128 bits)

VTK sets up the OSMesa contest like this :

contextId = OSMesaCreateContext(GL_RGBA, NULL);
OSMesaMakeCurrent(contextId, window,  GL_UNSIGNED_BYTE, xsize, ysize);

VTK gets the image data from OSMesa like:

MakeCurrent();
while(glGetError() != GL_NO_ERROR) {};
glReadBuffer(front_or_back);
Comment 2 Brian Paul 2013-04-09 01:20:04 UTC
Created attachment 77643 [details] [review]
patch for osmesa.c

Kevin, can you try this patch?

I think the unique thing that vtk is doing is calling OSMesaMakeCurrent() several times per frame.  Each time OSMesaMakeCurrent() was called we're creating new gallium drawing surfaces so any previous rendering to the frame was getting lost.
The patch tries to re-use gallium surfaces from one MakeCurrent to the next.
Comment 3 Kevin Hobbs 2013-04-09 10:52:21 UTC
The(In reply to comment #2)
> Created attachment 77643 [details] [review] [review]
> patch for osmesa.c


I tried the patched mesa with VTK's LoadOpenGLExtension test and the test passed.

I'm running the rest of VTK's nightly tests now...
Comment 4 Kevin Hobbs 2013-04-09 11:32:46 UTC
The patched OSMesa allows VTK to pass most tests.
Comment 5 Brian Paul 2013-04-09 14:13:43 UTC
OK, great.  If you find any significant differences between the old swrast and llvmpipe results, please file another bug.

I'll push the patch today.
Comment 6 Brian Paul 2013-04-10 00:36:37 UTC
Patch pushed: acd4fb8b5aa68d6545cf3c7f63d9d2fa1cf73e73


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.