Bug 27887 - r300g: depth textures + fbo = broken glClear()
Summary: r300g: depth textures + fbo = broken glClear()
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-29 05:35 UTC by Wiktor Janas
Modified: 2010-05-04 11:01 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
test case (1.30 KB, text/x-csrc)
2010-04-29 05:35 UTC, Wiktor Janas
Details
proposed patch (1.57 KB, patch)
2010-05-04 08:22 UTC, Wiktor Janas
Details | Splinter Review

Description Wiktor Janas 2010-04-29 05:35:13 UTC
Created attachment 35333 [details]
test case

Attached code does not clear the screen as expected. The classic r300 driver fails too. Sometimes geometry rendering gets messed up (however it is not as easily reproducible).

Hardware: Radeon X1300 (RV515), kernel 2.6.33, xorg 1.7.7 rc1, driver from git (up to commit 7327a84b...).
Comment 1 Wiktor Janas 2010-05-04 08:22:25 UTC
Created attachment 35412 [details] [review]
proposed patch

Looks to me like bug in u_blitter.c

The fragment shaders used by clear are generated on demand and cached. However, shader that would pass the input color to the output buffer 0 is stored at the same location as shader that would write to no output buffers (see logic at blitter_get_fs_col). Therefore, if depth-buffer-only clear is done first, subsequent color-buffer clear uses shader that generates no output.

The attached patch attempts to fix this (warning: I don't know mesa/gallium well, just trying to get my app working). The test case still has issues (sometimes fails to redraw the window when resized), but at least something shows up. Also, the same test case renders garbage on llvmpipe (patched or not).
Comment 2 Marek Olšák 2010-05-04 11:01:19 UTC
Committed with a little modification. Thank you very much!

The resizing bug is a separate issue, probably more related to st/dri than r300g.


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.