summaryrefslogtreecommitdiffstats
path: root/ir_to_mesa.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-05-05 17:21:18 -0700
committerEric Anholt <[email protected]>2010-06-24 15:05:19 -0700
commit12f654c63bc42d353e258cde989d9114cdde26c6 (patch)
treeda31dee2fa16ecc8a579e977cb105d7dc2fd4ed3 /ir_to_mesa.h
parentb2ed4dd7b0270e469302965269007292117d02e2 (diff)
ir_to_mesa: Produce multiple scalar ops when required to produce vec4s.
Fixes the code emitted in a test shader for vec2 texcoord / vec2 tex_size.
Diffstat (limited to 'ir_to_mesa.h')
-rw-r--r--ir_to_mesa.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ir_to_mesa.h b/ir_to_mesa.h
index cef27f8b79c..c8ceb4c1715 100644
--- a/ir_to_mesa.h
+++ b/ir_to_mesa.h
@@ -45,6 +45,7 @@ typedef struct ir_to_mesa_src_reg {
typedef struct ir_to_mesa_dst_reg {
int file; /**< PROGRAM_* from Mesa */
int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */
+ int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
} ir_to_mesa_dst_reg;
extern ir_to_mesa_src_reg ir_to_mesa_undef;
@@ -159,6 +160,11 @@ ir_to_mesa_emit_op3(struct mbtree *tree, enum prog_opcode op,
ir_to_mesa_src_reg src1,
ir_to_mesa_src_reg src2);
+void
+ir_to_mesa_emit_scalar_op1(struct mbtree *tree, enum prog_opcode op,
+ ir_to_mesa_dst_reg dst,
+ ir_to_mesa_src_reg src0);
+
inline ir_to_mesa_dst_reg
ir_to_mesa_dst_reg_from_src(ir_to_mesa_src_reg reg)
{
@@ -166,6 +172,7 @@ ir_to_mesa_dst_reg_from_src(ir_to_mesa_src_reg reg)
dst_reg.file = reg.file;
dst_reg.index = reg.index;
+ dst_reg.writemask = WRITEMASK_XYZW;
return dst_reg;
}