aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2013-11-29 13:20:11 +0200
committerTopi Pohjolainen <[email protected]>2014-01-23 08:45:47 +0200
commitf9d875926e47e30c8c57ee3e0491f5d720789d6c (patch)
tree679ab1b1a334507a20393acebbb132fd6b173302 /src/mesa
parentbbab8068d2adb2dd9c09882cc8a19e62cf0ea8f0 (diff)
i965/blorp: wrap MUL (/brw_MUL(&func, /emit_mul(/)
Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit.cpp18
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h7
2 files changed, 16 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index f9d1079eb5a..2b9224bdb55 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1387,16 +1387,16 @@ brw_blorp_blit_program::translate_dst_to_src()
emit_mov(Xp_f, X);
emit_mov(Yp_f, Y);
/* Scale and offset */
- brw_MUL(&func, X_f, Xp_f, x_transform.multiplier);
- brw_MUL(&func, Y_f, Yp_f, y_transform.multiplier);
+ emit_mul(X_f, Xp_f, x_transform.multiplier);
+ emit_mul(Y_f, Yp_f, y_transform.multiplier);
emit_add(X_f, X_f, x_transform.offset);
emit_add(Y_f, Y_f, y_transform.offset);
if (key->blit_scaled && key->blend) {
/* Translate coordinates to lay out the samples in a rectangular grid
* roughly corresponding to sample locations.
*/
- brw_MUL(&func, X_f, X_f, brw_imm_f(key->x_scale));
- brw_MUL(&func, Y_f, Y_f, brw_imm_f(key->y_scale));
+ emit_mul(X_f, X_f, brw_imm_f(key->x_scale));
+ emit_mul(Y_f, Y_f, brw_imm_f(key->y_scale));
/* Adjust coordinates so that integers represent pixel centers rather
* than pixel edges.
*/
@@ -1419,8 +1419,8 @@ brw_blorp_blit_program::translate_dst_to_src()
/* Round the float coordinates down to nearest integer */
brw_RNDD(&func, Xp_f, X_f);
brw_RNDD(&func, Yp_f, Y_f);
- brw_MUL(&func, X_f, Xp_f, brw_imm_f(1 / key->x_scale));
- brw_MUL(&func, Y_f, Yp_f, brw_imm_f(1 / key->y_scale));
+ emit_mul(X_f, Xp_f, brw_imm_f(1 / key->x_scale));
+ emit_mul(Y_f, Yp_f, brw_imm_f(1 / key->y_scale));
SWAP_XY_AND_XPYP();
} else if (!key->bilinear_filter) {
/* Round the float coordinates down to nearest integer by moving to
@@ -1576,7 +1576,7 @@ brw_blorp_blit_program::manual_blend_average(unsigned num_samples)
/* Scale the result down by a factor of num_samples */
/* TODO: should use a smaller loop bound for non-RGBA formats */
for (int j = 0; j < 4; ++j) {
- brw_MUL(&func, offset(texture_data[0], 2*j),
+ emit_mul(offset(texture_data[0], 2*j),
offset(vec8(texture_data[0]), 2*j),
brw_imm_f(1.0/num_samples));
}
@@ -1666,8 +1666,8 @@ brw_blorp_blit_program::manual_blend_bilinear(unsigned num_samples)
*/
brw_FRC(&func, vec16(t1_f), x_sample_coords);
brw_FRC(&func, vec16(t2_f), y_sample_coords);
- brw_MUL(&func, vec16(t1_f), t1_f, brw_imm_f(key->x_scale));
- brw_MUL(&func, vec16(t2_f), t2_f, brw_imm_f(key->x_scale * key->y_scale));
+ emit_mul(vec16(t1_f), t1_f, brw_imm_f(key->x_scale));
+ emit_mul(vec16(t2_f), t2_f, brw_imm_f(key->x_scale * key->y_scale));
emit_add(vec16(t1_f), t1_f, t2_f);
emit_mov(vec16(S), t1_f);
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
index 11007895920..c083ad8c9ff 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
@@ -109,6 +109,13 @@ protected:
brw_set_compression_control(&func, BRW_COMPRESSION_COMPRESSED);
}
+ inline void emit_mul(const struct brw_reg& dst,
+ const struct brw_reg& src1,
+ const struct brw_reg& src2)
+ {
+ brw_MUL(&func, dst, src1, src2);
+ }
+
inline void emit_shr(const struct brw_reg& dst,
const struct brw_reg& src1,
const struct brw_reg& src2)