Bug 57984 - r300g: blend sfactor=GL_DST_COLOR fails with FBOs
Summary: r300g: blend sfactor=GL_DST_COLOR fails with FBOs
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r300 (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-07 15:41 UTC by Stefan Dösinger
Modified: 2012-12-07 17:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Screenshot showing the problem. (764.61 KB, image/png)
2012-12-07 15:41 UTC, Stefan Dösinger
Details

Description Stefan Dösinger 2012-12-07 15:41:12 UTC
Created attachment 71134 [details]
Screenshot showing the problem.

When running 3DMark2001 on Wine with r300g rendering corruptions are visible in the load screen and the high quality version of the "lobby" test. Closer investigation showed that the problem occurs when the game sets the source blend factor to GL_DST_COLOR and the dest blend factor to GL_ZERO. The blend function is ADD, separate alpha blending is not used.

If I manually change these parameters to srcfactor=ZERO and dstfactor=GL_SRC_COLOR, rendering works correctly.

Rendering also works fine when I configure wine not to use FBOs.

I have tried to reproduce this problem with a stand-alone GL application but have not succeeded in that yet.

I have attached a screenshot. The corruption are the random pixels at the bottom and right. The horizontal lines are artifacts caused by the gnome-screenshot tool.

3DMark2001 can be downloaded from http://download.freenet.de/3DMark-2001-SE-Windows--4183.xhtml and many other places.
Comment 1 Stefan Dösinger 2012-12-07 15:57:55 UTC
I dug through the optimizations in r300_create_blend_state, and the problem is the "Disable reading if SRC_ALPHA == 0" optimization. It is not correct if the source factor is DEST_COLOR. I'm checking if any other source factors have to be excluded.
Comment 2 Marek Olšák 2012-12-07 16:41:45 UTC
(In reply to comment #1)
> I dug through the optimizations in r300_create_blend_state, and the problem
> is the "Disable reading if SRC_ALPHA == 0" optimization. It is not correct
> if the source factor is DEST_COLOR. I'm checking if any other source factors
> have to be excluded.

Yes, you're right. The optimization should check the source RGB and A factors too.


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.