diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2013-09-03 17:07:18 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2013-09-09 11:52:22 -0700 |
commit | 8d90328eb3a934e07a9fa54b829e768750ab6d8b (patch) | |
tree | 45ed854e98c73bf7c82d5ee3f840c595aea66eda /src/glsl/ir_builder.h | |
parent | 666df565519357833aabb265e42d1ed981bf2a4a (diff) | |
download | external_mesa3d-8d90328eb3a934e07a9fa54b829e768750ab6d8b.zip external_mesa3d-8d90328eb3a934e07a9fa54b829e768750ab6d8b.tar.gz external_mesa3d-8d90328eb3a934e07a9fa54b829e768750ab6d8b.tar.bz2 |
glsl: Add optional parameters to the ir_factory constructor.
Each ir_factory needs an instruction list and memory context in order to
be useful. Rather than creating an object and manually assigning these,
we can just use optional parameters in the constructor.
This makes it possible to create a ready-to-use factory in one line:
ir_factory body(&sig->body, mem_ctx);
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/glsl/ir_builder.h')
-rw-r--r-- | src/glsl/ir_builder.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 36ae712..429900b 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -82,9 +82,9 @@ public: class ir_factory { public: - ir_factory() - : instructions(NULL), - mem_ctx(NULL) + ir_factory(exec_list *instructions = NULL, void *mem_ctx = NULL) + : instructions(instructions), + mem_ctx(mem_ctx) { return; } |