[Mesa-dev] [PATCH 2/4] i965/vec4: Use const references in emit() functions.
Francisco Jerez
currojerez at riseup.net
Thu Nov 13 05:08:14 PST 2014
Kenneth Graunke <kenneth at whitecape.org> writes:
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>
> ---
> src/mesa/drivers/dri/i965/brw_vec4.h | 18 ++++++++----------
> src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 11 ++++++-----
> 2 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
> index 3301dd8..ebbf882 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4.h
> +++ b/src/mesa/drivers/dri/i965/brw_vec4.h
> @@ -399,16 +399,14 @@ public:
> vec4_instruction *emit(vec4_instruction *inst);
>
> vec4_instruction *emit(enum opcode opcode);
> -
> - vec4_instruction *emit(enum opcode opcode, dst_reg dst);
> -
> - vec4_instruction *emit(enum opcode opcode, dst_reg dst, src_reg src0);
> -
> - vec4_instruction *emit(enum opcode opcode, dst_reg dst,
> - src_reg src0, src_reg src1);
> -
> - vec4_instruction *emit(enum opcode opcode, dst_reg dst,
> - src_reg src0, src_reg src1, src_reg src2);
> + vec4_instruction *emit(enum opcode opcode, const dst_reg &dst);
> + vec4_instruction *emit(enum opcode opcode, const dst_reg &dst,
> + const src_reg &src0);
> + vec4_instruction *emit(enum opcode opcode, const dst_reg &dst,
> + const src_reg &src0, const src_reg &src1);
> + vec4_instruction *emit(enum opcode opcode, const dst_reg &dst,
> + const src_reg &src0, const src_reg &src1,
> + const src_reg &src2);
>
> vec4_instruction *emit_before(bblock_t *block,
> vec4_instruction *inst,
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> index b46879b..a8ce498 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> @@ -79,8 +79,8 @@ vec4_visitor::emit_before(bblock_t *block, vec4_instruction *inst,
> }
>
> vec4_instruction *
> -vec4_visitor::emit(enum opcode opcode, dst_reg dst,
> - src_reg src0, src_reg src1, src_reg src2)
> +vec4_visitor::emit(enum opcode opcode, const dst_reg &dst, const src_reg &src0,
> + const src_reg &src1, const src_reg &src2)
> {
> return emit(new(mem_ctx) vec4_instruction(this, opcode, dst,
> src0, src1, src2));
> @@ -88,19 +88,20 @@ vec4_visitor::emit(enum opcode opcode, dst_reg dst,
>
>
> vec4_instruction *
> -vec4_visitor::emit(enum opcode opcode, dst_reg dst, src_reg src0, src_reg src1)
> +vec4_visitor::emit(enum opcode opcode, const dst_reg &dst, const src_reg &src0,
> + const src_reg &src1)
> {
> return emit(new(mem_ctx) vec4_instruction(this, opcode, dst, src0, src1));
> }
>
> vec4_instruction *
> -vec4_visitor::emit(enum opcode opcode, dst_reg dst, src_reg src0)
> +vec4_visitor::emit(enum opcode opcode, const dst_reg &dst, const src_reg &src0)
> {
> return emit(new(mem_ctx) vec4_instruction(this, opcode, dst, src0));
> }
>
> vec4_instruction *
> -vec4_visitor::emit(enum opcode opcode, dst_reg dst)
> +vec4_visitor::emit(enum opcode opcode, const dst_reg &dst)
> {
> return emit(new(mem_ctx) vec4_instruction(this, opcode, dst));
> }
> --
> 2.1.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141113/f5a052b4/attachment.sig>
More information about the mesa-dev
mailing list