unsigned count;
struct quad_interp_coef coef;
- struct tgsi_interp_coef posCoef; /* For Z, W */
struct {
int left[2]; /**< [0] = row0, [1] = row1 */
assert(i <= 3);
- setup->posCoef.dadx[i] = dadx;
- setup->posCoef.dady[i] = dady;
+ setup->coef.dadx[0][i] = dadx;
+ setup->coef.dady[0][i] = dady;
/* calculate a0 as the value which would be sampled for the
* fragment at (0,0), taking into account that we want to sample at
* to define a0 as the sample at a pixel center somewhere near vmin
* instead - i'll switch to this later.
*/
- setup->posCoef.a0[i] = (setup->vmin[vertSlot][i] -
+ setup->coef.a0[0][i] = (setup->vmin[vertSlot][i] -
(dadx * (setup->vmin[0][0] - 0.5f) +
dady * (setup->vmin[0][1] - 0.5f)));
static void const_pos_coeff( struct setup_context *setup,
uint vertSlot, unsigned i)
{
- setup->posCoef.dadx[i] = 0;
- setup->posCoef.dady[i] = 0;
+ setup->coef.dadx[0][i] = 0;
+ setup->coef.dady[0][i] = 0;
/* need provoking vertex info!
*/
- setup->posCoef.a0[i] = setup->vprovoke[vertSlot][i];
+ setup->coef.a0[0][i] = setup->vprovoke[vertSlot][i];
}
{
unsigned i;
for (i = 0; i < NUM_CHANNELS; ++i) {
- setup->coef.dadx[attrib][i] = 0;
- setup->coef.dady[attrib][i] = 0;
+ setup->coef.dadx[1 + attrib][i] = 0;
+ setup->coef.dady[1 + attrib][i] = 0;
/* need provoking vertex info!
*/
- setup->coef.a0[attrib][i] = setup->vprovoke[vertSlot][i];
+ setup->coef.a0[1 + attrib][i] = setup->vprovoke[vertSlot][i];
}
}
assert(i <= 3);
- setup->coef.dadx[attrib][i] = dadx;
- setup->coef.dady[attrib][i] = dady;
+ setup->coef.dadx[1 + attrib][i] = dadx;
+ setup->coef.dady[1 + attrib][i] = dady;
/* calculate a0 as the value which would be sampled for the
* fragment at (0,0), taking into account that we want to sample at
* to define a0 as the sample at a pixel center somewhere near vmin
* instead - i'll switch to this later.
*/
- setup->coef.a0[attrib][i] = (setup->vmin[vertSlot][i] -
+ setup->coef.a0[1 + attrib][i] = (setup->vmin[vertSlot][i] -
(dadx * (setup->vmin[0][0] - 0.5f) +
dady * (setup->vmin[0][1] - 0.5f)));
*/
assert(i <= 3);
- setup->coef.dadx[attrib][i] = dadx;
- setup->coef.dady[attrib][i] = dady;
- setup->coef.a0[attrib][i] = (mina -
+ setup->coef.dadx[1 + attrib][i] = dadx;
+ setup->coef.dady[1 + attrib][i] = dady;
+ setup->coef.a0[1 + attrib][i] = (mina -
(dadx * (setup->vmin[0][0] - 0.5f) +
dady * (setup->vmin[0][1] - 0.5f)));
}
setup_fragcoord_coeff(struct setup_context *setup, uint slot)
{
/*X*/
- setup->coef.a0[slot][0] = 0;
- setup->coef.dadx[slot][0] = 1.0;
- setup->coef.dady[slot][0] = 0.0;
+ setup->coef.a0[1 + slot][0] = 0;
+ setup->coef.dadx[1 + slot][0] = 1.0;
+ setup->coef.dady[1 + slot][0] = 0.0;
/*Y*/
- setup->coef.a0[slot][1] = 0.0;
- setup->coef.dadx[slot][1] = 0.0;
- setup->coef.dady[slot][1] = 1.0;
+ setup->coef.a0[1 + slot][1] = 0.0;
+ setup->coef.dadx[1 + slot][1] = 0.0;
+ setup->coef.dady[1 + slot][1] = 1.0;
/*Z*/
- setup->coef.a0[slot][2] = setup->posCoef.a0[2];
- setup->coef.dadx[slot][2] = setup->posCoef.dadx[2];
- setup->coef.dady[slot][2] = setup->posCoef.dady[2];
+ setup->coef.a0[1 + slot][2] = setup->coef.a0[0][2];
+ setup->coef.dadx[1 + slot][2] = setup->coef.dadx[0][2];
+ setup->coef.dady[1 + slot][2] = setup->coef.dady[0][2];
/*W*/
- setup->coef.a0[slot][3] = setup->posCoef.a0[3];
- setup->coef.dadx[slot][3] = setup->posCoef.dadx[3];
- setup->coef.dady[slot][3] = setup->posCoef.dady[3];
+ setup->coef.a0[1 + slot][3] = setup->coef.a0[0][3];
+ setup->coef.dadx[1 + slot][3] = setup->coef.dadx[0][3];
+ setup->coef.dady[1 + slot][3] = setup->coef.dady[0][3];
}
}
if (lpfs->info.input_semantic_name[fragSlot] == TGSI_SEMANTIC_FACE) {
- setup->coef.a0[fragSlot][0] = 1.0f - setup->facing;
- setup->coef.dadx[fragSlot][0] = 0.0;
- setup->coef.dady[fragSlot][0] = 0.0;
+ setup->coef.a0[1 + fragSlot][0] = 1.0f - setup->facing;
+ setup->coef.dadx[1 + fragSlot][0] = 0.0;
+ setup->coef.dady[1 + fragSlot][0] = 0.0;
}
}
}
const float da = setup->vmax[vertSlot][i] - setup->vmin[vertSlot][i];
const float dadx = da * setup->emaj.dx * setup->oneoverarea;
const float dady = da * setup->emaj.dy * setup->oneoverarea;
- setup->posCoef.dadx[i] = dadx;
- setup->posCoef.dady[i] = dady;
- setup->posCoef.a0[i] = (setup->vmin[vertSlot][i] -
+ setup->coef.dadx[0][i] = dadx;
+ setup->coef.dady[0][i] = dady;
+ setup->coef.a0[0][i] = (setup->vmin[vertSlot][i] -
(dadx * (setup->vmin[0][0] - 0.5f) +
dady * (setup->vmin[0][1] - 0.5f)));
}
const float da = setup->vmax[vertSlot][i] - setup->vmin[vertSlot][i];
const float dadx = da * setup->emaj.dx * setup->oneoverarea;
const float dady = da * setup->emaj.dy * setup->oneoverarea;
- setup->coef.dadx[attrib][i] = dadx;
- setup->coef.dady[attrib][i] = dady;
- setup->coef.a0[attrib][i] = (setup->vmin[vertSlot][i] -
+ setup->coef.dadx[1 + attrib][i] = dadx;
+ setup->coef.dady[1 + attrib][i] = dady;
+ setup->coef.a0[1 + attrib][i] = (setup->vmin[vertSlot][i] -
(dadx * (setup->vmin[0][0] - 0.5f) +
dady * (setup->vmin[0][1] - 0.5f)));
}
const float da = a1 - a0;
const float dadx = da * setup->emaj.dx * setup->oneoverarea;
const float dady = da * setup->emaj.dy * setup->oneoverarea;
- setup->coef.dadx[attrib][i] = dadx;
- setup->coef.dady[attrib][i] = dady;
- setup->coef.a0[attrib][i] = (setup->vmin[vertSlot][i] -
+ setup->coef.dadx[1 + attrib][i] = dadx;
+ setup->coef.dady[1 + attrib][i] = dady;
+ setup->coef.a0[1 + attrib][i] = (setup->vmin[vertSlot][i] -
(dadx * (setup->vmin[0][0] - 0.5f) +
dady * (setup->vmin[0][1] - 0.5f)));
}
}
if (lpfs->info.input_semantic_name[fragSlot] == TGSI_SEMANTIC_FACE) {
- setup->coef.a0[fragSlot][0] = 1.0f - setup->facing;
- setup->coef.dadx[fragSlot][0] = 0.0;
- setup->coef.dady[fragSlot][0] = 0.0;
+ setup->coef.a0[1 + fragSlot][0] = 1.0f - setup->facing;
+ setup->coef.dadx[1 + fragSlot][0] = 0.0;
+ setup->coef.dady[1 + fragSlot][0] = 0.0;
}
}
return TRUE;
{
unsigned i;
for(i = 0; i < NUM_CHANNELS; ++i) {
- setup->coef.dadx[attrib][i] = 0.0F;
- setup->coef.dady[attrib][i] = 0.0F;
- setup->coef.a0[attrib][i] = vert[vertSlot][i] * vert[0][3];
+ setup->coef.dadx[1 + attrib][i] = 0.0F;
+ setup->coef.dady[1 + attrib][i] = 0.0F;
+ setup->coef.a0[1 + attrib][i] = vert[vertSlot][i] * vert[0][3];
}
}
}
if (lpfs->info.input_semantic_name[fragSlot] == TGSI_SEMANTIC_FACE) {
- setup->coef.a0[fragSlot][0] = 1.0f - setup->facing;
- setup->coef.dadx[fragSlot][0] = 0.0;
- setup->coef.dady[fragSlot][0] = 0.0;
+ setup->coef.a0[1 + fragSlot][0] = 1.0f - setup->facing;
+ setup->coef.dadx[1 + fragSlot][0] = 0.0;
+ setup->coef.dady[1 + fragSlot][0] = 0.0;
}
}
for (i = 0; i < MAX_QUADS; i++) {
setup->quad[i].coef = &setup->coef;
- setup->quad[i].posCoef = &setup->posCoef;
}
setup->span.left[0] = 1000000; /* greater than right[0] */