Bug 36173

Summary: struct renderbuffer's 'format' field never set when using FBO
Product: Mesa Reporter: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: simple app the exibhits the problem
proposed patch

Description Pierre-Eric Pelloux-Prayer 2011-04-12 09:01:08 UTC
Created attachment 45537 [details]
simple app the exibhits the problem

When using glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buffer) there's a speed difference between reading back from framebuffer or from an FBO.

Using gdb I found that format field of renderbuffer structure is always equal PIPE_FORMAT_NONE for the FBO which prevents using st_fast_readpixels.

I've built a simple patch which init format field in "st_renderbuffer_alloc_storage" and there is an improvement (a.k.a st_fast_readpixels is used everywhere).

What do you think of this (potential) issue ?

(I'm using git version of Mesa, and r600g)
Comment 1 Pierre-Eric Pelloux-Prayer 2011-04-12 09:02:03 UTC
Created attachment 45538 [details] [review]
proposed patch
Comment 2 Pierre-Eric Pelloux-Prayer 2011-05-20 14:36:25 UTC
Has anyone been able to test the above patch ?
Comment 3 Brian Paul 2011-05-21 08:51:57 UTC
Committed.  I didn't see any fbo regressions with piglit.  I'm surprised this wasn't found a long time ago.  Thanks.

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.