return var;
}
+extern "C" const struct gl_builtin_uniform_desc *
+_mesa_glsl_get_builtin_uniform_desc(const char *name)
+{
+ for (unsigned i = 0; _mesa_builtin_uniform_desc[i].name != NULL; i++) {
+ if (strcmp(_mesa_builtin_uniform_desc[i].name, name) == 0) {
+ return &_mesa_builtin_uniform_desc[i];
+ }
+ }
+ return NULL;
+}
ir_variable *
builtin_variable_generator::add_uniform(const glsl_type *type,
{
ir_variable *const uni = add_variable(name, type, ir_var_uniform, -1);
- unsigned i;
- for (i = 0; _mesa_builtin_uniform_desc[i].name != NULL; i++) {
- if (strcmp(_mesa_builtin_uniform_desc[i].name, name) == 0) {
- break;
- }
- }
-
- assert(_mesa_builtin_uniform_desc[i].name != NULL);
const struct gl_builtin_uniform_desc* const statevar =
- &_mesa_builtin_uniform_desc[i];
+ _mesa_glsl_get_builtin_uniform_desc(name);
+ assert(statevar != NULL);
const unsigned array_count = type->is_array() ? type->length : 1;
extern void
fprint_ir(FILE *f, const void *instruction);
+extern const struct gl_builtin_uniform_desc *
+_mesa_glsl_get_builtin_uniform_desc(const char *name);
+
#ifdef __cplusplus
} /* extern "C" */
#endif