summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2013-11-30 17:06:19 +0200
committerTopi Pohjolainen <[email protected]>2014-01-23 08:45:25 +0200
commit9e9617f797a59ccfb7e7173d2ec5cb8fec38b859 (patch)
treef037972cd890de30fe8784547684a8aea0f1622d /src/mesa
parent8c42ade7a49d40a44cb7e369cf789db071c3855e (diff)
i965/blorp: wrap emission of conditional assignment
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.cpp19
-rw-r--r--src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h11
2 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index b5f1907169d..356bb9207c6 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1444,21 +1444,10 @@ brw_blorp_blit_program::clamp_tex_coords(struct brw_reg regX,
struct brw_reg clampX1,
struct brw_reg clampY1)
{
- brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_L, regX, clampX0);
- brw_MOV(&func, regX, clampX0);
- brw_set_predicate_control(&func, BRW_PREDICATE_NONE);
-
- brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_G, regX, clampX1);
- brw_MOV(&func, regX, clampX1);
- brw_set_predicate_control(&func, BRW_PREDICATE_NONE);
-
- brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_L, regY, clampY0);
- brw_MOV(&func, regY, clampY0);
- brw_set_predicate_control(&func, BRW_PREDICATE_NONE);
-
- brw_CMP(&func, vec16(brw_null_reg()), BRW_CONDITIONAL_G, regY, clampY1);
- brw_MOV(&func, regY, clampY1);
- brw_set_predicate_control(&func, BRW_PREDICATE_NONE);
+ emit_cond_mov(regX, clampX0, BRW_CONDITIONAL_L, regX, clampX0);
+ emit_cond_mov(regX, clampX1, BRW_CONDITIONAL_G, regX, clampX1);
+ emit_cond_mov(regY, clampY0, BRW_CONDITIONAL_L, regY, clampY0);
+ emit_cond_mov(regY, clampY1, BRW_CONDITIONAL_G, regY, clampY1);
}
/**
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 55e05f7ccdc..555b6d34827 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
@@ -57,6 +57,17 @@ protected:
const struct brw_reg &src_1,
const struct brw_reg &src_2);
+ inline void emit_cond_mov(const struct brw_reg &x,
+ const struct brw_reg &y,
+ int op,
+ const struct brw_reg &dst,
+ const struct brw_reg &src)
+ {
+ brw_CMP(&func, vec16(brw_null_reg()), op, x, y);
+ brw_MOV(&func, dst, src);
+ brw_set_predicate_control(&func, BRW_PREDICATE_NONE);
+ }
+
void *mem_ctx;
struct brw_compile func;
};