#include "vtxfmt.h"
#include "r200_vtxfmt.h"
+#include "r200_tcl.h"
+
+#include "dispatch.h"
/* Fallback versions of all the entrypoints for situations where
* codegen isn't available. This is still a lot faster than the
}
+/* FogCoord
+ */
+static void r200_FogCoordfEXT( GLfloat f )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat *dest = rmesa->vb.fogptr;
+ dest[0] = r200ComputeFogBlendFactor( ctx, f );
+/* ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = f;*/
+}
+
+static void r200_FogCoordfvEXT( const GLfloat *v )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ GLfloat *dest = rmesa->vb.fogptr;
+ dest[0] = r200ComputeFogBlendFactor( ctx, v[0] );
+/* ctx->Current.Attrib[VERT_ATTRIB_FOG][0] = v[0];*/
+}
+
+
/* TexCoord
*/
break;
default:
VFMT_FALLBACK(__FUNCTION__);
- GL_CALL(MultiTexCoord2fARB)(target, s, t);
+ CALL_MultiTexCoord2fARB(GET_DISPATCH(), (target, s, t));
return;
}
}
break;
default:
VFMT_FALLBACK(__FUNCTION__);
- GL_CALL(MultiTexCoord3fARB)(target, s, t, r);
+ CALL_MultiTexCoord3fARB(GET_DISPATCH(), (target, s, t, r));
return;
}
}
return f;
}
- return 0;
+ return NULL;
}
/* Can't use the loopback template for this:
fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
\
if (dfn) \
- ctx->Exec->FN = (FNTYPE)(dfn->code); \
+ SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- ctx->Exec->FN = r200_##FN; \
+ SET_ ## FN (ctx->Exec, r200_##FN); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- ctx->Exec->FN ARGS2; \
+ CALL_ ## FN (ctx->Exec, ARGS2); \
}
key[1] = rmesa->vb.vtxfmt_1 & MASK1; \
\
if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_PK_RGBA) { \
- ctx->Exec->FN = r200_##FN##_ub; \
+ SET_ ## FN (ctx->Exec, r200_##FN##_ub); \
} \
else if (VTX_COLOR(rmesa->vb.vtxfmt_0,0) == R200_VTX_FP_RGB) { \
\
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
r200_copy_to_current( ctx ); \
_mesa_install_exec_vtxfmt( ctx, &rmesa->vb.vtxfmt ); \
- ctx->Exec->FN ARGS2; \
+ CALL_ ## FN (ctx->Exec, ARGS2); \
return; \
} \
} \
\
- ctx->Exec->FN = r200_##FN##_3f; \
+ SET_ ## FN (ctx->Exec, r200_##FN##_3f); \
} \
else { \
- ctx->Exec->FN = r200_##FN##_4f; \
+ SET_ ## FN (ctx->Exec, r200_##FN##_4f); \
} \
\
\
if (dfn) { \
if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- codegen version\n", __FUNCTION__ ); \
- ctx->Exec->FN = (FNTYPE)dfn->code; \
+ SET_ ## FN (ctx->Exec, (FNTYPE)dfn->code); \
} \
else if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- 'c' version\n", __FUNCTION__ ); \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- ctx->Exec->FN ARGS2; \
+ CALL_ ## FN (ctx->Exec, ARGS2); \
}
fprintf(stderr, "%s -- cached version\n", __FUNCTION__ ); \
\
if (dfn) \
- ctx->Exec->FN = (FNTYPE)(dfn->code); \
+ SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (R200_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- ctx->Exec->FN = (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \
- ? r200_##FN##_ub : r200_##FN##_3f; \
+ SET_ ## FN (ctx->Exec, (VTX_COLOR(rmesa->vb.vtxfmt_0,1) == R200_VTX_PK_RGBA) \
+ ? r200_##FN##_ub : r200_##FN##_3f); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- ctx->Exec->FN ARGS2; \
+ CALL_ ## FN (ctx->Exec, ARGS2); \
}
*/
#define MASK_XYZW (R200_VTX_W0|R200_VTX_Z0)
#define MASK_NORM (MASK_XYZW|R200_VTX_N0)
-#define MASK_COLOR (MASK_NORM |(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_0_SHIFT))
+#define MASK_FOG (MASK_NORM |R200_VTX_DISCRETE_FOG)
+#define MASK_COLOR (MASK_FOG |(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_0_SHIFT))
#define MASK_SPEC (MASK_COLOR|(R200_VTX_COLOR_MASK<<R200_VTX_COLOR_1_SHIFT))
/* VTXFMT_1
CHOOSE(Vertex2fv, pfv, ~0, ~0,
(const GLfloat *v), (v))
+CHOOSE(FogCoordfEXT, p1f, MASK_FOG, ~0,
+ (GLfloat f), (f))
+CHOOSE(FogCoordfvEXT, pfv, MASK_FOG, ~0,
+ (const GLfloat *f), (f))
vfmt->Vertex2fv = choose_Vertex2fv;
vfmt->Vertex3f = choose_Vertex3f;
vfmt->Vertex3fv = choose_Vertex3fv;
+/* vfmt->FogCoordfEXT = choose_FogCoordfEXT;
+ vfmt->FogCoordfvEXT = choose_FogCoordfvEXT;*/
/* TODO: restore ubyte colors to vtxfmt.
*/
static struct dynfn *codegen_noop( GLcontext *ctx, const int *key )
{
(void) ctx; (void) key;
- return 0;
+ return NULL;
}
void r200InitCodegen( struct dfn_generators *gen, GLboolean useCodegen )
gen->MultiTexCoord2fvARB = codegen_noop;
gen->MultiTexCoord1fARB = codegen_noop;
gen->MultiTexCoord1fvARB = codegen_noop;
+/* gen->FogCoordfEXT = codegen_noop;
+ gen->FogCoordfvEXT = codegen_noop;*/
gen->Vertex2f = codegen_noop;
gen->Vertex2fv = codegen_noop;