summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_reg.h
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-02-02 04:59:27 +0100
committerMarek Olšák <maraeo@gmail.com>2013-02-06 14:45:16 +0100
commitae8696c7eeae939428a52c0d5113b5b08b049395 (patch)
tree5b6502bc685284538925751c09c8e8e92ee1ada0 /src/gallium/drivers/r300/r300_reg.h
parent499f7de12e3484f75d30dd314b00c76cb37d8d9f (diff)
downloadexternal_mesa3d-ae8696c7eeae939428a52c0d5113b5b08b049395.zip
external_mesa3d-ae8696c7eeae939428a52c0d5113b5b08b049395.tar.gz
external_mesa3d-ae8696c7eeae939428a52c0d5113b5b08b049395.tar.bz2
r300/compiler: add support for saturate output modifier in r500 vertex shaders
The GLSL compiler can simplify clamp(v,0,1) to saturate. The state tracker doesn't use it yet, but it will. Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Diffstat (limited to 'src/gallium/drivers/r300/r300_reg.h')
-rw-r--r--src/gallium/drivers/r300/r300_reg.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h
index 8342ef5..46aeba0 100644
--- a/src/gallium/drivers/r300/r300_reg.h
+++ b/src/gallium/drivers/r300/r300_reg.h
@@ -2960,13 +2960,15 @@ enum {
/*\}*/
-#define PVS_OP_DST_OPERAND(opcode, math_inst, macro_inst, reg_index, reg_writemask, reg_class) \
+#define PVS_OP_DST_OPERAND(opcode, math_inst, macro_inst, reg_index, reg_writemask, reg_class, saturate) \
(((opcode & PVS_DST_OPCODE_MASK) << PVS_DST_OPCODE_SHIFT) \
| ((math_inst & PVS_DST_MATH_INST_MASK) << PVS_DST_MATH_INST_SHIFT) \
| ((macro_inst & PVS_DST_MACRO_INST_MASK) << PVS_DST_MACRO_INST_SHIFT) \
| ((reg_index & PVS_DST_OFFSET_MASK) << PVS_DST_OFFSET_SHIFT) \
| ((reg_writemask & 0xf) << PVS_DST_WE_X_SHIFT) /* X Y Z W */ \
- | ((reg_class & PVS_DST_REG_TYPE_MASK) << PVS_DST_REG_TYPE_SHIFT))
+ | ((reg_class & PVS_DST_REG_TYPE_MASK) << PVS_DST_REG_TYPE_SHIFT)) \
+ | ((math_inst) ? (((saturate) & PVS_DST_ME_SAT_MASK) << PVS_DST_ME_SAT_SHIFT) : \
+ (((saturate) & PVS_DST_VE_SAT_MASK) << PVS_DST_VE_SAT_SHIFT))
#define PVS_SRC_OPERAND(in_reg_index, comp_x, comp_y, comp_z, comp_w, reg_class, negate) \
(((in_reg_index & PVS_SRC_OFFSET_MASK) << PVS_SRC_OFFSET_SHIFT) \