diff options
author | Matt Turner <[email protected]> | 2014-06-28 23:11:22 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-06-30 22:31:05 -0700 |
commit | e58992aedd9693f0356f3691d510a5e976473a0c (patch) | |
tree | ab9afc4f6d8c9ba6a80f796d491f2fd728713db0 /src/mesa | |
parent | 35b741c8e74cf7c6a99d513c1fd01477545a172d (diff) |
i965/fs: Pass const references to emit functions.
Cuts 10k of .text and saves a bunch of useless struct copies.
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 13 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index db3d35783fb..d1ded33a6b0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -734,32 +734,33 @@ fs_visitor::emit(enum opcode opcode) } fs_inst * -fs_visitor::emit(enum opcode opcode, fs_reg dst) +fs_visitor::emit(enum opcode opcode, const fs_reg &dst) { return emit(new(mem_ctx) fs_inst(opcode, dst)); } fs_inst * -fs_visitor::emit(enum opcode opcode, fs_reg dst, fs_reg src0) +fs_visitor::emit(enum opcode opcode, const fs_reg &dst, const fs_reg &src0) { return emit(new(mem_ctx) fs_inst(opcode, dst, src0)); } fs_inst * -fs_visitor::emit(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1) +fs_visitor::emit(enum opcode opcode, const fs_reg &dst, const fs_reg &src0, + const fs_reg &src1) { return emit(new(mem_ctx) fs_inst(opcode, dst, src0, src1)); } fs_inst * -fs_visitor::emit(enum opcode opcode, fs_reg dst, - fs_reg src0, fs_reg src1, fs_reg src2) +fs_visitor::emit(enum opcode opcode, const fs_reg &dst, const fs_reg &src0, + const fs_reg &src1, const fs_reg &src2) { return emit(new(mem_ctx) fs_inst(opcode, dst, src0, src1, src2)); } fs_inst * -fs_visitor::emit(enum opcode opcode, fs_reg dst, +fs_visitor::emit(enum opcode opcode, const fs_reg &dst, fs_reg src[], int sources) { return emit(new(mem_ctx) fs_inst(opcode, dst, src, sources)); diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 906a1ddc660..3d0da23acf1 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -290,12 +290,13 @@ public: void emit(exec_list list); fs_inst *emit(enum opcode opcode); - fs_inst *emit(enum opcode opcode, fs_reg dst); - fs_inst *emit(enum opcode opcode, fs_reg dst, fs_reg src0); - fs_inst *emit(enum opcode opcode, fs_reg dst, fs_reg src0, fs_reg src1); - fs_inst *emit(enum opcode opcode, fs_reg dst, - fs_reg src0, fs_reg src1, fs_reg src2); - fs_inst *emit(enum opcode opcode, fs_reg dst, + fs_inst *emit(enum opcode opcode, const fs_reg &dst); + fs_inst *emit(enum opcode opcode, const fs_reg &dst, const fs_reg &src0); + fs_inst *emit(enum opcode opcode, const fs_reg &dst, const fs_reg &src0, + const fs_reg &src1); + fs_inst *emit(enum opcode opcode, const fs_reg &dst, + const fs_reg &src0, const fs_reg &src1, const fs_reg &src2); + fs_inst *emit(enum opcode opcode, const fs_reg &dst, fs_reg src[], int sources); fs_inst *MOV(const fs_reg &dst, const fs_reg &src); |