Bug 16194

Summary: [mesa_7_0_branch i915] Fog not applied to bitmap
Product: Mesa Reporter: WuNian <nian.wu>
Component: Drivers/DRI/i915Assignee: haihao <haihao.xiang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: brian.paul, dri-devel, sroland
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 16029    
Attachments: test case
patch to set fragment fogc attribute for the span
patch to set fragment fogc attribute for the span

Description WuNian 2008-06-02 01:46:36 UTC
Created attachment 16865 [details]
test case

The bug only exists with mesa_7_0 branch.
When draw bitmap, fog is not applied.

With master branch, attached test case output:
pixel: 0.713726 0.450980 0.274510
pixel: 0.188235 0.149020 0.725490
Comment 1 WuNian 2008-06-02 02:24:24 UTC
After remove i915 driver, the bug does not exist. So it is i915 bug. 
Also exists with i965.
Comment 2 WuNian 2008-06-04 22:01:23 UTC
The bug only exists with i915 driver. i965 driver has no this bug.
Comment 3 haihao 2008-06-09 18:54:15 UTC
Created attachment 17021 [details] [review]
patch to set fragment fogc attribute for the span

Hi, Brian
    I915 adds some extra instructions to do fog, then turn off FogOption, which causes the FOGC attribute of the span isn't set on mesa_7_0_branch.  This patch fixes this issue, but I am not sure whether it breaks other driver. Could you take a look?

Thanks
Haihao
Comment 4 haihao 2008-06-09 19:33:07 UTC
Created attachment 17024 [details] [review]
patch to set fragment fogc attribute for the span
Comment 5 Roland Scheidegger 2008-06-10 04:55:26 UTC
(In reply to comment #3)
> Created an attachment (id=17021) [details]
> patch to set fragment fogc attribute for the span

>     I915 adds some extra instructions to do fog, then turn off FogOption, which
> causes the FOGC attribute of the span isn't set on mesa_7_0_branch.  This patch
> fixes this issue, but I am not sure whether it breaks other driver. Could you
> take a look?

I don't think this is entirely correct. A (user supplied) fragment program could use FOGC for something else than fog.
Comment 6 haihao 2008-07-01 18:18:34 UTC
(In reply to comment #5)
> >     I915 adds some extra instructions to do fog, then turn off FogOption, which
> > causes the FOGC attribute of the span isn't set on mesa_7_0_branch.  This patch
> > fixes this issue, but I am not sure whether it breaks other driver. Could you
> > take a look?
> 
> I don't think this is entirely correct. A (user supplied) fragment program
> could use FOGC for something else than fog.
> 
This patch just initializes the FOGC attribute of the span if FOGC is used as an input.  If a fragment used FOGC for something, it still need to initialize this attribute, right?
Comment 7 Roland Scheidegger 2008-07-02 05:42:42 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > >     I915 adds some extra instructions to do fog, then turn off FogOption, which
> > > causes the FOGC attribute of the span isn't set on mesa_7_0_branch.  This patch
> > > fixes this issue, but I am not sure whether it breaks other driver. Could you
> > > take a look?
> > 
> > I don't think this is entirely correct. A (user supplied) fragment program
> > could use FOGC for something else than fog.
> > 
> This patch just initializes the FOGC attribute of the span if FOGC is used as
> an input.  If a fragment used FOGC for something, it still need to initialize
> this attribute, right?

You're right I didn't look closely enough. May cause (little) unnecessary work to be done but if fog is applied or not is not determined by this, so should probably be ok.
Comment 8 Brian Paul 2008-07-02 08:10:28 UTC
OK, I've commited a cleaned-up version of the patch.  Though, it doesn't make any difference in the above-attached test program, and I don't see how it would effect the i915 driver.
Comment 9 haihao 2008-07-03 18:37:18 UTC
(In reply to comment #8)
> OK, I've commited a cleaned-up version of the patch.  Though, it doesn't make
> any difference in the above-attached test program, 

Need to define GL_GLEXT_PROTOTYPES when compiling this test case.

> and I don't see how it would
> effect the i915 driver.
Comment 10 haihao 2008-07-03 18:39:55 UTC
fixed in mesa_7_0_branch (8261c40bb9b689d05e80e1423eb8d9f13b49b2b8)
Comment 11 Adam Jackson 2009-08-24 12:30:16 UTC
Mass version move, cvs -> git

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.