mesa: Don't reference a W component in setting up a vec3 uniform component.
authorEric Anholt <eric@anholt.net>
Thu, 30 Sep 2010 20:40:22 +0000 (13:40 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 30 Sep 2010 20:45:42 +0000 (13:45 -0700)
The 965 driver would try to set up storage for the W component, and
the offsets would get mixed up.

src/mesa/main/uniforms.c

index 29a9be8c9968fcb76ede65ab49955de3c1fceb8f..87ce6e493885a60a899ed9d33af6e6e8f9f05396 100644 (file)
@@ -122,7 +122,11 @@ static struct gl_builtin_uniform_element gl_LightSource_elements[] = {
    {"specular", {STATE_LIGHT, 0, STATE_SPECULAR}, SWIZZLE_XYZW},
    {"position", {STATE_LIGHT, 0, STATE_POSITION}, SWIZZLE_XYZW},
    {"halfVector", {STATE_LIGHT, 0, STATE_HALF_VECTOR}, SWIZZLE_XYZW},
-   {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_XYZW},
+   {"spotDirection", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION},
+    MAKE_SWIZZLE4(SWIZZLE_X,
+                 SWIZZLE_Y,
+                 SWIZZLE_Z,
+                 SWIZZLE_Z)},
    {"spotCosCutoff", {STATE_LIGHT, 0, STATE_SPOT_DIRECTION}, SWIZZLE_WWWW},
    {"spotCutoff", {STATE_LIGHT, 0, STATE_SPOT_CUTOFF}, SWIZZLE_XXXX},
    {"spotExponent", {STATE_LIGHT, 0, STATE_ATTENUATION}, SWIZZLE_WWWW},