[Mesa-dev] [PATCH 25/42] i965/blorp: wrap emission of conditional assignment
Topi Pohjolainen
topi.pohjolainen at intel.com
Fri Dec 20 06:38:54 PST 2013
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 19 ++++---------------
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h | 11 +++++++++++
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 f651846..261ef53 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1439,21 +1439,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 00624c9..259d8db 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;
};
--
1.8.3.1
More information about the mesa-dev
mailing list