Bug 43418 - Resolving the HiZ buffer fails when using a GLES API
Summary: Resolving the HiZ buffer fails when using a GLES API
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Chad Versace
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-01 05:47 UTC by Neil Roberts
Modified: 2012-01-13 10:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test case (5.02 KB, text/x-csrc)
2011-12-01 05:50 UTC, Neil Roberts
Details
gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES (4.22 KB, patch)
2011-12-01 05:53 UTC, Neil Roberts
Details | Splinter Review

Description Neil Roberts 2011-12-01 05:47:12 UTC
When resolving the HiZ buffer Mesa uses the meta API with some internal GL calls. However when using GLES this fails because it tries to bind a renderbuffer to GL_DRAW_FRAMEBUFFER but Mesa asserts that this binding point is only used when the API is GL.

I'm attaching a patch but I'm not sure if it's the best solution because I've copied the condition for whether GL_DRAW_FRAMEBUFFER is allowed into gen6_hiz.c. This could be quite awkward to maintain. For example if Mesa ever gets support for the GL_ANGLE_framebuffer_blit extension then we'd have to remember to change this check in two places.

I wonder if the check should just be removed instead? Mesa already lets you bind to GL_DRAW_FRAMEBUFFER, just not add a renderbuffer so it's already not completely validated.
Comment 1 Neil Roberts 2011-12-01 05:50:09 UTC
Created attachment 54010 [details]
Test case
Comment 2 Neil Roberts 2011-12-01 05:53:01 UTC
Created attachment 54011 [details] [review]
gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES

When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer
with GL_DRAW_FRAMEBUFFER will report a 'user error' because
get_framebuffer_target validates that this enum from the framebuffer
blit extension is only used on GL. To work around it this patch makes
it use the GL_FRAMEBUFFER enum instead in that case.
Comment 3 Chad Versace 2012-01-11 14:39:51 UTC
I made a modification to the patch, and posted it to mesa-dev for review.

http://article.gmane.org/gmane.comp.video.mesa3d.devel/35980
Comment 4 Chad Versace 2012-01-13 10:17:22 UTC
Mark RESOLVED/FIXED.

My change to the patch broke it because I wrongly assumed that the extension bit for EXT_framebuffer_blit was
off in an ES context, since the extension doesn't exist there. But that's not how Mesa's
extension works, which I should have known; I plumbed it before.

Neil, your original patch has been pushed to the master and 8.0 branches.
master: 9462b8447864c754252cd2580c9e1e4d36d5cc63
8.0:    399b9799de9980b8ebc0ba46304be207b28b7825


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.