Exemple #1
0
LightSource::LightSource(  const GLfloat* pos,
                const GLfloat* amb,
                const GLfloat* diff,
                const GLfloat* spec,
                const GLfloat* spot,
                GLfloat s_exp, GLfloat s_cut, GLfloat a_con, GLfloat a_lin, GLfloat a_quad )
  {
    createIdPool();
		DUP4( position, 0.0, 0.0, 1.0, 0.0 )
		DUP4( ambient,  0.0, 0.0, 0.0, 1.0 )
		DUP4( diffuse,  0.0, 0.0, 0.0, 1.0 )
		DUP4( specular, 0.0, 0.0, 0.0, 1.0 )
		DUP3( spot_dir, 0.0, 0.0, -1.0 )

    if( pos ) { DUP4( position, pos[0], pos[1], pos[2], pos[3] ) }
    if( amb ) { DUP4( ambient, amb[0], amb[1], amb[2], amb[4] ) }
    if( diff) { DUP4( diffuse,  diff[0], diff[1], diff[2], diff[3] ) }
    if( spec) { DUP4( specular, spec[0], spec[1], spec[2], spec[3] ) }
    if( spot) { DUP3( spot_dir, spot[0], spot[1], spot[2] ) }
		spot_exp = s_exp;
		spot_cut = s_cut;
		att_constant = a_con;
		att_linear = a_lin;
		att_quadratic = a_quad;
    _enabled = true;
    _id = nextId();
}
Exemple #2
0
void HELPER(gvec_muls32)(void *d, void *a, uint64_t b, uint32_t desc)
{
    intptr_t oprsz = simd_oprsz(desc);
    vec32 vecb = (vec32)DUP4(b);
    intptr_t i;

    for (i = 0; i < oprsz; i += sizeof(vec32)) {
        *(vec32 *)(d + i) = *(vec32 *)(a + i) * vecb;
    }
    clear_high(d, oprsz, desc);
}