Bug 37205

Summary: [GLSL] Norsetto shadow mapping: error: type mismatch
Product: Mesa Reporter: Sven Arvidsson <sa>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED NOTOURBUG QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
URL: http://norsetto.site11.com/?db_select=shadow&page_id=97
Whiteboard:
i915 platform: i915 features:
Attachments: failing shader

Description Sven Arvidsson 2011-05-14 08:38:33 UTC
Created attachment 46715 [details]
failing shader

The Norsetto shadow mapping demo fails to compile one of the shaders with a "type mismatch" error. This was working back in 2009, so I guess it's a problem with the rewritten GLSL compiler.

http://norsetto.site11.com/?db_select=shadow&page_id=97

The failing shader is attached.
Comment 1 Marek Olšák 2011-05-14 08:50:04 UTC
I guess the problem is:

offset.y = 0;

But it should be:

offset.y = 0.0;

It looks like a bug in the demo.
Comment 2 Sven Arvidsson 2011-05-14 09:10:49 UTC
True, it does run with this small change. I don't have any other GL implementations to compare with, but I guess they are more forgiving with these errors.
Comment 3 Kenneth Graunke 2011-05-14 10:14:19 UTC
Yep, that's the issue.  The GLSL 1.10 specification, Chapter 4, explicitly states "There are no implicit conversions between types."

Another alternative is to use #version 120.  GLSL >= 1.20 supports implicit conversions and would be perfectly okay with that line.  There's really no reason not to use 1.20 at this point.

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.