Bug 32287

Summary: [bisected GLSL] float-int failure
Product: Mesa Reporter: Gordon Jin <gordon.jin>
Component: glsl-compilerAssignee: Ian Romanick <idr>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: aaalmosss
Version: 7.10   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: new test case for piglit shader_runner

Description Gordon Jin 2010-12-09 23:31:09 UTC
Created attachment 40981 [details]
new test case for piglit shader_runner

This simple code fails on my Calpella today.
	float f = 8;
	gl_FragColor = vec4(0, f/10.0, 0, 0.8);

Running the attached case gets:
Probe at (0,0)
  Expected: 0.000000 0.800000 0.000000 0.800000
  Observed: 0.000000 1.000000 0.000000 0.800000
PIGLIT: {'result': 'fail' }


b0fc5103cbc9116806a9888f747baed4b8166246 is the first bad commit
commit b0fc5103cbc9116806a9888f747baed4b8166246
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Dec 7 16:27:22 2010 -0800

    glsl: Inherrit type of declared variable from initializer
Comment 1 Ian Romanick 2010-12-10 13:49:12 UTC
There is one error in that test.  The requirements section says 'GLSL >= 1.10', but the GLSL code says '#version 120'.  The test clearly requires GLSL >= 1.20.
Comment 2 Ian Romanick 2010-12-10 19:52:28 UTC
commit d7f27e2e76eac9bc2ee0fa36f52542fdcb9563dd
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Fri Dec 10 15:48:15 2010 -0800

    glsl: Inherrit type of declared variable from initializer after processing a
    
    do_assignment may apply implicit conversions to coerce the base type
    of initializer to the base type of the variable being declared.  Fixes
    piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
    probably also fixes bugzilla #32273.
    
    NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
Comment 3 Ian Romanick 2010-12-11 16:37:57 UTC
*** Bug 32273 has been marked as a duplicate of this bug. ***
Comment 4 Gordon Jin 2010-12-12 22:04:22 UTC
Ian, thanks for catching that. 

verified it passes with mesa master.
Comment 5 Kenneth Graunke 2010-12-22 02:39:17 UTC
Marking Resolved/Fixed based on the comments from Ian and Gordon.
Comment 6 Gordon Jin 2010-12-22 17:31:12 UTC
We left it open deliberately, waiting for cherry-picking to 7.10 branch.

Ken, isn't that your proposal?
Comment 7 Ian Romanick 2011-01-03 16:49:31 UTC
commit d3fa3c60f2e12915813eabbbeecc5976d749a9dc
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Fri Dec 10 15:48:15 2010 -0800

    glsl: Inherrit type of declared variable from initializer after processing assignment
    
    do_assignment may apply implicit conversions to coerce the base type
    of initializer to the base type of the variable being declared.  Fixes
    piglit test glsl-implicit-conversion-02 (bugzilla #32287).  This
    probably also fixes bugzilla #32273.
    
    NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
    (cherry picked from commit d7f27e2e76eac9bc2ee0fa36f52542fdcb9563dd)
Comment 8 Gordon Jin 2011-01-04 19:33:06 UTC
verified on 7.10 branch

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.