#include "radeon_vtxfmt.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
* vb/pipeline implementation in Mesa.
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
+ GLfloat *dest = rmesa->vb.texcoordptr[target & 3];
dest[0] = s;
dest[1] = 0;
}
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
+ GLfloat *dest = rmesa->vb.texcoordptr[target & 3];
dest[0] = v[0];
dest[1] = 0;
}
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
+ GLfloat *dest = rmesa->vb.texcoordptr[target & 3];
dest[0] = s;
dest[1] = t;
}
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLfloat *dest = rmesa->vb.texcoordptr[target & 1];
+ GLfloat *dest = rmesa->vb.texcoordptr[target & 3];
dest[0] = v[0];
dest[1] = v[1];
}
fprintf(stderr, "%s -- cached codegen\n", __FUNCTION__ ); \
\
if (dfn) \
- ctx->Exec->FN = (FNTYPE)(dfn->code); \
+ SET_ ## FN (ctx->Exec, (FNTYPE)(dfn->code)); \
else { \
if (RADEON_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- ctx->Exec->FN = radeon_##FN; \
+ SET_ ## FN (ctx->Exec, radeon_##FN); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- ctx->Exec->FN ARGS2; \
+ CALL_ ## FN (ctx->Exec, ARGS2); \
}
struct dynfn *dfn; \
\
if (rmesa->vb.vertex_format & ACTIVE_PKCOLOR) { \
- ctx->Exec->FN = radeon_##FN##_ub; \
+ SET_ ## FN (ctx->Exec, radeon_##FN##_ub); \
} \
else if ((rmesa->vb.vertex_format & \
(ACTIVE_FPCOLOR|ACTIVE_FPALPHA)) == ACTIVE_FPCOLOR) { \
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) { \
radeon_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 = radeon_##FN##_3f; \
+ SET_ ## FN (ctx->Exec, radeon_##FN##_3f); \
} \
else { \
- ctx->Exec->FN = radeon_##FN##_4f; \
+ SET_ ## FN (ctx->Exec, radeon_##FN##_4f); \
} \
\
\
if (dfn) { \
if (RADEON_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 (RADEON_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 (RADEON_DEBUG & DEBUG_CODEGEN) \
fprintf(stderr, "%s -- generic version\n", __FUNCTION__ ); \
- ctx->Exec->FN = ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \
- ? radeon_##FN##_ub : radeon_##FN##_3f; \
+ SET_ ## FN (ctx->Exec, ((rmesa->vb.vertex_format & ACTIVE_PKSPEC) != 0) \
+ ? radeon_##FN##_ub : radeon_##FN##_3f); \
} \
\
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
- ctx->Exec->FN ARGS2; \
+ CALL_ ## FN (ctx->Exec, ARGS2); \
}
#define ACTIVE_ST0 RADEON_CP_VC_FRMT_ST0
#define ACTIVE_ST1 RADEON_CP_VC_FRMT_ST1
-#define ACTIVE_ST_ALL (RADEON_CP_VC_FRMT_ST1|RADEON_CP_VC_FRMT_ST0)
+#define ACTIVE_ST2 RADEON_CP_VC_FRMT_ST2
+#define ACTIVE_ST_ALL (RADEON_CP_VC_FRMT_ST1|RADEON_CP_VC_FRMT_ST0|RADEON_CP_VC_FRMT_ST2)
/* Each codegen function should be able to be fully specified by a
* subsetted version of rmesa->vb.vertex_format.
#define MASK_SPEC (MASK_COLOR|ACTIVE_COLOR)
#define MASK_ST0 (MASK_SPEC|ACTIVE_SPEC)
#define MASK_ST1 (MASK_ST0|ACTIVE_ST0)
-#define MASK_ST_ALL (MASK_ST1|ACTIVE_ST1)
+#define MASK_ST2 (MASK_ST1|ACTIVE_ST1)
+#define MASK_ST_ALL (MASK_ST2|ACTIVE_ST2)
#define MASK_VERTEX (MASK_ST_ALL|ACTIVE_FPALPHA)