const glsl_type *type))
{
ir_function *const f = new ir_function(name);
- const glsl_type *float_type = glsl_type::float_type;
- const glsl_type *vec2_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 2, 1);
- const glsl_type *vec3_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 3, 1);
- const glsl_type *vec4_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
bool added = symtab->add_function(name, f);
assert(added);
instructions->push_tail(f);
generate_function_instance(f, name, instructions, n_args, generate,
- float_type, float_type);
+ glsl_type::float_type, glsl_type::float_type);
generate_function_instance(f, name, instructions, n_args, generate,
- vec2_type, vec2_type);
+ glsl_type::vec2_type, glsl_type::vec2_type);
generate_function_instance(f, name, instructions, n_args, generate,
- vec3_type, vec3_type);
+ glsl_type::vec3_type, glsl_type::vec3_type);
generate_function_instance(f, name, instructions, n_args, generate,
- vec4_type, vec4_type);
+ glsl_type::vec4_type, glsl_type::vec4_type);
}
static void
bool do_bool)
{
ir_function *const f = new ir_function(name);
- const glsl_type *vec2_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 2, 1);
- const glsl_type *vec3_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 3, 1);
- const glsl_type *vec4_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
const glsl_type *ivec2_type = glsl_type::get_instance(GLSL_TYPE_INT, 2, 1);
const glsl_type *ivec3_type = glsl_type::get_instance(GLSL_TYPE_INT, 3, 1);
const glsl_type *ivec4_type = glsl_type::get_instance(GLSL_TYPE_INT, 4, 1);
instructions->push_tail(f);
generate_function_instance(f, name, instructions, 2, generate,
- bvec2_type, vec2_type);
+ bvec2_type, glsl_type::vec2_type);
generate_function_instance(f, name, instructions, 2, generate,
- bvec3_type, vec3_type);
+ bvec3_type, glsl_type::vec3_type);
generate_function_instance(f, name, instructions, 2, generate,
- bvec4_type, vec4_type);
+ bvec4_type, glsl_type::vec4_type);
generate_function_instance(f, name, instructions, 2, generate,
bvec2_type, ivec2_type);
{
const char *name = "length";
ir_function *const f = new ir_function(name);
- const glsl_type *float_type = glsl_type::float_type;
- const glsl_type *vec2_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 2, 1);
- const glsl_type *vec3_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 3, 1);
- const glsl_type *vec4_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
bool added = symtab->add_function(name, f);
assert(added);
instructions->push_tail(f);
generate_function_instance(f, name, instructions, 1, generate_length,
- float_type, float_type);
+ glsl_type::float_type, glsl_type::float_type);
generate_function_instance(f, name, instructions, 1, generate_length,
- float_type, vec2_type);
+ glsl_type::float_type, glsl_type::vec2_type);
generate_function_instance(f, name, instructions, 1, generate_length,
- float_type, vec3_type);
+ glsl_type::float_type, glsl_type::vec3_type);
generate_function_instance(f, name, instructions, 1, generate_length,
- float_type, vec4_type);
+ glsl_type::float_type, glsl_type::vec4_type);
}
static void
{
const char *name = "dot";
ir_function *const f = new ir_function(name);
- const glsl_type *float_type = glsl_type::float_type;
- const glsl_type *vec2_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 2, 1);
- const glsl_type *vec3_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 3, 1);
- const glsl_type *vec4_type = glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
bool added = symtab->add_function(name, f);
assert(added);
instructions->push_tail(f);
generate_function_instance(f, name, instructions, 2, generate_dot,
- float_type, float_type);
+ glsl_type::float_type, glsl_type::float_type);
generate_function_instance(f, name, instructions, 2, generate_dot,
- float_type, vec2_type);
+ glsl_type::float_type, glsl_type::vec2_type);
generate_function_instance(f, name, instructions, 2, generate_dot,
- float_type, vec3_type);
+ glsl_type::float_type, glsl_type::vec3_type);
generate_function_instance(f, name, instructions, 2, generate_dot,
- float_type, vec4_type);
+ glsl_type::float_type, glsl_type::vec4_type);
}
static void
* FINISHME: value of GL_MAX_TEXTURE_COORDS. GL_MAX_TEXTURE_COORDS must be
* FINISHME: at least 2, so hard-code 2 for now.
*/
- const glsl_type *const vec4_type =
- glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
const glsl_type *const vec4_array_type =
- glsl_type::get_array_instance(vec4_type, 2);
+ glsl_type::get_array_instance(glsl_type::vec4_type, 2);
add_variable("gl_TexCoord", ir_var_out, vec4_array_type, instructions,
symtab);
* FINISHME: value of GL_MAX_TEXTURE_COORDS. GL_MAX_TEXTURE_COORDS must be
* FINISHME: at least 2, so hard-code 2 for now.
*/
- const glsl_type *const vec4_type =
- glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
const glsl_type *const vec4_array_type =
- glsl_type::get_array_instance(vec4_type, 2);
+ glsl_type::get_array_instance(glsl_type::vec4_type, 2);
add_variable("gl_TexCoord", ir_var_in, vec4_array_type, instructions,
symtab);
* FINISHME: value of GL_MAX_DRAW_BUFFERS. GL_MAX_DRAW_BUFFERS must be
* FINISHME: at least 1, so hard-code 1 for now.
*/
- const glsl_type *const vec4_type =
- glsl_type::get_instance(GLSL_TYPE_FLOAT, 4, 1);
const glsl_type *const vec4_array_type =
- glsl_type::get_array_instance(vec4_type, 1);
+ glsl_type::get_array_instance(glsl_type::vec4_type, 1);
ir_variable *const fd =
add_variable("gl_FragData", ir_var_out, vec4_array_type, instructions,