summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeithw <keithw>2000-02-12 09:02:43 +0000
committerkeithw <keithw>2000-02-12 09:02:43 +0000
commitc14652c9e95f452a5a73becb4fd921b6f360c390 (patch)
tree208edeb0d91a4d1baf21dbdabc3e4fec388446bd
parent2abc8492d4b482a78896a86d681dc55f36b18c12 (diff)
Quake 3 works, small texture errors.
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c3
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgaioctl.c8
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgalib.h3
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgastate.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/mga/mgatex.c16
5 files changed, 17 insertions, 19 deletions
diff --git a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
index 11e02c770..9b5b0823c 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mga_xmesa.c
@@ -289,9 +289,6 @@ XMesaContext XMesaCreateContext(XMesaVisual v, XMesaContext share_list,
mmesa->glBuffer=gl_create_framebuffer(v->gl_visual);
-
- mmesa->needClip=1;
-
mmesa->texHeap = mmInit( 0, mgaScreen->textureSize );
/* Utah stuff
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
index 1918ceae5..3fbe067b0 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgaioctl.c
@@ -32,10 +32,10 @@ static void mga_iload_dma_ioctl(mgaContextPtr mmesa,
iload.pitch = x2 - x1;
iload.texture.x1 = x1;
iload.texture.y1 = y1;
- iload.texture.y2 = x2;
- iload.texture.x2 = y2;
+ iload.texture.x2 = x2;
+ iload.texture.y2 = y2;
- if (MGA_DEBUG&MGA_DEBUG_VERBOSE_IOCTL)
+/* if (MGA_DEBUG&MGA_DEBUG_VERBOSE_IOCTL) */
fprintf(stderr, "DRM_IOCTL_MGA_ILOAD idx %d dst %x maccess %x %d,%d-%d,%d\n",
iload.idx, iload.destOrg, iload.mAccess,
iload.texture.x1,
@@ -50,7 +50,7 @@ static void mga_iload_dma_ioctl(mgaContextPtr mmesa,
}
mmesa->iload_buffer = 0;
- if (MGA_DEBUG&MGA_DEBUG_VERBOSE_IOCTL)
+/* if (MGA_DEBUG&MGA_DEBUG_VERBOSE_IOCTL) */
fprintf(stderr, "finished iload dma put\n");
}
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgalib.h b/xc/lib/GL/mesa/src/drv/mga/mgalib.h
index 2e7a0aefa..825143cf5 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgalib.h
+++ b/xc/lib/GL/mesa/src/drv/mga/mgalib.h
@@ -112,8 +112,6 @@ struct mga_context_t {
mgaUI32 tmu_source[2];
mgaUI32 tex_dest[2];
-
-
/* bookkeeping for textureing */
struct mga_texture_object_s TexObjList;
struct mga_texture_object_s SwappedOut;
@@ -156,7 +154,6 @@ struct mga_context_t {
GLframebuffer *glBuffer;
memHeap_t *texHeap;
- GLuint needClip;
GLuint warp_pipe;
/* These refer to the current draw (front vs. back) buffer:
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
index c30909626..8889e8d66 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c
@@ -506,20 +506,18 @@ void mgaEmitHwStateLocked( mgaContextPtr mmesa )
mgaUploadTexImages(mmesa, mmesa->CurrentTexObj[1]);
if (mmesa->dirty & MGA_UPLOAD_CTX) {
-
- fprintf(stderr, "Emitting DSTORG %x in mgaEmitHwStateLocked\n",
- mmesa->Setup[MGA_CTXREG_DSTORG]);
-
memcpy( mmesa->sarea->ContextState,
mmesa->Setup,
sizeof(mmesa->Setup));
if (mmesa->CurrentTexObj[0])
+/* && (mmesa->setupindex & MGA_TEX0_BIT)) */
memcpy(mmesa->sarea->TexState[0],
mmesa->CurrentTexObj[0]->Setup,
sizeof(mmesa->sarea->TexState[0]));
if (mmesa->CurrentTexObj[1])
+/* && (mmesa->setupindex & MGA_TEX1_BIT)) */
memcpy(mmesa->sarea->TexState[1],
mmesa->CurrentTexObj[1]->Setup,
sizeof(mmesa->sarea->TexState[1]));
diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.c b/xc/lib/GL/mesa/src/drv/mga/mgatex.c
index 1c36b54e8..4fc5145c7 100644
--- a/xc/lib/GL/mesa/src/drv/mga/mgatex.c
+++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.c
@@ -363,7 +363,6 @@ static void mgaUploadSubImageLocked( mgaContextPtr mmesa,
if ( width < texelsPerDword ) {
width = texelsPerDword;
}
- return;
} else {
/* pad the size out to dwords. The image is a pointer
to the entire image, so we can safely reference
@@ -397,14 +396,19 @@ static void mgaUploadSubImageLocked( mgaContextPtr mmesa,
mgaglx.c_textureSwaps += ( dwords << 2 );
- /* fill in the secondary buffer with properly converted texels
- from the mesa buffer */
+
#if 0
+ /* Fill in the secondary buffer with properly converted texels
+ * from the mesa buffer.
+ */
mgaGetILoadBuffer( mmesa );
mgaConvertTexture( (mgaUI32 *)mmesa->iload_buffer->address,
texelBytes, image, x, y, width, height );
mgaFireILoadLocked( mmesa, x, y, width, height, dstorg, texelMaccess );
-#else
+#else
+ /* This works, but needs some additional synchronization with
+ * the dma stream.
+ */
mgaConvertTexture( (mgaUI32 *)(mmesa->mgaScreen->sPriv->pFB +
dstorg + y * width * 4/texelsPerDword),
texelBytes, image, x, y, width, height );
@@ -636,7 +640,9 @@ int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t )
mgaDestroyTexObj( mmesa, mmesa->TexObjList.prev );
}
- ofs = t->MemBlock->ofs + mmesa->mgaScreen->textureOffset;
+ ofs = t->MemBlock->ofs
+ + mmesa->mgaScreen->textureOffset
+ ;
t->Setup[MGA_TEXREG_ORG] = ofs;
t->Setup[MGA_TEXREG_ORG1] = ofs + t->offsets[1];