Bug 21707 - [GLSL bug] Savage2 GLSL syntax error
Summary: [GLSL bug] Savage2 GLSL syntax error
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
: 22894 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-12 13:56 UTC by Mateusz Kaduk
Modified: 2010-03-17 14:58 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Game log with GLSL errors. (150.19 KB, text/plain)
2009-05-12 13:56 UTC, Mateusz Kaduk
Details
mesh2_shadowed.vsh (5.15 KB, text/plain)
2009-09-24 08:34 UTC, Sven Arvidsson
Details
savage shader with comments in preprocessor lines (3.96 KB, text/plain)
2009-09-27 15:59 UTC, Sven Arvidsson
Details

Description Mateusz Kaduk 2009-05-12 13:56:58 UTC
Created attachment 25803 [details]
Game log with GLSL errors.

With pretty old game Savage2: Tortured Soul textures are white.

Moreover game shows in logs (entire log attached)

Note: 'for (i ... )' body is too large/complex to unroll
Error: syntax error in preprocessor expression.
Error: failed to preprocess the source.

I was trying with glslcompiler (standalone version) but no luck.
$ glslcompiler --debug --vs /home/mateusz/Savage2/game/core/shaders/ps_glsl/mesh2_shadowed_occlusion.psh 
glslcompiler: problem compiling shader: Error: syntax error in preprocessor expression.
Error: failed to preprocess the source.
Comment 1 Mateusz Kaduk 2009-05-12 20:20:11 UTC
Additional info, running the same game from console shows on it repeated over and over many times.

Mesa 7.6-devel implementation error: Unsupported opcode 8 (BGNLOOP) in vertex shader
Please report at bugzilla.freedesktop.org
Mesa 7.6-devel implementation error: Unsupported opcode 11 (BRK) in vertex shader
Please report at bugzilla.freedesktop.org
Mesa 7.6-devel implementation error: Unsupported opcode 27 (ENDLOOP) in vertex shader
Please report at bugzilla.freedesktop.org
Comment 2 Adam Jackson 2009-08-24 12:32:12 UTC
Mass version move, cvs -> git
Comment 3 Ian Romanick 2009-09-02 23:18:07 UTC
Does the preprocessor error still occur?  If not, I'm going to close this bug.  The other error is already covered by bug #20171.
Comment 4 Mateusz Kaduk 2009-09-03 01:22:13 UTC
(In reply to comment #3)
> Does the preprocessor error still occur?  If not, I'm going to close this bug. 
> The other error is already covered by bug #20171.
> 

I will provide more info about this #21707 and #22848 bugs later(when more critical bug will be fixed), since running RegnumOnline game in normal mode with master mesa crash game with error in log

[03/09/2009 10:15:07] [RenderizerGL][gl_ext_loader_arb.cpp(1631)] glBindVertexArrayARB function not found
[03/09/2009 10:15:07] [RenderizerGL][gl_ext_loader_arb.cpp(1632)] Error loading ARB_vertex_array_object

While running it in safe mode cause OS freez and reboot is needed.

mesa master (c19b52f10fe11282f0a3466eda2eeb1d422b7aa3) ---> 7.6-devel
drm master (73b59c894380995a2889b98e79acadd2da0bb237)  ---> libdrm 2.4.13
xserver-xorg-core 2:1.6.3-1
linux 2.6.30.5

glxinfo shows
OpenGL renderer string: Mesa DRI Intel(R) 965GM GEM 20090712 2009Q2 RC3 
OpenGL version string: 2.1 Mesa 7.6-devel

I repeated this behaviour one more time after reboot.
Comment 5 Sven Arvidsson 2009-09-11 13:08:36 UTC
I wouldn't be surprised if this were the same problem as in bug 22894, as both games are developed by S2.
Comment 6 Sven Arvidsson 2009-09-24 07:11:03 UTC
 Compiling pixel shader: simple_unshadowed_flat.psh (ps_glsl)
 Error: syntax error in preprocessor expression.
 Error: failed to preprocess the source.

I skimmed through the shader in question and it has the same kind of comments in the preprocessor lines as bug 22894 so it's most likely the same problem.



Another question though, is this something which should be filed as a separate bug?
Note: 'for (i ... )' body is too large/complex to unroll 
Comment 7 Brian Paul 2009-09-24 08:25:03 UTC
(In reply to comment #6)
>  Compiling pixel shader: simple_unshadowed_flat.psh (ps_glsl)
>  Error: syntax error in preprocessor expression.
>  Error: failed to preprocess the source.
> 
> I skimmed through the shader in question and it has the same kind of comments
> in the preprocessor lines as bug 22894 so it's most likely the same problem.

Can you post the shader (mesh2_shadowed.vsh)?  I don't have time to get/install Savage2.


> Another question though, is this something which should be filed as a separate
> bug?
> Note: 'for (i ... )' body is too large/complex to unroll 

That's not a bug.  The compiler's just telling you that it can't optimize/unroll a loop.
Comment 8 Sven Arvidsson 2009-09-24 08:34:32 UTC
Created attachment 29829 [details]
mesh2_shadowed.vsh

(In reply to comment #7)
> Can you post the shader (mesh2_shadowed.vsh)?  I don't have time to get/install
> Savage2.

File is attached.
Comment 9 Sven Arvidsson 2009-09-27 15:59:03 UTC
Created attachment 29912 [details]
savage shader with comments in preprocessor lines

(In reply to comment #8)
> File is attached.
> 

Ehm, my mistake, the previously added shader didn't have any of those comments. This new one does.
Comment 10 Eric Anholt 2009-10-09 14:49:31 UTC
*** Bug 22894 has been marked as a duplicate of this bug. ***
Comment 11 Eric Anholt 2009-10-09 15:04:58 UTC
glsl-preprocessor-comments testcase added to piglit for this bug.
Comment 12 Sven Arvidsson 2010-01-29 15:45:39 UTC
Is cb5447f79ca03d29407e8db84166f5bddd8d4c59 supposed to fix this? As far as I can tell, it's still not preprocessing the shaders for the game, and the piglit test is also failing.
Comment 13 Sven Arvidsson 2010-03-05 14:36:45 UTC
This bug can probably be marked as FIXED for 7.8, the shaders are compiled and the menu is rendered. 

(It still isn't playable on i965 due to a GPU hang, but I guess that's a separate problem).


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.