extsrc/mesa/src/mesa/drivers/dri/i965/brw_fs.cpp
/* Our support for builtin uniforms is even scarier than non-builtin.
 * It sits on top of the PROG_STATE_VAR parameters that are
 * automatically updated from GL context state.
 */
Our support for builtin uniforms is even scarier than non-builtin.
It sits on top of the PROG_STATE_VAR parameters that are
automatically updated from GL context state.
Our support for builtin uniforms is even scarier than non - builtin . It sits on top of the PROG_STATE_VAR parameters that are automatically updated from GL context state .
void
fs_visitor::setup_builtin_uniform_values(ir_variable *ir)
{
   const ir_state_slot *const slots = ir->state_slots;
   assert(ir->state_slots != NULL);
   for (unsigned int i = 0; i < ir->num_state_slots; i++) {
      int index = _mesa_add_state_reference(this->fp->Base.Parameters,
					    (gl_state_index *)slots[i].tokens);
      int last_swiz = -1;
      for (unsigned int j = 0; j < 4; j++) {
	 int swiz = GET_SWZ(slots[i].swizzle, j);
	 if (swiz == last_swiz)
	    break;
	 last_swiz = swiz;
	 c->prog_data.param_convert[c->prog_data.nr_params] =
	    PARAM_NO_CONVERT;
	 this->param_index[c->prog_data.nr_params] = index;
	 this->param_offset[c->prog_data.nr_params] = swiz;
	 c->prog_data.nr_params++;
      }
   }
}
void fs_visitor :: setup_builtin_uniform_values ( ir_variable * ir ) { const ir_state_slot * const slots = ir -> state_slots ; assert ( ir -> state_slots != NULL ) ; for ( unsigned int i = 0 ; i < ir -> num_state_slots ; i ++ ) { int index = _mesa_add_state_reference ( this -> fp -> Base . Parameters , ( gl_state_index * ) slots [ i ] . tokens ) ; int last_swiz = -1 ; for ( unsigned int j = 0 ; j < 4 ; j ++ ) { int swiz = GET_SWZ ( slots [ i ] . swizzle , j ) ; if ( swiz == last_swiz ) break ; last_swiz = swiz ; c -> prog_data . param_convert [ c -> prog_data . nr_params ] = PARAM_NO_CONVERT ; this -> param_index [ c -> prog_data . nr_params ] = index ; this -> param_offset [ c -> prog_data . nr_params ] = swiz ; c -> prog_data . nr_params ++ ; } } }
Our support for builtin uniforms is even scarier than non-builtin.
Our support for builtin uniforms is even scarier than non - builtin .
/* This state reference has already been setup by ir_to_mesa, but we'll
       * get the same index back here.
       */ /* Add each of the unique swizzles of the element as a parameter.
       * This'll end up matching the expected layout of the
       * array/matrix/structure we're trying to fill in.
       */