drawable);
}
- draw_buffer->drawXoff = (GLuint)(((drawable->x * bytePerPixel) & 0x1f) /
- bytePerPixel);
- draw_buffer->drawX = drawable->x - draw_buffer->drawXoff;
+ draw_buffer->drawX = drawable->x;
draw_buffer->drawY = drawable->y;
draw_buffer->drawW = drawable->w;
draw_buffer->drawH = drawable->h;
readable);
}
- read_buffer->drawXoff = (GLuint)(((readable->x * bytePerPixel) & 0x1f) /
- bytePerPixel);
- read_buffer->drawX = readable->x - read_buffer->drawXoff;
+ read_buffer->drawX = readable->x;
read_buffer->drawY = readable->y;
read_buffer->drawW = readable->w;
read_buffer->drawH = readable->h;
draw_buffer->drawX * bytePerPixel);
vmesa->front.origMap = (vmesa->front.map +
- draw_buffer->drawY * vmesa->front.pitch +
- draw_buffer->drawX * bytePerPixel);
+ draw_buffer->drawY * vmesa->front.pitch +
+ draw_buffer->drawX * bytePerPixel);
+
+ vmesa->back.orig = (vmesa->back.offset +
+ draw_buffer->drawY * vmesa->back.pitch +
+ draw_buffer->drawX * bytePerPixel);
- vmesa->back.orig = vmesa->back.offset;
- vmesa->depth.orig = vmesa->depth.offset;
- vmesa->back.origMap = vmesa->back.map;
- vmesa->depth.origMap = vmesa->depth.map;
+ vmesa->back.origMap = (vmesa->back.map +
+ draw_buffer->drawY * vmesa->back.pitch +
+ draw_buffer->drawX * bytePerPixel);
+
+ vmesa->depth.orig = (vmesa->depth.offset +
+ draw_buffer->drawY * vmesa->depth.pitch +
+ draw_buffer->drawX * bytePerPixel);
+
+ vmesa->depth.origMap = (vmesa->depth.map +
+ draw_buffer->drawY * vmesa->depth.pitch +
+ draw_buffer->drawX * bytePerPixel);
viaCalcViewport(vmesa->glCtx);
}
int drawW;
int drawH;
- int drawXoff; /* drawX is 32byte aligned - this is
- * the delta to the real origin, in
- * pixel units.
- */
-
__DRIdrawablePrivate *dPriv;
};
int w = pbox[i].x2 - pbox[i].x1;
int h = pbox[i].y2 - pbox[i].y1;
- int offset = (buffer->orig +
+ int offset = (buffer->offset +
y * buffer->pitch +
x * bytePerPixel);
/* flip top to bottom */
cy = dPriv->h - cy - ch;
- cx += vrb->drawX + vrb->drawXoff;
+ cx += vrb->drawX;
cy += vrb->drawY;
if (!all) {
GLint w = b->x2 - b->x1;
GLint h = b->y2 - b->y1;
- GLuint src = back->orig + y * back->pitch + x * bytePerPixel;
- GLuint dest = front->orig + y * front->pitch + x * bytePerPixel;
+ GLuint src = back->offset + y * back->pitch + x * bytePerPixel;
+ GLuint dest = front->offset + y * front->pitch + x * bytePerPixel;
viaBlit(vmesa,
bytePerPixel << 3,
: HC_HDBFM_RGB565);
GLuint pitch = buffer->pitch;
- GLuint offset = buffer->orig;
+ GLuint offset = buffer->offset;
if (0)
fprintf(stderr, "emit cliprect for box %d,%d %d,%d\n",
vb[4] = (HC_SubA_HDBBasL << 24) | (offset & 0xFFFFFF);
vb[5] = (HC_SubA_HDBBasH << 24) | ((offset & 0xFF000000) >> 24);
- vb[6] = (HC_SubA_HSPXYOS << 24) | ((31 - buffer->drawXoff) << HC_HSPXOS_SHIFT);
+ vb[6] = (HC_SubA_HSPXYOS << 24);
vb[7] = (HC_SubA_HDBFM << 24) | HC_HDBLoc_Local | format | pitch;
}
struct via_renderbuffer *const vrb =
(struct via_renderbuffer *) dPriv->driverPrivate;
-
for (i = 0; i < vmesa->numClipRects; i++) {
drm_clip_rect_t b;
- b.x1 = pbox[i].x1 - (vrb->drawX + vrb->drawXoff);
- b.x2 = pbox[i].x2 - (vrb->drawX + vrb->drawXoff);
- b.y1 = pbox[i].y1 - vrb->drawY;
- b.y2 = pbox[i].y2 - vrb->drawY;
+ b.x1 = pbox[i].x1;
+ b.x2 = pbox[i].x2;
+ b.y1 = pbox[i].y1;
+ b.y2 = pbox[i].y2;
if (vmesa->scissor &&
!intersect_rect(&b, &b, &vmesa->scissorRect))
continue;
- b.x1 += vrb->drawXoff;
- b.x2 += vrb->drawXoff;
-
via_emit_cliprect(vmesa, &b);
if (fire_buffer(vmesa) != 0) {
GLuint pitch = vrb->pitch; \
GLuint height = dPriv->h; \
GLint p = 0; \
- char *buf = (char *)(vrb->origMap + vrb->drawXoff * vrb->bpp); \
+ char *buf = (char *)(vrb->origMap); \
(void) p;
/* ================================================================
__DRIdrawablePrivate *dPriv = vrb->dPriv; \
GLuint depth_pitch = vrb->pitch; \
GLuint height = dPriv->h; \
- char *buf = (char *)(vrb->map + (vrb->drawXoff * vrb->bpp/8))
+ char *buf = (char *)(vrb->map)
#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS
OUT_RING( HC_HEADER2 );
OUT_RING( (HC_ParaType_NotTex << 16) );
- OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32- vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
- OUT_RING( (HC_SubA_HSPXYOS << 24) |
- (((32 - vrb->drawXoff) & 0x1f) << HC_HSPXOS_SHIFT));
+ OUT_RING( (HC_SubA_HSPXYOS << 24) );
+ OUT_RING( (HC_SubA_HSPXYOS << 24) );
ADVANCE_RING();
}
}
-/* =============================================================
- */
-
-/* Using drawXoff like this is incorrect outside of locked regions.
- * This hardware just isn't capable of private back buffers without
+/* This hardware just isn't capable of private back buffers without
* glitches and/or a hefty locking scheme.
*/
void viaCalcViewport(GLcontext *ctx)
const GLfloat *v = ctx->Viewport._WindowMap.m;
GLfloat *m = vmesa->ViewportMatrix.m;
- /* See also via_translate_vertex.
- */
m[MAT_SX] = v[MAT_SX];
- m[MAT_TX] = v[MAT_TX] + SUBPIXEL_X + vrb->drawXoff;
+ m[MAT_TX] = v[MAT_TX] + vrb->drawX + SUBPIXEL_X;
m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = - v[MAT_TY] + dPriv->h + SUBPIXEL_Y;
+ m[MAT_TY] = - v[MAT_TY] + vrb->drawY + SUBPIXEL_Y + vrb->drawH;
m[MAT_SZ] = v[MAT_SZ] * (1.0 / vmesa->depth_max);
m[MAT_TZ] = v[MAT_TZ] * (1.0 / vmesa->depth_max);
}