The dst_reg to src_reg conversion is fairly safe since 430c6bf70e48c08ba4dc9e00f2b88e2230793010. No information is lost and OP(dst, src_reg(dst), src1) does what one would expect -- This seems just annoying now. The implicit conversion allows you to declare temporaries that are both written and read from as dst_reg and have them conveniently converted to src_reg when they are used. They also avoid redundant expressions like 'negate(src_reg(tmp))', 'swizzle(src_reg(tmp), ...)' or 'src_vector(src_reg(tmp), ...)' (the latter function will be defined in a future commit).
The src_reg to dst_reg conversion is kept explicit because it does lose component ordering information. --- src/mesa/drivers/dri/i965/brw_ir_vec4.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_ir_vec4.h b/src/mesa/drivers/dri/i965/brw_ir_vec4.h index c65c148..a5fc26f 100644 --- a/src/mesa/drivers/dri/i965/brw_ir_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_ir_vec4.h @@ -46,6 +46,7 @@ public: src_reg(int32_t i); src_reg(uint8_t vf[4]); src_reg(uint8_t vf0, uint8_t vf1, uint8_t vf2, uint8_t vf3); + src_reg(const dst_reg ®); src_reg(struct brw_reg reg); bool equals(const src_reg &r) const; @@ -53,8 +54,6 @@ public: src_reg(class vec4_visitor *v, const struct glsl_type *type); src_reg(class vec4_visitor *v, const struct glsl_type *type, int size); - explicit src_reg(const dst_reg ®); - unsigned swizzle; /**< BRW_SWIZZLE_XYZW macros from brw_reg.h. */ src_reg *reladdr; -- 2.3.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev