Exemplo n.º 1
0
static void pass0_set_dst_scalar( struct brw_wm_compile *c,
				  struct brw_wm_instruction *out,		     
				  const struct prog_instruction *inst,		     
				  GLuint writemask )
{
   if (writemask) {
      const struct prog_dst_register *dst = &inst->DstReg;
      GLuint i;

      /* Compute only the first (X) value:
       */
      out->writemask = WRITEMASK_X;
      out->dst[0] = get_value(c);

      /* Update our tracking register file for all the components in
       * writemask:
       */
      for (i = 0; i < 4; i++) {
	 if (writemask & (1<<i)) {
	    pass0_set_fpreg_value(c, dst->File, dst->Index, i, out->dst[0]);
	 }
      }
   }
   else
      out->writemask = 0;
}
Exemplo n.º 2
0
/* Initialize payload "registers".
 */
static void pass0_init_payload( struct brw_wm_compile *c )
{
   GLuint i;

   for (i = 0; i < 4; i++) {
      GLuint j = i >= (c->nr_payload_regs + 1) / 2 ? 0 : i;
      pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, i, 
			     &c->payload.depth[j] );
   }

#if 0
   /* This seems to be an alternative to the INTERP_WPOS stuff I do
    * elsewhere:
    */
   if (c->key.source_depth_reg)
      pass0_set_fpreg_value(c, PROGRAM_INPUT, FRAG_ATTRIB_WPOS, 2,
			    &c->payload.depth[c->key.source_depth_reg/2]);
#endif
   
   for (i = 0; i < FRAG_ATTRIB_MAX; i++)
      pass0_set_fpreg_value( c, PROGRAM_PAYLOAD, i, 0, 
			     &c->payload.input_interp[i] );      
}
Exemplo n.º 3
0
static void pass0_set_dst( struct brw_wm_compile *c,
			   struct brw_wm_instruction *out,
			   const struct prog_instruction *inst,
			   GLuint writemask )
{
   const struct prog_dst_register *dst = &inst->DstReg;
   GLuint i;

   for (i = 0; i < 4; i++) {
      if (writemask & (1<<i)) {
	 out->dst[i] = get_value(c);
	 pass0_set_fpreg_value(c, dst->File, dst->Index, i, out->dst[i]);
      }
   }

   out->writemask = writemask;
}