Exemplo n.º 1
0
static struct ureg register_input( struct tnl_program *p, GLuint input )
{
   assert(input < 32);

   p->program->Base.InputsRead |= (1<<input);
   return make_ureg(PROGRAM_INPUT, input);
}
Exemplo n.º 2
0
/**
 * \param input  one of VERT_ATTRIB_x tokens.
 */
static struct ureg register_input( struct tnl_program *p, GLuint input )
{
   assert(input < 32);

   if (p->state->varying_vp_inputs & (1<<input)) {
      p->program->Base.InputsRead |= (1<<input);
      return make_ureg(PROGRAM_INPUT, input);
   }
   else {
      return register_param3( p, STATE_INTERNAL, STATE_CURRENT_ATTRIB, input );
   }
}
Exemplo n.º 3
0
/**
 * \param input  one of VERT_ATTRIB_x tokens.
 */
static struct ureg register_input( struct tnl_program *p, GLuint input )
{
   assert(input < VERT_ATTRIB_MAX);

   if (p->state->varying_vp_inputs & VERT_BIT(input)) {
      p->program->info.inputs_read |= VERT_BIT(input);
      return make_ureg(PROGRAM_INPUT, input);
   }
   else {
      return register_param3( p, STATE_INTERNAL, STATE_CURRENT_ATTRIB, input );
   }
}
Exemplo n.º 4
0
static struct ureg get_temp( struct tnl_program *p )
{
   int bit = _mesa_ffs( ~p->temp_in_use );
   if (!bit) {
      _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__);
      _mesa_exit(1);
   }

   if ((GLuint) bit > p->program->Base.NumTemporaries)
      p->program->Base.NumTemporaries = bit;

   p->temp_in_use |= 1<<(bit-1);
   return make_ureg(PROGRAM_TEMPORARY, bit-1);
}
Exemplo n.º 5
0
static struct ureg get_temp( struct tnl_program *p )
{
   int bit = ffs( ~p->temp_in_use );
   if (!bit) {
      fprintf(stderr, "%s: out of temporaries\n", __FILE__);
      assert(0);
   }

   if (bit > p->program->Base.NumTemporaries)
      p->program->Base.NumTemporaries = bit;

   p->temp_in_use |= 1<<(bit-1);
   return make_ureg(PROGRAM_TEMPORARY, bit-1);
}
Exemplo n.º 6
0
static struct ureg register_param5(struct tnl_program *p,
				   GLint s0,
				   GLint s1,
				   GLint s2,
				   GLint s3,
                                   GLint s4)
{
   gl_state_index tokens[STATE_LENGTH];
   GLint idx;
   tokens[0] = s0;
   tokens[1] = s1;
   tokens[2] = s2;
   tokens[3] = s3;
   tokens[4] = s4;
   idx = _mesa_add_state_reference( p->program->Base.Parameters, tokens );
   return make_ureg(PROGRAM_STATE_VAR, idx);
}
Exemplo n.º 7
0
static struct ureg register_const4f( struct tnl_program *p,
			      GLfloat s0,
			      GLfloat s1,
			      GLfloat s2,
			      GLfloat s3)
{
   GLfloat values[4];
   GLint idx;
   GLuint swizzle;
   values[0] = s0;
   values[1] = s1;
   values[2] = s2;
   values[3] = s3;
   idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
                                     &swizzle );
   ASSERT(swizzle == SWIZZLE_NOOP);
   return make_ureg(PROGRAM_CONSTANT, idx);
}
Exemplo n.º 8
0
static struct ureg register_const4f( struct tnl_program *p, 
			      GLfloat s0,
			      GLfloat s1,
			      GLfloat s2,
			      GLfloat s3)
{
   GLfloat values[4];
   GLint idx;
   GLuint swizzle;
   values[0] = s0;
   values[1] = s1;
   values[2] = s2;
   values[3] = s3;
   idx = _mesa_add_unnamed_constant( p->program->Base.Parameters, values, 4,
                                     &swizzle);
   /* XXX what about swizzle? */
   return make_ureg(PROGRAM_STATE_VAR, idx);
}
Exemplo n.º 9
0
/**
 * \param input  one of VERT_RESULT_x tokens.
 */
static struct ureg register_output( struct tnl_program *p, GLuint output )
{
   p->program->Base.OutputsWritten |= (1<<output);
   return make_ureg(PROGRAM_OUTPUT, output);
}
Exemplo n.º 10
0
/**
 * \param input  one of VARYING_SLOT_x tokens.
 */
static struct ureg register_output( struct tnl_program *p, GLuint output )
{
   p->program->info.outputs_written |= BITFIELD64_BIT(output);
   return make_ureg(PROGRAM_OUTPUT, output);
}