* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef FX
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "math/m_translate.h"
#include "swrast_setup/swrast_setup.h"
#if FX_PACKEDCOLOR
*(GLuint *)&dst->pargb = *(GLuint *)&src->pargb;
#else /* !FX_PACKEDCOLOR */
- *(GLuint *)&dst->r = *(GLuint *)&src->r;
- *(GLuint *)&dst->g = *(GLuint *)&src->g;
- *(GLuint *)&dst->b = *(GLuint *)&src->b;
- *(GLuint *)&dst->a = *(GLuint *)&src->a;
+ COPY_FLOAT(dst->r, src->r);
+ COPY_FLOAT(dst->g, src->g);
+ COPY_FLOAT(dst->b, src->b);
+ COPY_FLOAT(dst->a, src->a);
#endif /* !FX_PACKEDCOLOR */
}
*(GLuint *)&dst->pargb = *(GLuint *)&src->pargb;
*(GLuint *)&dst->pspec = *(GLuint *)&src->pspec;
#else /* !FX_PACKEDCOLOR */
- *(GLuint *)&dst->r = *(GLuint *)&src->r;
- *(GLuint *)&dst->g = *(GLuint *)&src->g;
- *(GLuint *)&dst->b = *(GLuint *)&src->b;
- *(GLuint *)&dst->a = *(GLuint *)&src->a;
- *(GLuint *)&dst->r1 = *(GLuint *)&src->r1;
- *(GLuint *)&dst->g1 = *(GLuint *)&src->g1;
- *(GLuint *)&dst->b1 = *(GLuint *)&src->b1;
+ COPY_FLOAT(dst->r, src->r);
+ COPY_FLOAT(dst->g, src->g);
+ COPY_FLOAT(dst->b, src->b);
+ COPY_FLOAT(dst->a, src->a);
+ COPY_FLOAT(dst->r1, src->r1);
+ COPY_FLOAT(dst->g1, src->g1);
+ COPY_FLOAT(dst->b1, src->b1);
#endif /* !FX_PACKEDCOLOR */
}
static struct {
- tnl_emit_func emit;
+ void (*emit) (GLcontext *ctx, GLuint start, GLuint end, void *dest);
tnl_copy_pv_func copy_pv;
tnl_interp_func interp;
- GLboolean (*check_tex_sizes)( GLcontext *ctx );
+ GLboolean (*check_tex_sizes) (GLcontext *ctx);
GLuint vertex_format;
} setup_tab[MAX_SETUP];
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) {
- assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
-
- INTERP_4F( t,
- GET_COLOR(VB->ColorPtr[1], dst),
- GET_COLOR(VB->ColorPtr[1], out),
- GET_COLOR(VB->ColorPtr[1], in) );
+ /* If stride is zero, ColorPtr[1] is constant across the VB, so
+ * there is no point interpolating between two values as they will
+ * be identical. This case is handled in t_dd_tritmp.h
+ */
+ if (VB->ColorPtr[1]->stride) {
+ assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat));
+ INTERP_4F( t,
+ GET_COLOR(VB->ColorPtr[1], dst),
+ GET_COLOR(VB->ColorPtr[1], out),
+ GET_COLOR(VB->ColorPtr[1], in) );
+ }
if (VB->SecondaryColorPtr[1]) {
INTERP_3F( t,
fprintf(stderr, "%s(%x): %s%s%s%s%s%s%s%s\n",
msg,
(int)flags,
- (flags & SETUP_XYZW) ? " xyzw," : "",
- (flags & SETUP_SNAP) ? " snap," : "",
+ (flags & SETUP_XYZW) ? " xyzw," : "",
+ (flags & SETUP_SNAP) ? " snap," : "",
(flags & SETUP_RGBA) ? " rgba," : "",
(flags & SETUP_TMU0) ? " tex-0," : "",
(flags & SETUP_TMU1) ? " tex-1," : "",
}
-void fxBuildVertices( GLcontext *ctx, GLuint start, GLuint count,
+void fxBuildVertices( GLcontext *ctx, GLuint start, GLuint end,
GLuint newinputs )
{
fxMesaContext fxMesa = FX_CONTEXT( ctx );
return;
if (newinputs & VERT_BIT_POS) {
- setup_tab[fxMesa->SetupIndex].emit( ctx, start, count, v );
+ setup_tab[fxMesa->SetupIndex].emit( ctx, start, end, v );
} else {
GLuint ind = 0;
if (newinputs & VERT_BIT_COLOR0)
ind |= SETUP_RGBA;
-
+
if (newinputs & VERT_BIT_COLOR1)
ind |= SETUP_SPEC;
if (newinputs & VERT_BIT_FOG)
ind |= SETUP_FOGC;
- if (newinputs & VERT_BIT_TEX0)
+ if (newinputs & VERT_BIT_TEX0)
ind |= SETUP_TMU0;
if (newinputs & VERT_BIT_TEX1)
ind &= fxMesa->SetupIndex;
if (ind) {
- setup_tab[ind].emit( ctx, start, count, v );
+ setup_tab[ind].emit( ctx, start, end, v );
}
}
}