Summary: | GLSL: gl_FogParamaters gl_Fog built-in uniform not functioning | ||
---|---|---|---|
Product: | Mesa | Reporter: | James Burns <James.Burns> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | minor | ||
Priority: | medium | ||
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 29044 | ||
Attachments: | Test program desmontrating issue |
Description
James Burns
2007-05-10 13:27:07 UTC
Hmmm, I don't see anything obviously broken and my glean test for the gl_Fog uniforms passes. Can you be more specific, or provide a test shader? Created attachment 9930 [details]
Test program desmontrating issue
This source is not exactly representative of my application where the problem is taking place. (I'm a developer of a multispectral scene generator, layered on top of OpenSceneGraph and OSMesa.) I have attempted to take some other sample application and replicate what I am seeing in my application. It is possible that I have made an OpenGL faux pax here in the process of tossing this together.... The main issue is whether the gl_Fog structure is getting filled out by Mesa. I've got a couple of cases where I try to set frag color (gl_FragColor) to be either fog density or fog color. Neither seems to work.
(In reply to comment #1) > Hmmm, I don't see anything obviously broken and my glean test for the gl_Fog > uniforms passes. Can you be more specific, or provide a test shader? > Whatever is wrong (Mesa or my application...) - The symptom I see is that the gl_Fog structure is filled with zeros instead of the fog description passed down with glFogXXX calls. You can omit this line from your fragment shader: uniform gl_FogParameters gl_Fog; The built-in uniforms are pre-declared; you don't have to declare them. Anyway, when that line is included we're hitting a bug in Mesa. I'll see about fixing that. (In reply to comment #4) > You can omit this line from your fragment shader: > > uniform gl_FogParameters gl_Fog; > > The built-in uniforms are pre-declared; you don't have to declare them. > > Anyway, when that line is included we're hitting a bug in Mesa. I'll see about > fixing that. > Thanks for pointing out that I could press forward by removing the declaration. I have verified that this bug still exists with Mesa GIT as of today. On Nvidia closed-source drivers the object is blue, but on Mesa (both swrast and i965) the object is black. > uniform gl_FogParameters gl_Fog;
The Apple GLSL compiler will not compile the fragment shader if the above line is included. The error message "'gl_' : reserved built-in name" is given.
(In reply to comment #7) > > uniform gl_FogParameters gl_Fog; > > The Apple GLSL compiler will not compile the fragment shader if the above line > is included. The error message "'gl_' : reserved built-in name" is given. Interesting. I've submitted a bug against the GLSL spec for this. While Mesa's current behavior is clearly wrong, one of the other (mutually exclusive) behaviors must also be wrong. The GLSL 1.30, 1.40, and 1.50 specs were clarified that, with a couple exceptions, it is illegal to redeclare a variable. The glsl2 compiler in Mesa rejects the declaration with the following error: 0:3(32): error: `gl_Fog' redeclared Closing this bug as fixed. |
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.