diff options
author | Matt Turner <[email protected]> | 2013-08-05 15:15:37 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2013-09-17 16:59:14 -0700 |
commit | 5561251b58c976a70125bb07dc1c6cc2bd2541f4 (patch) | |
tree | 3677012e424204d7f3a8e3fd68d774bea3a6deba /src/glsl/builtin_functions.cpp | |
parent | b2ab840130677bbe7b67de4727fcd91ee6506bb8 (diff) |
glsl: Allow vectors to be created from ir_constant().
Note the parameter name change in the int version of ir_constant, to
avoid the conflict with the loop iterator.
v2: Make analogous change to builtin_builder::imm().
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/builtin_functions.cpp')
-rw-r--r-- | src/glsl/builtin_functions.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp index ffabf8a8710..b5be7043fcf 100644 --- a/src/glsl/builtin_functions.cpp +++ b/src/glsl/builtin_functions.cpp @@ -348,9 +348,9 @@ private: */ ir_variable *in_var(const glsl_type *type, const char *name); ir_variable *out_var(const glsl_type *type, const char *name); - ir_constant *imm(float f); - ir_constant *imm(int i); - ir_constant *imm(unsigned u); + ir_constant *imm(float f, unsigned vector_elements=1); + ir_constant *imm(int i, unsigned vector_elements=1); + ir_constant *imm(unsigned u, unsigned vector_elements=1); ir_constant *imm(const glsl_type *type, const ir_constant_data &); ir_dereference_variable *var_ref(ir_variable *var); ir_dereference_array *array_ref(ir_variable *var, int i); @@ -1878,21 +1878,21 @@ builtin_builder::out_var(const glsl_type *type, const char *name) } ir_constant * -builtin_builder::imm(float f) +builtin_builder::imm(float f, unsigned vector_elements) { - return new(mem_ctx) ir_constant(f); + return new(mem_ctx) ir_constant(f, vector_elements); } ir_constant * -builtin_builder::imm(int i) +builtin_builder::imm(int i, unsigned vector_elements) { - return new(mem_ctx) ir_constant(i); + return new(mem_ctx) ir_constant(i, vector_elements); } ir_constant * -builtin_builder::imm(unsigned u) +builtin_builder::imm(unsigned u, unsigned vector_elements) { - return new(mem_ctx) ir_constant(u); + return new(mem_ctx) ir_constant(u, vector_elements); } ir_constant * |