code if DEBUG not defined.
#include "utils.h"
viaContextPtr current_mesa;
+#ifdef DEBUG
GLuint VIA_DEBUG = 0;
+#endif
GLuint DRAW_FRONT = 0;
#define DMA_SIZE 2
GLuint VIA_PERFORMANCE = 0;
+ extra;
vmesa->back.size = vmesa->back.pitch * vmesa->driDrawable->h;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaMakeCurrent backbuffer: w = %d h = %d bpp = %d sizs = %d\n",
vmesa->back.pitch,
vmesa->driDrawable->h,
8 << shift,
vmesa->back.size);
-#endif
/* Allocate depth-buffer */
if ( vmesa->hasStencil || vmesa->hasDepth ) {
(void) memset( & vmesa->depth, 0, sizeof( vmesa->depth ) );
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaMakeCurrent depthbuffer: w = %d h = %d bpp = %d sizs = %d\n",
vmesa->depth.pitch,
vmesa->driDrawable->h,
vmesa->depth.bpp,
vmesa->depth.size);
-#endif
/*=* John Sheng [2003.5.31] flip *=*/
if( (vmesa->viaScreen->width == vmesa->driDrawable->w)
ctx->DrawBuffer->Width = drawbuffer->Width;
ctx->DrawBuffer->Height = drawbuffer->Height;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
ctx->DrawBuffer->Accum = 0;
vmesa->driDrawable->w = ctx->DrawBuffer->Width;
calculate_buffer_parameters( vmesa );
UNLOCK_HARDWARE(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
static GLboolean
AllocateDmaBuffer(const GLvisual *visual, viaContextPtr vmesa)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (vmesa->dma)
via_free_dma_buffer(vmesa);
return GL_FALSE;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
if (!vmesa) {
return GL_FALSE;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
current_mesa = vmesa;
/* pick back buffer */
if (mesaVis->doubleBufferMode) {
viaInitVB(ctx);
viaInitState(ctx);
+#ifdef DEBUG
if (getenv("VIA_DEBUG"))
VIA_DEBUG = 1;
else
VIA_DEBUG = 0;
-
+#endif
+
if (getenv("DRAW_FRONT"))
DRAW_FRONT = 1;
else
vmesa->regTranSet = (GLuint *)((GLuint)viaScreen->reg + 0x43C);
vmesa->regTranSpace = (GLuint *)((GLuint)viaScreen->reg + 0x440);
vmesa->agpBase = viaScreen->agpBase;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "regEngineStatus = %x\n", *vmesa->regEngineStatus);
}
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
{
#ifndef USE_XINERAMA
vmesa->saam = 0;
viaDestroyContext(__DRIcontextPrivate *driContextPriv)
{
viaContextPtr vmesa = (viaContextPtr)driContextPriv->driverPrivate;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
assert(vmesa); /* should never be null */
viaFlushPrimsLocked(vmesa);
WAIT_IDLE
if (VIA_PERFORMANCE) fprintf(stderr, "idle = %d\n", idle);
if (VIA_PERFORMANCE) fprintf(stderr, "busy = %d\n", busy);
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaXMesaSetFrontClipRects(viaContextPtr vmesa)
GLboolean
viaUnbindContext(__DRIcontextPrivate *driContextPriv)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
__DRIdrawablePrivate *driDrawPriv,
__DRIdrawablePrivate *driReadPriv)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) {
fprintf(stderr, "driContextPriv = %08x\n", (GLuint)driDrawPriv);
fprintf(stderr, "driContextPriv = %08x\n", (GLuint)driReadPriv);
}
-#endif
if (driContextPriv) {
viaContextPtr vmesa = (viaContextPtr)driContextPriv->driverPrivate;
current_mesa = vmesa;
-#ifdef DEBUG
- if (VIA_DEBUG) fprintf(stderr, "viaScreen->bitsPerPixel = %d\n", viaScreen->bitsPerPixel);
if (VIA_DEBUG) fprintf(stderr, "viaMakeCurrent: w = %d\n", vmesa->driDrawable->w);
-#endif
vmesa->driDrawable = driDrawPriv;
if ( ! calculate_buffer_parameters( vmesa ) ) {
_mesa_make_current2(vmesa->glCtx,
(GLframebuffer *)driDrawPriv->driverPrivate,
(GLframebuffer *)driReadPriv->driverPrivate);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Context %d MakeCurrent\n", vmesa->hHWContext);
-#endif
viaXMesaWindowMoved(vmesa);
}
else {
_mesa_make_current(0,0);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
__DRIscreenPrivate *psp;
pdp = dPriv;
psp = sPriv;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "drmGetLock - in\n");
-#endif
drmGetLock(vmesa->driFd, vmesa->hHWContext, flags);
DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv );
}
viaXMesaWindowMoved(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaLock(viaContextPtr vmesa, GLuint flags)
drm_via_sarea_t *sarea = vmesa->sarea;
int me = vmesa->hHWContext;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "sarea->ctxOwner = %d\n", sarea->ctxOwner);
if (VIA_DEBUG) fprintf(stderr, "me = %d\n", me);
-#endif
if (sarea->ctxOwner == me) {
sarea->ctxOwner = 0;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void
viaSwapBuffers(__DRIdrawablePrivate *drawablePrivate)
{
__DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *)drawablePrivate;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
viaContextPtr vmesa;
GLcontext *ctx;
else {
_mesa_problem(NULL, "viaSwapBuffers: drawable has no context!\n");
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
} while (0)
+#ifdef DEBUG
extern GLuint VIA_DEBUG;
+#else
+#define VIA_DEBUG 0
+#endif
+
+
extern GLuint DRAW_FRONT;
extern void viaGetLock(viaContextPtr vmesa, GLuint flags);
extern void viaLock(viaContextPtr vmesa, GLuint flags);
GLuint facing;
LOCAL_VARS(3);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
SET_PRIMITIVE_RENDERED
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#endif
GLenum mode = GL_FILL;
GLuint facing;
LOCAL_VARS(4);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
VERT_RESTORE_IND(2);
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#else
static void TAG(quad)(GLcontext *ctx, GLuint e0,
GLuint e1, GLuint e2, GLuint e3)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
TAG(triangle)(ctx, e0, e1, e3);
TAG(triangle)(ctx, e1, e2, e3);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#endif
#endif
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
VERTEX *v[2];
LOCAL_VARS(2);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
SET_PRIMITIVE_RENDERED
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#endif
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
int i;
LOCAL_VARS(1);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#endif
const GLubyte *mask = VB->ClipMask;
int i;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "TAG-emit for HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICE\n");
-#endif
if (HAVE_HW_VIEWPORT && HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
(void) s;
(void) s;
/*ASSERT(stride == 4);*/
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "TAG-emit for DO_XYZW\n");
fprintf(stderr, "%s\n", __FUNCTION__);
}
-#endif
col = VB->ColorPtr[0]->data;
col_stride = VB->ColorPtr[0]->stride;
GLuint col_stride;
GLfloat *v = (GLfloat *)dest;
int i;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "TAG-emit for No DO_XYZW\n");
fprintf(stderr, "%s\n", __FUNCTION__);
}
-#endif
if (VB->ColorPtr[0]->Type != GL_UNSIGNED_BYTE)
IMPORT_FLOAT_COLORS( ctx );
/* Force 'missing' texcoords to something valid.
*/
-#ifdef DEBUG
- fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
+ if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (DO_TEX3 && VB->TexCoordPtr[2] == 0)
VB->TexCoordPtr[2] = VB->TexCoordPtr[3];
(DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) ||
(DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4))
return GL_FALSE;
-#ifdef DEBUG
- fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
+ if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
return GL_TRUE;
}
#else
VERTEX *out = (VERTEX *)(ddverts + (eout << shift));
(void)s;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
VIEWPORT_X(dst->v.x, dstclip[0]);
VIEWPORT_Y(dst->v.y, dstclip[1]);
INTERP_UB(t, dst->ub4[3][2], out->ub4[3][2], in->ub4[3][2]);
INTERP_UB(t, dst->ub4[3][3], out->ub4[3][3], in->ub4[3][3]);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#endif /* rgba && xyzw */
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_POINTS) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void TAG(render_lines_verts)(GLcontext *ctx,
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_LINES) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_LINE_STRIPS) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_LINE_STRIPS) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
int dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS() / 3) * 3;
int currentsz = (GET_CURRENT_VB_MAX_VERTS() / 3) * 3;
GLuint j, nr;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
currentsz = dmasz;
}
FINISH;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_TRI_STRIPS) {
LOCAL_VARS;
GLuint j, nr;
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void TAG(render_tri_fan_verts)(GLcontext *ctx,
GLuint count,
GLuint flags)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
*/
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_POLYGONS) {
LOCAL_VARS;
GLuint j, nr;
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void TAG(render_quad_strip_verts)(GLcontext *ctx,
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (HAVE_QUAD_STRIPS) {
LOCAL_VARS;
GLuint j, nr;
else {
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
GLuint count,
GLuint flags)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M_X;
#endif
*/
VERT_FALLBACK(ctx, start, count, flags);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_noop)(GLcontext *ctx,
{
drm_via_mem_t fb;
unsigned char *pFB;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
fb.context = vmesa->hHWContext;
fb.size = vmesa->back.size;
fb.type = VIDEO;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "context = %d, size =%d, type = %d\n", fb.context, fb.size, fb.type);
-#endif
if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb))
return GL_FALSE;
vmesa->back.offset = fb.offset;
vmesa->back.map = (char *)(fb.offset + (GLuint)pFB);
vmesa->back.index = fb.index;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "back offset = %08x\n", vmesa->back.offset);
fprintf(stderr, "back index = %d\n", vmesa->back.index);
}
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
{
drm_via_mem_t fb;
unsigned char *pFB;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
fb.context = vmesa->hHWContext;
fb.size = vmesa->back.size;
fb.type = VIDEO;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "context = %d, size =%d, type = %d\n", fb.context, fb.size, fb.type);
-#endif
if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb))
return GL_FALSE;
vmesa->front.offset = fb.offset;
vmesa->front.map = (char *)(fb.offset + (GLuint)pFB);
vmesa->front.index = fb.index;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "front offset = %08x\n", vmesa->front.offset);
fprintf(stderr, "front index = %d\n", vmesa->front.index);
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
{
drm_via_mem_t fb;
unsigned char *pFB;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
fb.context = vmesa->hHWContext;
fb.size = vmesa->depth.size;
fb.type = VIDEO;
vmesa->depth.offset = fb.offset;
vmesa->depth.map = (char *)(fb.offset + (GLuint)pFB);
vmesa->depth.index = fb.index;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "depth offset = %08x\n", vmesa->depth.offset);
fprintf(stderr, "depth index = %d\n", vmesa->depth.index);
}
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
{
drmVIADMAInit init;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
vmesa->dma = (GLuint *) malloc(VIA_DMA_BUFSIZ);
/*
else
printf("unichrome_dri.so: Using PCI.\n");
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return ((vmesa->dma) ? GL_TRUE : GL_FALSE);
}
via_alloc_texture(viaContextPtr vmesa, viaTextureObjectPtr t)
{
drm_via_mem_t fb;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
fb.context = vmesa->hHWContext;
fb.size = t->texMem.size;
fb.type = VIDEO;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "texture size = %d\n", fb.size);
fprintf(stderr, "texture type = %d\n", fb.type);
}
-#endif
if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb)) {
fprintf(stderr, "via_alloc_texture fail\n");
return GL_FALSE;
t->texMem.offset = fb.offset;
t->texMem.index = fb.index;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "texture index = %d\n", (GLuint)fb.index);
-#endif
t->bufAddr = (unsigned char *)(fb.offset + (GLuint)vmesa->driScreen->pFB);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
/*=* John Sheng [2003.5.31] agp tex *=*/
via_alloc_texture_agp(viaContextPtr vmesa, viaTextureObjectPtr t)
{
drm_via_mem_t fb;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
fb.context = vmesa->hHWContext;
fb.size = t->texMem.size;
fb.type = AGP;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "texture_agp size = %d\n", fb.size);
fprintf(stderr, "texture type = %d\n", fb.type);
}
-#endif
if (ioctl(vmesa->driFd, DRM_IOCTL_VIA_ALLOCMEM, &fb)) {
fprintf(stderr, "via_alloc_texture_agp fail\n");
return GL_FALSE;
t->texMem.offset = fb.offset;
t->texMem.index = fb.index;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "texture agp index = %d\n", (GLuint)fb.index);
-#endif
t->bufAddr = (unsigned char *)((GLuint)vmesa->viaScreen->agpLinearStart + fb.offset);
/*=* John Sheng [2003.5.31] agp tex *=*/
t->inAGP = GL_TRUE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
via_free_texture(viaContextPtr vmesa, viaTextureObjectPtr t)
{
drm_via_mem_t fb;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "via_free_texture: index = %d\n",
t->texMem.index);
fprintf(stderr, "via_free_texture: size = %d\n",
t->texMem.size);
}
-#endif
if (!vmesa) {
fprintf(stderr, "!mesa\n");
return;
GLuint scrn = 0, i = 0, side = 0;
scrn = vmesa->saam & S_MASK;
side = vmesa->saam & P_MASK;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
VIA_FIREVERTICES(vmesa);
if ((mask & DD_FRONT_LEFT_BIT) && colorMask == ~0) {
if (!vmesa->saam) {
if (!all) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr,"!all");
-#endif
for (; i < nr; i++) {
GLint x = box[i].x1;
GLint y = box[i].y1;
if (mask)
_swrast_Clear(ctx, mask, all, cx, cy, cw, ch);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
/*
drm_clip_rect_t *pbox;
int nbox, i;
GLuint scrn = 0, side = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
assert(dPriv);
assert(dPriv->driContextPriv);
assert(dPriv->driContextPriv->driverPrivate);
pbox = vmesa->pClipRects;
nbox = vmesa->numClipRects;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s %d cliprects (%d), SAAM (%d)\n",
__FUNCTION__, nbox, vmesa->drawType, vmesa->saam);
-#endif
if (vmesa->drawType == GLX_PBUFFER_BIT) {
viaDoSwapPBuffers(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s SwapPBuffers\n", __FUNCTION__);
-#endif /*=* [DBG] for pbuffer *=*/
}
else {
GLuint scrn = 0;
for (; i < nr; i++)
*b++ = pbox[i];
viaDoSwapBuffers(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s SwapBuffers\n", __FUNCTION__);
-#endif
}
}
else if (scrn == S0 || scrn == S1) {
}
UNLOCK_HARDWARE(vmesa);
vmesa->uploadCliprects = GL_TRUE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
/*
viaBuffer buffer_tmp;
GLcontext *ctx;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
assert(dPriv);
assert(dPriv->driContextPriv);
assert(dPriv->driContextPriv->driverPrivate);
ctx->Driver.DrawBuffer(ctx, GL_FRONT);
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
*/
void viaDmaFinish(viaContextPtr vmesa)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
VIA_FIREVERTICES(vmesa);
LOCK_HARDWARE(vmesa);
UNLOCK_HARDWARE(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
void viaRegetLockQuiescent(viaContextPtr vmesa)
vmesa->uploadCliprects = GL_TRUE;
}
/*=* John Sheng [2003.5.31] flip *=*/
-/*#ifdef DEBUG
+/*
if (VIA_DEBUG) {
GLuint i;
GLuint *data = (GLuint *)vmesa->dmaAddr;
}
fprintf(stderr, "******************************************\n");
}
-#endif*/
+*/
if (!nbox || !vmesa->uploadCliprects) {
if (nbox == 1)
sarea->nbox = 0;
}
}
}
-#ifdef DEBUG
if (VIA_DEBUG) {
GLuint i;
GLuint *data = (GLuint *)vmesa->dmaAddr;
}
fprintf(stderr, "******************************************\n");
}
-#endif
/* Reset vmesa vars:
*/
vmesa->dmaLow = DMA_OFFSET;
void viaFlushPrims(viaContextPtr vmesa)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (vmesa->dmaLow) {
LOCK_HARDWARE(vmesa);
viaFlushPrimsLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
}
static void viaFlush(GLcontext *ctx)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
VIA_FIREVERTICES(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void viaFinish(GLcontext *ctx)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
return;
}
GLuint pixel = (GLuint)vmesa->ClearColor;
offset = vmesa->front.offset;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Fill PFront offset = %08x\n", offset);
-#endif
nDestBase = offset;
nDestPitch = vmesa->front.pitch;
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
offset = vmesa->back.offset;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Fill Back offset = %08x\n", offset);
-#endif
nDestBase = offset;
nDestPitch = vmesa->back.pitch;
offsetX = vmesa->drawXoff;
b++;
}
}
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr," width = %08x\n", nDestWidth);
fprintf(stderr," height = %08x\n", nDestHeight);
}
-#endif
}
void viaFillStencilDepthBuffer(viaContextPtr vmesa, GLuint pixel)
GLuint *vb = viaCheckDma(vmesa, VIA_BLITSIZE);
offset = vmesa->depth.offset;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Fill Stencil Depth offset = %08x\n", offset);
-#endif
nDestBase = offset;
nDestPitch = vmesa->depth.pitch;
offsetX = vmesa->drawXoff;
GLuint *vb = viaCheckDma(vmesa, VIA_BLITSIZE);
offset = vmesa->depth.offset;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Fill Stencil offset = %08x\n", offset);
-#endif
nDestBase = offset;
nDestPitch = vmesa->depth.pitch;
offsetX = vmesa->drawXoff;
GLuint *vb = viaCheckDma(vmesa, VIA_BLITSIZE);
offset = vmesa->depth.offset;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Fill Depth offset = %08x\n", offset);
-#endif
nDestBase = offset;
nDestPitch = vmesa->depth.pitch;
offsetX = vmesa->drawXoff;
}
viaFlushPrimsLocked(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Do Swap Buffer\n");
-#endif
}
void viaDoSwapBuffersSaam(viaContextPtr vmesa)
}
viaFlushPrimsLocked(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Do Swap Buffer\n");
-#endif
}
void viaDoSwapPBuffers(viaContextPtr vmesa)
SetReg2DAGP(0x0, 0x1 | 0xCC000000);
viaFlushPrimsLocked(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Do Swap PBuffer\n");
-#endif
}
static __inline GLuint *viaCheckDma(viaContextPtr vmesa, int bytes)
{
if (vmesa->dmaLow + bytes > vmesa->dmaHigh) {
-#ifdef DEBUG
- if (VIA_DEBUG) fprintf(stderr, "buffer overflow in check dma = %d + %d = %d\n", vmesa->dmaLow, bytes, vmesa->dmaLow + bytes);
-#endif
+ if (VIA_DEBUG) fprintf(stderr, "buffer overflow in check dma = %d + %d = %d\n",
+ vmesa->dmaLow, bytes, vmesa->dmaLow + bytes);
viaFlushPrims(vmesa);
}
GLuint flags)
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
fprintf(stderr, "VERT_FALLBACK\n");
tnl->Driver.Render.PrimitiveNotify(ctx, flags & PRIM_MODE_MASK);
tnl->Driver.Render.BuildVertices(ctx, start, count, ~0);
tnl->Driver.Render.PrimTabVerts[flags & PRIM_MODE_MASK](ctx, start,
count, flags);
VIA_CONTEXT(ctx)->setupNewInputs = VERT_BIT_CLIP;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#endif
if (VB->ClipOrMask || vmesa->renderIndex != 0 || VB->Elts) {
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "slow path\n");
fprintf(stderr, "ClipOrMask = %08x\n", VB->ClipOrMask);
fprintf(stderr, "renderIndex = %08x\n", vmesa->renderIndex);
fprintf(stderr, "Elts = %08x\n", (GLuint)VB->Elts);
}
-#endif
return GL_TRUE;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
vmesa->setupNewInputs = VERT_BIT_CLIP;
vmesa->primitiveRendered = GL_TRUE;
/*=* DBG - viewperf7.0 : fix command buffer overflow *=*/
if (vmesa->dmaLow > (VIA_DMA_BUFSIZ / 2))
viaFlushPrims(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_FALSE; /* finished the pipe */
}
tnl_render_func *tab;
GLuint pass = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
/*=* DBG viewperf7.0 : fix command buffer overflow *=*/
if (vmesa->dmaLow > (VIA_DMA_BUFSIZ / 2))
viaFlushPrims(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_FALSE; /* finished the pipe */
}
{
viaScreenPrivate *viaScreen;
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
/* Allocate the private area */
#ifdef USE_XINERAMA
viaScreen->drixinerama = gDRIPriv->drixinerama;
#endif
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "deviceID = %08x\n", viaScreen->deviceID);
fprintf(stderr, "width = %08x\n", viaScreen->width);
fprintf(stderr, "cpp = %08x\n", viaScreen->cpp);
fprintf(stderr, "fbOffset = %08x\n", viaScreen->fbOffset);
}
-#endif
/* DBG */
/*
if (gDRIPriv->bitsPerPixel == 15)
viaScreen->agpLinearStart = 0;
viaScreen->sareaPrivOffset = gDRIPriv->sarea_priv_offset;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return GL_TRUE;
}
{
viaScreenPrivate *viaScreen = (viaScreenPrivate *)sPriv->private;
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
drmUnmap(viaScreen->reg, gDRIPriv->regs.size);
if (gDRIPriv->agp.size)
drmUnmap(viaScreen->agpLinearStart, gDRIPriv->agp.size);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
FREE(viaScreen);
sPriv->private = NULL;
}
GLboolean isPixmap)
{
viaContextPtr vmesa = current_mesa;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
/*=* John Sheng [2003.7.2] for visual config & patch viewperf *=*/
if (mesaVis->depthBits == 32 && vmesa->depthBits == 16) {
vmesa->depthBits = mesaVis->depthBits;
GL_FALSE /* s/w alpha planes */);
if (vmesa) vmesa->drawType = GLX_PBUFFER_BIT;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return (driDrawPriv->driverPrivate != NULL);
}
else {
GL_FALSE /* s/w alpha planes */);
if (vmesa) vmesa->drawType = GLX_WINDOW_BIT;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
return (driDrawPriv->driverPrivate != NULL);
}
}
static void
viaDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
_mesa_destroy_framebuffer((GLframebuffer *)(driDrawPriv->driverPrivate));
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint bufferBit)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (bufferBit == DD_FRONT_LEFT_BIT) {
vmesa->drawMap = (char *)vmesa->driScreen->pFB;
vmesa->readMap = (char *)vmesa->driScreen->pFB;
else {
ASSERT(0);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
swdd->SetBuffer = viaSetBuffer;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (vmesa->viaScreen->bitsPerPixel == 0x10) {
swdd->WriteRGBASpan = viaWriteRGBASpan_565;
swdd->WriteRGBSpan = viaWriteRGBSpan_565;
swdd->WriteMonoCIPixels = NULL;
swdd->ReadCI32Span = NULL;
swdd->ReadCI32Pixels = NULL;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
case 0x20:
return PACK_COLOR_8888(a, r, g, b);
default:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "unknown format %d\n", (int)format);
-#endif
return PACK_COLOR_8888(a, r, g, b);
}
}
static void viaBlendEquationSeparate(GLcontext *ctx, GLenum rgbMode, GLenum aMode)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
/* GL_EXT_blend_equation_separate not supported */
ASSERT(rgbMode == aMode);
FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_LOGICOP,
(ctx->Color.ColorLogicOpEnabled &&
ctx->Color.LogicOp != GL_COPY));
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void viaBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLboolean fallback = GL_FALSE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
switch (ctx->Color.BlendSrcRGB) {
case GL_ZERO: break;
case GL_SRC_ALPHA: break;
}
FALLBACK(vmesa, VIA_FALLBACK_BLEND_FUNC, fallback);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
/* Shouldn't be called as the extension is disabled.
GLsizei w, GLsizei h)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (ctx->Scissor.Enabled) {
VIA_FIREVERTICES(vmesa); /* don't pipeline cliprect changes */
vmesa->uploadCliprects = GL_TRUE;
vmesa->scissorRect.y1 = vmesa->driDrawable->h - (y + h);
vmesa->scissorRect.x2 = x + w;
vmesa->scissorRect.y2 = vmesa->driDrawable->h - y;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void viaLogicOp(GLcontext *ctx, GLenum opcode)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "opcode = %x\n", opcode);
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
/* Fallback to swrast for select and feedback.
static void viaRenderMode(GLcontext *ctx, GLenum mode)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
FALLBACK(vmesa, VIA_FALLBACK_RENDERMODE, (mode != GL_RENDER));
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void viaDrawBuffer(GLcontext *ctx, GLenum mode)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
-#endif
if (mode == GL_FRONT) {
VIA_FIREVERTICES(vmesa);
VIA_STATECHANGE(vmesa, VIA_UPLOAD_BUFFERS);
FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_TRUE);
return;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s out\n", __FUNCTION__);
-#endif
}
static void viaClearColor(GLcontext *ctx, const GLfloat color[4])
void viaPrintDirty(const char *msg, GLuint state)
{
-#ifdef DEBUG
if (VIA_DEBUG)
fprintf(stderr, "%s (0x%x): %s%s%s%s\n",
msg,
(state & VIA_UPLOAD_CTX) ? "upload-ctx, " : "",
(state & VIA_UPLOAD_BUFFERS) ? "upload-bufs, " : ""
);
-#endif
}
struct gl_texture_unit *texUnit1 = &ctx->Texture.Unit[1];
/*=* John Sheng [2003.7.18] texture combine *=*/
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (texUnit0->_ReallyEnabled || texUnit1->_ReallyEnabled) {
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "Texture._ReallyEnabled - in\n");
fprintf(stderr, "texUnit0->_ReallyEnabled = %x\n",texUnit0->_ReallyEnabled);
}
-#endif
-#ifdef DEBUG
if (VIA_DEBUG) {
struct gl_texture_object *texObj0 = texUnit0->_Current;
struct gl_texture_object *texObj1 = texUnit1->_Current;
if ( (texObj1 != NULL) && (texObj1->Image[0][0] != NULL) )
fprintf(stderr, "format 1: 0x%04x\n", texObj1->Image[0][0]->Format);
}
-#endif
if (texUnit0->_ReallyEnabled) {
struct gl_texture_object *texObj = texUnit0->_Current;
struct gl_texture_image *texImage = texObj->Image[0][0];
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "texUnit0->_ReallyEnabled\n");
-#endif
if (texImage->Border) {
FALLBACK(vmesa, VIA_FALLBACK_TEXTURE, GL_TRUE);
return;
vmesa->regHTXnMPMD_0 |= get_wrap_mode( texObj->WrapS,
texObj->WrapT );
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "texUnit0->EnvMode %x\n",texUnit0->EnvMode);
-#endif
viaTexCombineState( vmesa, texUnit0->_CurrentCombine, 0 );
}
}
vmesa->dirty |= VIA_UPLOAD_TEXTURE;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf( stderr, "Csat_0 / Cop_0 = 0x%08x / 0x%08x\n",
vmesa->regHTXnTBLCsat_0, vmesa->regHTXnTBLCop_0 );
fprintf( stderr, "RCbias_0 = 0x%08x\n",
vmesa->regHTXnTBLRCbias_0 );
}
-#endif
}
else {
if (ctx->Fog.Enabled)
vmesa->regEnable &= (~(HC_HenTXMP_MASK | HC_HenTXCH_MASK | HC_HenTXPP_MASK));
vmesa->dirty |= VIA_UPLOAD_ENABLE;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/* The HW's blending equation is:
* (Ca * FCa + Cbias + Cb * FCb) << Cshift
*/
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (ctx->Color.BlendEnabled) {
vmesa->regEnable |= HC_HenABL_MASK;
else
vmesa->regEnable &= (~HC_HenAW_MASK);
vmesa->dirty |= VIA_UPLOAD_ENABLE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaChooseFogState(GLcontext *ctx)
void viaChooseStencilState(GLcontext *ctx)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (ctx->Stencil.Enabled) {
GLuint temp;
vmesa->regEnable &= ~HC_HenST_MASK;
vmesa->dirty |= VIA_UPLOAD_ENABLE;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaChoosePoint(GLcontext *ctx)
void viaChooseTriangle(GLcontext *ctx)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
- if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-
- if (VIA_DEBUG) fprintf(stderr, "GL_CULL_FACE = %x\n", GL_CULL_FACE);
- if (VIA_DEBUG) fprintf(stderr, "ctx->Polygon.CullFlag = %x\n", ctx->Polygon.CullFlag);
-
- if (VIA_DEBUG) fprintf(stderr, "GL_FRONT = %x\n", GL_FRONT);
- if (VIA_DEBUG) fprintf(stderr, "ctx->Polygon.CullFaceMode = %x\n", ctx->Polygon.CullFaceMode);
- if (VIA_DEBUG) fprintf(stderr, "GL_CCW = %x\n", GL_CCW);
- if (VIA_DEBUG) fprintf(stderr, "ctx->Polygon.FrontFace = %x\n", ctx->Polygon.FrontFace);
-#endif
+ if (VIA_DEBUG) {
+ fprintf(stderr, "%s - in\n", __FUNCTION__);
+ fprintf(stderr, "GL_CULL_FACE = %x\n", GL_CULL_FACE);
+ fprintf(stderr, "ctx->Polygon.CullFlag = %x\n", ctx->Polygon.CullFlag);
+ fprintf(stderr, "GL_FRONT = %x\n", GL_FRONT);
+ fprintf(stderr, "ctx->Polygon.CullFaceMode = %x\n", ctx->Polygon.CullFaceMode);
+ fprintf(stderr, "GL_CCW = %x\n", GL_CCW);
+ fprintf(stderr, "ctx->Polygon.FrontFace = %x\n", ctx->Polygon.FrontFace);
+ }
if (ctx->Polygon.CullFlag == GL_TRUE) {
switch (ctx->Polygon.CullFaceMode) {
case GL_FRONT:
return;
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaChooseState(GLcontext *ctx, GLuint newState)
viaContextPtr vmesa = VIA_CONTEXT(ctx);
struct gl_texture_unit *texUnit0 = &ctx->Texture.Unit[0];
struct gl_texture_unit *texUnit1 = &ctx->Texture.Unit[1];
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-
if (VIA_DEBUG) fprintf(stderr, "newState = %x\n", newState);
-#endif
+
if (!(newState & (_NEW_COLOR |
_NEW_TEXTURE |
_NEW_DEPTH |
viaChooseTriangle(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaInvalidateState(GLcontext *ctx, GLuint newState)
struct gl_texture_image *texImage)
{
viaTextureObjectPtr t = (viaTextureObjectPtr)texObj->DriverData;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaTexImage1D - in\n");
-#endif
if (t) {
if (level == 0) {
viaSwapOutTexObj(VIA_CONTEXT(ctx), t);
_mesa_store_teximage1d(ctx, target, level, internalFormat,
width, border, format, type,
pixels, packing, texObj, texImage);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaTexImage1D - out\n");
-#endif
}
static void viaTexSubImage1D(GLcontext *ctx,
GLenum target,
struct gl_texture_image *texImage)
{
viaTextureObjectPtr t = (viaTextureObjectPtr)texObj->DriverData;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaTexImage2D - in\n");
-#endif
if (t) {
if (level == 0) {
viaSwapOutTexObj(VIA_CONTEXT(ctx), t);
_mesa_store_teximage2d(ctx, target, level, internalFormat,
width, height, border, format, type,
pixels, packing, texObj, texImage);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaTexImage2D - out\n");
-#endif
}
static void viaTexSubImage2D(GLcontext *ctx,
static void viaBindTexture(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaBindTexture - in\n");
-#endif
if (target == GL_TEXTURE_2D) {
viaTextureObjectPtr t = (viaTextureObjectPtr)texObj->DriverData;
texObj->DriverData = t;
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaBindTexture - out\n");
-#endif
}
static void viaDeleteTexture(GLcontext *ctx, struct gl_texture_object *texObj)
{
viaTextureObjectPtr t = (viaTextureObjectPtr)texObj->DriverData;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaDeleteTexture - in\n");
-#endif
if (t) {
viaContextPtr vmesa = VIA_CONTEXT(ctx);
if (vmesa) {
}
texObj->DriverData = 0;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaDeleteTexture - out\n");
-#endif
/* Free mipmap images and the texture object itself */
_mesa_delete_texture_object(ctx, texObj);
viaContextPtr vmesa = VIA_CONTEXT(ctx);
(void)format;
(void)type;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "internalFormat:%d format:%d\n", internalFormat, format);
-#endif
switch (internalFormat) {
case 1:
case GL_LUMINANCE:
case GL_R3_G3_B2:
case GL_RGB4:
case GL_RGB5:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "2 &_mesa_texformat_arg565\n");
-#endif
return &_mesa_texformat_rgb565;
case 3:
case GL_RGB:
case GL_RGB12:
case GL_RGB16:
if (vmesa->viaScreen->bitsPerPixel == 0x20) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr,"3 argb8888\n");
-#endif
return &_mesa_texformat_argb8888;
}
else {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr,"3 rgb565\n");
-#endif
return &_mesa_texformat_rgb565;
}
case 4:
if (vmesa->viaScreen->bitsPerPixel == 0x20) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "4 &_mesa_texformat_argb8888\n");
-#endif
return &_mesa_texformat_argb8888;
}
else {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "4 &_mesa_texformat_argb4444\n");
-#endif
return &_mesa_texformat_argb4444;
}
case GL_RGBA2:
case GL_RGBA4:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGBA4 &_mesa_texformat_argb4444\n");
-#endif
return &_mesa_texformat_argb4444;
case GL_RGB5_A1:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGB5_A1 &_mesa_texformat_argb1555\n");
-#endif
return &_mesa_texformat_argb1555;
case GL_RGBA:
case GL_RGBA8:
case GL_RGBA12:
case GL_RGBA16:
case GL_RGB10_A2:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGBA &_mesa_texformat_argb8888\n");
-#endif
return &_mesa_texformat_argb8888;
case GL_ALPHA:
case GL_ALPHA4:
void viaInitTextureFuncs(struct dd_function_table * functions)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaInitTextureFuncs - in\n");
-#endif
functions->TexEnv = viaTexEnv;
functions->ChooseTextureFormat = viaChooseTexFormat;
functions->TexImage1D = viaTexImage1D;
functions->IsTextureResident = viaIsTextureResident;
functions->TestProxyTexImage = _mesa_test_proxy_teximage;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "viaInitTextureFuncs - out\n");
-#endif
}
void viaInitTextures(GLcontext *ctx)
void viaDestroyTexObj(viaContextPtr vmesa, viaTextureObjectPtr t)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (!t)
return;
remove_from_list(t);
free(t);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaSwapOutTexObj(viaContextPtr vmesa, viaTextureObjectPtr t)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (t->bufAddr) {
via_free_texture(vmesa, t);
t->dirtyImages = ~0;
move_to_tail(&(vmesa->SwappedOut), t);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/* Upload an image from mesa's internal copy.
{
const struct gl_texture_image *image = t->image[level].image;
int i, j;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "%s - in\n", __FUNCTION__);
fprintf(stderr, "width = %d, height = %d \n", image->Width, image->Height);
}
-#endif
switch (t->image[level].internalFormat) {
case GL_RGB:
{
if (image->TexFormat->MesaFormat == MESA_FORMAT_ARGB8888) {
GLuint *dst = (GLuint *)(t->bufAddr + t->image[level].offset);
GLuint *src = (GLuint *)image->Data;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGB MESA_FORMAT_ARGB8888\n");
-#endif
if (image->Width < 8) {
for (i = 0; i < image->Height ; i++) {
for (j = 0; j < image->Width ; j++) {
else {
GLushort *dst = (GLushort *)(t->bufAddr + t->image[level].offset);
GLushort *src = (GLushort *)image->Data;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGB !MESA_FORMAT_ARGB8888\n");
-#endif
if (image->Width < 16) {
for (i = 0; i < image->Height ; i++) {
for (j = 0; j < image->Width ; j++) {
}
}
/*memcpy(dst, src, image->Height * image->Width * sizeof(GLushort));*/
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGBA MESA_FORMAT_ARGB4444\n");
-#endif
}
else if(image->TexFormat->MesaFormat == MESA_FORMAT_ARGB8888) {
GLuint *dst = (GLuint *)(t->bufAddr + t->image[level].offset);
GLuint *src = (GLuint *)image->Data;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGBA !MESA_FORMAT_ARGB4444\n");
-#endif
if (image->Width < 8) {
for (i = 0; i < image->Height ; i++) {
for (j = 0; j < image->Width ; j++) {
}
}
/*memcpy(dst, src, image->Height * image->Width * sizeof(GLushort));*/
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "GL_RGBA MESA_FORMAT_ARGB1555\n");
-#endif
}
}
break;
break;
default:;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Not supported texture format %s\n",
_mesa_lookup_enum_by_nr(image->Format));
-#endif
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaPrintLocalLRU(viaContextPtr vmesa)
foreach (t, &vmesa->TexObjList) {
if (!t->globj) {
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "offset = %x, index = %x, size = %x\n",
t->texMem.offset,
t->texMem.size);
}
}
-#endif
}
}
}
drm_via_tex_region_t *list = vmesa->sarea->texList;
for (i = 0, j = VIA_NR_TEX_REGIONS; i < VIA_NR_TEX_REGIONS; i++) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "list[%d] age %d next %d prev %d\n",
j, list[j].age, list[j].next, list[j].prev);
-#endif
j = list[j].next;
if (j == VIA_NR_TEX_REGIONS) break;
}
-#ifdef DEBUG
if (j != VIA_NR_TEX_REGIONS)
if (VIA_DEBUG) fprintf(stderr, "Loop detected in global LRU\n");
-#endif
}
void viaResetGlobalLRU(viaContextPtr vmesa)
GLuint inUse)
{
viaTextureObjectPtr t, tmp;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
foreach_s (t, tmp, &vmesa->TexObjList) {
viaSwapOutTexObj(vmesa, t);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/* This is called with the lock held. May have to eject our own and/or
{
int i, j;
int numLevels;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
LOCK_HARDWARE(vmesa);
j = 0;
agpFullCount++;
if (vmesa->TexObjList.prev == vmesa->CurrentTexObj[0] ||
vmesa->TexObjList.prev == vmesa->CurrentTexObj[1]) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Hit bound texture in upload\n");
-#endif
viaPrintLocalLRU(vmesa);
UNLOCK_HARDWARE(vmesa);
return;
}
if (vmesa->TexObjList.prev == &(vmesa->TexObjList)) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Failed to upload texture, sz %d\n", t->totalSize);
-#endif
mmDumpMemInfo(vmesa->texHeap);
UNLOCK_HARDWARE(vmesa);
return;
t->dirtyImages = 0;
UNLOCK_HARDWARE(vmesa);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint basH = 0;
GLuint widthExp = 0;
GLuint heightExp = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
switch (baseImage->TexFormat->MesaFormat) {
case MESA_FORMAT_ARGB8888:
if (t->image[tObj->BaseLevel].internalFormat == GL_RGB)
t->texMem.size = t->totalSize;
t->maxLevel = i - 1;
t->dirty = VIA_UPLOAD_TEX0 | VIA_UPLOAD_TEX1;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "log2Width = %d\n", log2Width);
fprintf(stderr, "log2Height = %d\n", log2Height);
fprintf(stderr, "actual level = %d\n", t->actualLevel);
fprintf(stderr, "numlevel = %d\n", numLevels);
}
-#endif
{
w = log2Width;
texBase = (GLuint)vmesa->agpBase + t->texMem.offset + t->image[i].offset;
else
texBase = t->texMem.offset + t->image[i].offset;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "texmem offset = %x\n", t->texMem.offset);
fprintf(stderr, "mipmap%d addr = %x\n", i, t->image[i].offset);
fprintf(stderr, "mipmap%d size = %d, h = %d, w = %d\n", i, (*texSize)[h][w], h, w);
fprintf(stderr, "texBase%d = %x\n", i, texBase);
}
-#endif
t->regTexBaseAndPitch[i].baseL = ((HC_SubA_HTXnL0BasL + i) << 24) | (texBase & 0xFFFFFF);
if (p < 5) {
t->regTexHeightLog2[l] = ((l + HC_SubA_HTXnL0_5HE) << 24 | heightExp);
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/* ================================================================
const struct gl_texture_object *tObj = texUnit->_Current;
const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format;
GLuint color_combine, alpha_combine;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
switch (texUnit->EnvMode) {
case GL_REPLACE:
if (format == GL_ALPHA) {
default:
return;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaUpdateTexUnit(GLcontext *ctx, GLuint unit)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (texUnit->_ReallyEnabled) {
struct gl_texture_object *tObj = texUnit->_Current;
viaTextureObjectPtr t = (viaTextureObjectPtr)tObj->DriverData;
vmesa->dirty &= ~(VIA_UPLOAD_TEX0 << unit);
VIA_STATECHANGE(vmesa, VIA_UPLOAD_CTX);
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaUpdateTextureState(GLcontext *ctx)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
FALLBACK(vmesa, VIA_FALLBACK_TEXTURE, GL_FALSE);
viaUpdateTexUnit(ctx, 0);
viaUpdateTexUnit(ctx, 1);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint *vb = viaCheckDma(vmesa, 3 * 4 * vertsize);
int j;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
COPY_DWORDS(j, vb, vertsize, v2);
vmesa->dmaLow += 3 * 4 * vertsize;
vmesa->primitiveRendered = GL_TRUE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint vertsize = vmesa->vertexSize;
GLuint *vb = viaCheckDma(vmesa, 6 * 4 * vertsize);
int j;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
COPY_DWORDS(j, vb, vertsize, v3);
vmesa->dmaLow += 6 * 4 * vertsize;
vmesa->primitiveRendered = GL_TRUE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/*GLuint *vb = viaCheckDma(vmesa, 2 * 4 * vertsize);*/
GLuint *vb = viaCheckDma(vmesa, 4 * vertsize);
int j;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
COPY_DWORDS(j, vb, vertsize, v0);
vmesa->dmaLow += 4 * vertsize;
vmesa->primitiveRendered = GL_TRUE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint vertsize = vmesa->vertexSize;
GLuint *vb = viaCheckDma(vmesa, 2 * 4 * vertsize);
int j;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
COPY_DWORDS(j, vb, vertsize, v1);
vmesa->dmaLow += 2 * 4 * vertsize;
vmesa->primitiveRendered = GL_TRUE;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
PRIM_BEGIN|PRIM_END);
VB->Elts = tmp;
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaRenderClippedLine(GLcontext *ctx, GLuint ii, GLuint jj)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
vmesa->primitiveRendered = GL_TRUE;
tnl->Driver.Render.Line(ctx, ii, jj);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaFastRenderClippedPoly(GLcontext *ctx, const GLuint *elts,
GLuint *temp1;
GLuint *temp2;
int i,j;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
temp1 = (GLuint *)V(elts[i - 1]);
COPY_DWORDS(j, vb, vertsize, start);
temp2 = (GLuint *)V(elts[i]);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "start = %d - x = %f, y = %f, z = %f, w = %f, u = %f, v = %f\n", elts[0], *(GLfloat *)&start[0], *(GLfloat *)&start[1], *(GLfloat *)&start[2], *(GLfloat *)&start[3], *(GLfloat *)&start[6], *(GLfloat *)&start[7]);
if (VIA_DEBUG) fprintf(stderr, "%d - x = %f, y = %f, z = %f, w = %f, u = %f, v = %f\n", elts[i - 1], *(GLfloat *)&temp1[0], *(GLfloat *)&temp1[1], *(GLfloat *)&temp1[2], *(GLfloat *)&temp1[3], *(GLfloat *)&temp1[6], *(GLfloat *)&temp1[7]);
if (VIA_DEBUG) fprintf(stderr, "%d - x = %f, y = %f, z = %f, w = %f, u = %f, v = %f\n", elts[i], *(GLfloat *)&temp2[0], *(GLfloat *)&temp2[1], *(GLfloat *)&temp2[2], *(GLfloat *)&temp2[3], *(GLfloat *)&temp2[6], *(GLfloat *)&temp2[7]);
-#endif
}
vmesa->dmaLow += (n - 2) * 3 * 4 * vertsize;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/**********************************************************************/
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLuint flags = ctx->_TriangleCaps;
GLuint index = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "_TriangleCaps = %x\n", flags);
-#endif
if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) {
if (flags & ANY_RASTER_FLAGS) {
if (flags & DD_TRI_LIGHT_TWOSIDE) index |= VIA_TWOSIDE_BIT;
index |= VIA_FALLBACK_BIT;
}
}
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "index = %x\n", index);
fprintf(stderr, "renderIndex = %x\n", vmesa->renderIndex);
}
-#endif
if (vmesa->renderIndex != index) {
vmesa->renderIndex = index;
tnl->Driver.Render.Points = rast_tab[index].points;
tnl->Driver.Render.Line = rast_tab[index].line;
tnl->Driver.Render.Triangle = rast_tab[index].triangle;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "tnl->Driver.Render.xxx = rast_tab[index].xxx = %x\n", (unsigned int)tnl->Driver.Render.Triangle);
-#endif
tnl->Driver.Render.Quad = rast_tab[index].quad;
if (index == 0) {
tnl->Driver.Render.ClippedPolygon = viaRenderClippedPoly;
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static const GLenum reducedPrim[GL_POLYGON + 1] = {
GLuint *vb = viaCheckDma(vmesa, 0x110);
GLuint i = 0;
GLuint j = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
/* We haven't support 16bit depth yet */
format = HC_HZWBFM_16;
/*format = HC_HZWBFM_32;*/
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "z format = 16\n");
-#endif
}
else {
format = HC_HZWBFM_32;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "z format = 32\n");
-#endif
}
*vb++ = (HC_ParaType_Tex << 16) | (HC_SubType_TexGeneral << 24);
if (ctx->Texture._EnabledUnits > 1) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "multi texture\n");
-#endif
nDummyValue = (HC_SubA_HTXSMD << 24) | (1 << 3);
if (t && t->needClearCache) {
}
}
else {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "single texture\n");
-#endif
nDummyValue = (HC_SubA_HTXSMD << 24) | 0;
if (t && t->needClearCache) {
viaTextureObjectPtr t = (viaTextureObjectPtr)texObj->DriverData;
GLuint numLevels = t->lastLevel - t->firstLevel + 1;
GLuint nDummyValue = 0;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "texture0 enabled\n");
fprintf(stderr, "texture level %d\n", t->actualLevel);
}
-#endif
if (numLevels == 8) {
nDummyValue = t->regTexFM;
*vb++ = HC_HEADER2;
viaTextureObjectPtr t = (viaTextureObjectPtr)texObj->DriverData;
GLuint numLevels = t->lastLevel - t->firstLevel + 1;
GLuint nDummyValue = 0;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "texture1 enabled\n");
fprintf(stderr, "texture level %d\n", t->actualLevel);
}
-#endif
if (numLevels == 8) {
nDummyValue = t->regTexFM;
*vb++ = HC_HEADER2;
vmesa->dmaLow += (i << 2);
vmesa->dirty = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint *vb = viaCheckDma(vmesa, 0x110);
GLuint i = 0;
-#ifdef DEBUG
if( VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
vmesa->dmaLow += (i << 2);
vmesa->dirty = 0;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
/**********************************************************************/
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLuint rprim = reducedPrim[prim];
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
vmesa->renderPrimitive = prim;
viaRasterPrimitive(ctx, rprim, rprim);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaRunPipeline(GLcontext *ctx)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "newState = %x\n", vmesa->newState);
-#endif
if (vmesa->newState) {
if (vmesa->newState & _NEW_TEXTURE)
emit_partial_state(vmesa);
_tnl_run_pipeline(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaRenderStart(GLcontext *ctx)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
/* Check for projective texturing. Make sure all texcoord
* pointers point to something. (fix in mesa?)
*/
viaCheckTexSizes(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void viaRenderFinish(GLcontext *ctx)
{
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (VIA_CONTEXT(ctx)->renderIndex & VIA_FALLBACK_BIT)
_swrast_flush(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLuint *vb = viaCheckDma(vmesa, 32);
GLuint regCmdB;
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "%s - in\n", __FUNCTION__);
fprintf(stderr, "hwprim = %x\n", hwprim);
}
-#endif
/*=* [DBG] exy : fix wireframe + clipping error *=*/
if (((rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)))) {
hwprim = GL_LINES;
if (RasterCounter > 0) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "enter twice:%d\n",RasterCounter);
-#endif
RasterCounter++;
return;
}
switch (hwprim) {
case GL_POINTS:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Points\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Point | HC_HVCycle_Full;
if (ctx->Light.ShadeModel == GL_FLAT)
vmesa->regCmdA_End |= HC_HShading_FlatA;
break;
case GL_LINES:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Lines\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Line | HC_HVCycle_Full;
if (ctx->Light.ShadeModel == GL_FLAT)
vmesa->regCmdA_End |= HC_HShading_FlatB;
break;
case GL_LINE_LOOP:
case GL_LINE_STRIP:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Line Loop / Line Strip\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Line | HC_HVCycle_AFP |
HC_HVCycle_AB | HC_HVCycle_NewB;
regCmdB |= HC_HVCycle_AB | HC_HVCycle_NewB | HC_HLPrst_MASK;
vmesa->regCmdA_End |= HC_HShading_FlatB;
break;
case GL_TRIANGLES:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Triangles\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Tri | HC_HVCycle_Full;
if (ctx->Light.ShadeModel == GL_FLAT)
vmesa->regCmdA_End |= HC_HShading_FlatC;
break;
case GL_TRIANGLE_STRIP:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Triangle Strip\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Tri | HC_HVCycle_AFP |
HC_HVCycle_AC | HC_HVCycle_BB | HC_HVCycle_NewC;
regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
vmesa->regCmdA_End |= HC_HShading_FlatB;
break;
case GL_TRIANGLE_FAN:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Triangle Fan\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Tri | HC_HVCycle_AFP |
HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
vmesa->regCmdA_End |= HC_HShading_FlatC;
break;
case GL_QUADS:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "No HW Quads\n");
-#endif
return;
case GL_QUAD_STRIP:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "No HW Quad Strip\n");
-#endif
return;
case GL_POLYGON:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Polygon\n");
-#endif
vmesa->regCmdA_End = vmesa->regCmdA | HC_HPMType_Tri | HC_HVCycle_AFP |
HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
regCmdB |= HC_HVCycle_AA | HC_HVCycle_BC | HC_HVCycle_NewC;
vmesa->regCmdA_End |= HC_HShading_FlatC;
break;
default:
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "Unknow\n");
-#endif
return;
}
vmesa->reducedPrimitive = rprim;
vmesa->hwPrimitive = rprim;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaRasterPrimitiveFinish(GLcontext *ctx)
{
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "primitiveRendered = %x\n", vmesa->primitiveRendered);
-#endif
if (RasterCounter > 1) {
RasterCounter--;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "finish enter twice: %d\n",RasterCounter);
-#endif
return;
}
RasterCounter = 0;
}
#endif
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLcontext *ctx = vmesa->glCtx;
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint oldfallback = vmesa->Fallback;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s old %x bit %x mode %d\n", __FUNCTION__,
vmesa->Fallback, bit, mode);
-#endif
if (mode) {
vmesa->Fallback |= bit;
if (oldfallback == 0) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "ENTER FALLBACK\n");
-#endif
VIA_FIREVERTICES(vmesa);
_swsetup_Wakeup(ctx);
vmesa->renderIndex = ~0;
else {
vmesa->Fallback &= ~bit;
if (oldfallback == bit) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "LEAVE FALLBACK\n");
-#endif
tnl->Driver.Render.Start = viaRenderStart;
tnl->Driver.Render.PrimitiveNotify = viaRenderPrimitive;
tnl->Driver.Render.Finish = viaRenderFinish;
}
void viaPrintSetupFlags(char *msg, GLuint flags) {
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n",
msg,
(int)flags,
(flags & VIA_FOG_BIT) ? " fog," : "",
(flags & VIA_TEX0_BIT) ? " tex-0," : "",
(flags & VIA_TEX1_BIT) ? " tex-1," : "");
-#endif
}
void viaCheckTexSizes(GLcontext *ctx) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
viaContextPtr vmesa = VIA_CONTEXT(ctx);
-#ifdef DEBUG
if (VIA_DEBUG) {
fprintf(stderr, "%s - in\n", __FUNCTION__);
fprintf(stderr, "setupIndex = %x\n", vmesa->setupIndex);
}
-#endif
if (!setup_tab[vmesa->setupIndex].check_tex_sizes(ctx)) {
/* Invalidate stored verts
*/
tnl->Driver.Render.CopyPV = setup_tab[vmesa->setupIndex].copyPv;
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaBuildVertices(GLcontext *ctx,
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLubyte *v = ((GLubyte *)vmesa->verts + (start << vmesa->vertexStrideShift));
GLuint stride = 1 << vmesa->vertexStrideShift;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
newinputs |= vmesa->setupNewInputs;
vmesa->setupNewInputs = 0;
if (!newinputs)
setup_tab[ind].emit(ctx, start, count, v, stride);
}
}
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaChooseVertexState(GLcontext *ctx) {
TNLcontext *tnl = TNL_CONTEXT(ctx);
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLuint ind = VIA_XYZW_BIT | VIA_RGBA_BIT;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
ind |= VIA_SPEC_BIT;
ind |= VIA_TEX0_BIT;
vmesa->setupIndex = ind;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "setupIndex = %x\n", vmesa->setupIndex);
-#endif
if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
tnl->Driver.Render.Interp = via_interp_extras;
vmesa->vertexSize = setup_tab[ind].vertexSize;
vmesa->vertexStrideShift = setup_tab[ind].vertexStrideShift;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
viaContextPtr vmesa = VIA_CONTEXT(ctx);
GLuint vertexSize = vmesa->vertexSize * 4;
GLuint *dest = viaCheckDma(vmesa, (count - start) * vertexSize);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
if (VIA_DEBUG) fprintf(stderr, "choose setup_tab[0x%x]\n", vmesa->setupIndex);
-#endif
setup_tab[vmesa->setupIndex].emit(ctx, start, count, dest, vertexSize);
vmesa->dmaLow += (count - start) * vertexSize;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
void viaInitVB(GLcontext *ctx) {
tnl_interp_func interp = tnl->Driver.Render.Interp;
GLfloat (*coord)[4] = VB->ClipPtr->data;
GLuint ii = i, jj = j, p;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
tnl->Driver.Render.CopyPV(ctx, jj, j);
tnl->Driver.Render.ClippedLine(ctx, ii, jj);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
GLuint p;
GLubyte *clipmask = VB->ClipMask;
GLuint n = 4;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
tnl->Driver.Render.ClippedPolygon(ctx, inlist, n);
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
#undef W
GLuint j;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
RENDER_LINE(ELT(j - 1), ELT(j));
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_line_loop)(GLcontext *ctx,
GLuint i;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_triangles)(GLcontext *ctx,
GLuint j;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_tri_strip)(GLcontext *ctx,
GLuint j;
GLuint parity = 0;
LOCAL_VARS;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_tri_fan)(GLcontext *ctx,
GLuint j;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_poly)(GLcontext *ctx,
GLuint j = start + 2;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_quads)(GLcontext *ctx,
GLuint j;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_quad_strip)(GLcontext *ctx,
GLuint j;
LOCAL_VARS;
(void)flags;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__);
-#endif
#ifdef PERFORMANCE_MEASURE
if (VIA_PERFORMANCE) P_M;
#endif
}
}
POSTFIX;
-#ifdef DEBUG
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);
-#endif
}
static void TAG(render_noop)(GLcontext *ctx,