Bug 38183

Summary: [glsl] Galactic Vice: fails to compile shader
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://galacticvice.com/
Whiteboard:
i915 platform: i915 features:
Attachments: failing shader
Patch to the mentioned shader

Description Sven Arvidsson 2011-06-11 05:33:54 UTC
Created attachment 47849 [details]
failing shader

The game Galactic Vice fails to run with Mesa, one of the shaders fails to compile with the following errors:

0:10(54): error: Could not implicitly convert operands to arithmetic operator
0:10(55): error: Operands to arithmetic operators must be numeric
0:10(32): error: cannot construct `vec2' from a non-numeric data type
0:0(0): error: no matching function for call to `texture2D(sampler2D, )'
0:0(0): error: candidates are: vec4 texture2D(sampler2D, vec2)
0:0(0): error:                 vec4 texture2D(sampler2D, vec2, float)
0:10(63): error: Operands to arithmetic operators must be numeric
0:10(63): error: type mismatch
0:13(32): error: Could not implicitly convert operands to arithmetic operator
0:13(32): error: type mismatch

The requirements for the game does mention OpenGL 3, so I'm not sure if this is a bug in the shader compiler or not, but filing a bug just to be sure.


System environment:
-- system architecture: 32-bit
-- Linux distribution: Debian unstable
-- GPU: REDWOOD
-- Model: XFX Radeon HD 5670 1GB
-- Display connector: DVI
-- xf86-video-ati: 6.14.2
-- xserver: 1.10.1
-- mesa: git-4176025
-- drm: 2.4.25
-- kernel: 2.6.39
Comment 1 Lauri Kasanen 2011-06-11 23:20:11 UTC
Looks like a shader bug, there's no implicit conversion in GLSL (at least the lower versions). No doubt Nvidia would let this shader through ;)

The attached changes make it build on Mesa.
Comment 2 Lauri Kasanen 2011-06-11 23:20:59 UTC
Created attachment 47858 [details] [review]
Patch to the mentioned shader
Comment 3 Kenneth Graunke 2011-06-12 00:03:54 UTC
Right.  Alternatively, they could just switch to GLSL 1.20 (#version 120), which adds implicit conversions.  It's just 1.10 which is so picky.

At some point, we may need to add some kind of "relaxed" mode to our compiler, but I'd like to avoid it as long as possible.  We're actually compliant here.

Closing as NOTOURBUG.  I've attempted to contact the developers of Galactic Vice---hopefully they'll be willing to fix the shaders for their next alpha release.
Comment 4 Sven Arvidsson 2011-06-12 05:20:27 UTC
Thanks for the help! 

Turns out the game also needs a few other features, at least GL_EXT_gpu_shader4 and GL_EXT_texture_array but it's a step in the right direction!

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.