Draw large (size >= 1) non-AA point. RGB or CI mode.
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLboolean ciMode = !ctx->Visual.rgbMode;
SWspan span;
GLfloat size;
CULL_INVALID(vert);
if (ctx->DrawBuffer->Visual.depthBits <= 16)
span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
else
span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
span.zStep = 0;
size = get_size(ctx, vert, GL_FALSE);
INIT_SPAN(span, GL_POINT);
span.arrayMask = SPAN_XY;
span.facing = swrast->PointLineFacing;
if (ciMode) {
span.interpMask = SPAN_Z | SPAN_INDEX;
span.index = FloatToFixed(vert->attrib[FRAG_ATTRIB_CI][0]);
span.indexStep = 0;
}
else {
span.interpMask = SPAN_Z | SPAN_RGBA;
span.red = ChanToFixed(vert->color[0]);
span.green = ChanToFixed(vert->color[1]);
span.blue = ChanToFixed(vert->color[2]);
span.alpha = ChanToFixed(vert->color[3]);
span.redStep = 0;
span.greenStep = 0;
span.blueStep = 0;
span.alphaStep = 0;
}
span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
ATTRIB_LOOP_BEGIN
COPY_4V(span.attrStart[attr], vert->attrib[attr]);
ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
ATTRIB_LOOP_END
{
const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
GLint iSize = (GLint) (size + 0.5F);
GLint xmin, xmax, ymin, ymax, ix, iy;
GLint iRadius;
iSize = MAX2(1, iSize);
iRadius = iSize / 2;
if (iSize & 1) {
xmin = (GLint) (x - iRadius);
xmax = (GLint) (x + iRadius);
ymin = (GLint) (y - iRadius);
ymax = (GLint) (y + iRadius);
}
else {
xmin = (GLint) (x + 0.501) - iRadius;
xmax = xmin + iSize - 1;
ymin = (GLint) (y + 0.501) - iRadius;
ymax = ymin + iSize - 1;
}
span.end = 0;
for (iy = ymin; iy <= ymax; iy++) {
for (ix = xmin; ix <= xmax; ix++) {
span.array->x[span.end] = ix;
span.array->y[span.end] = iy;
span.end++;
}
}
assert(span.end <= MAX_WIDTH);
_swrast_write_rgba_span(ctx, &span);
}
}