Add builtin gl_LightSource[].
authorEric Anholt <eric@anholt.net>
Wed, 19 May 2010 21:09:04 +0000 (14:09 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 1 Jun 2010 22:36:01 +0000 (15:36 -0700)
Fixes gst-gl-bumper.vert parsing.

ir_variable.cpp

index 2c2b57a71146eb741e1b6f338ff693f26192b7af..af8ad2c3182e149e809dfb9bff31e3d0d24b0a15 100644 (file)
@@ -114,7 +114,16 @@ generate_110_uniforms(exec_list *instructions,
     * FINISHME: (glFrontMaterial, glBackMaterial)
     */
 
-   /* FINISHME: Add support for gl_LightSource[] */
+   /* FINISHME: The size of this array is implementation dependent based on the
+    * FINISHME: value of GL_MAX_TEXTURE_LIGHTS.  GL_MAX_TEXTURE_LIGHTS must be
+    * FINISHME: at least 8, so hard-code 8 for now.
+    */
+   const glsl_type *const light_source_array_type =
+      glsl_type::get_array_instance(symtab->get_type("gl_LightSourceParameters"), 8);
+
+   add_variable("gl_LightSource", ir_var_uniform, light_source_array_type,
+               instructions, symtab);
+
    /* FINISHME: Add support for gl_LightModel */
    /* FINISHME: Add support for gl_FrontLightProduct[], gl_BackLightProduct[] */
    /* FINISHME: Add support for gl_TextureEnvColor[] */