summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i810
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-10-28 21:24:11 -0600
committerBrian Paul <brianp@vmware.com>2009-10-28 21:24:11 -0600
commit1f196b786d6bd0c6a5dbdc638574ff716cc3d4de (patch)
tree5ae2753b99070f8b35c51576bd39e52df63879d6 /src/mesa/drivers/dri/i810
parent0ea575d721821262a862ceef010db9b1a8b4a6d9 (diff)
parent086f9fc0e2aef27f54eda87c733685500555bf20 (diff)
Merge branch 'texformat-rework'
Conflicts: src/mesa/drivers/dri/radeon/radeon_fbo.c src/mesa/drivers/dri/s3v/s3v_tex.c src/mesa/drivers/dri/s3v/s3v_xmesa.c src/mesa/drivers/dri/trident/trident_context.c src/mesa/main/debug.c src/mesa/main/mipmap.c src/mesa/main/texformat.c src/mesa/main/texgetimage.c
Diffstat (limited to 'src/mesa/drivers/dri/i810')
-rw-r--r--src/mesa/drivers/dri/i810/i810screen.c6
-rw-r--r--src/mesa/drivers/dri/i810/i810tex.c19
-rw-r--r--src/mesa/drivers/dri/i810/i810texmem.c60
-rw-r--r--src/mesa/drivers/dri/i810/i810texstate.c3
4 files changed, 44 insertions, 44 deletions
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c
index a9ee61132e..2f6b8631ff 100644
--- a/src/mesa/drivers/dri/i810/i810screen.c
+++ b/src/mesa/drivers/dri/i810/i810screen.c
@@ -289,7 +289,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
driScrnPriv->pFB,
screen->cpp,
/*screen->frontOffset*/0, screen->backPitch,
@@ -300,7 +300,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
screen->back.map,
screen->cpp,
screen->backOffset, screen->backPitch,
@@ -311,7 +311,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ = driNewRenderbuffer(MESA_FORMAT_Z16,
screen->depth.map,
screen->cpp,
screen->depthOffset, screen->backPitch,
diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c
index cd6e1a8e6e..2f6978f5aa 100644
--- a/src/mesa/drivers/dri/i810/i810tex.c
+++ b/src/mesa/drivers/dri/i810/i810tex.c
@@ -28,7 +28,6 @@
#include "main/simple_list.h"
#include "main/enums.h"
#include "main/texstore.h"
-#include "main/texformat.h"
#include "main/teximage.h"
#include "main/texobj.h"
#include "main/colormac.h"
@@ -440,7 +439,7 @@ static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
* The i810 only supports 5 texture modes that are useful to Mesa. That
* makes this routine pretty simple.
*/
-static const struct gl_texture_format *
+static gl_format
i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
@@ -458,9 +457,9 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
if ( ((format == GL_BGRA) && (type == GL_UNSIGNED_SHORT_1_5_5_5_REV))
|| ((format == GL_RGBA) && (type == GL_UNSIGNED_SHORT_5_5_5_1))
|| (internalFormat == GL_RGB5_A1) ) {
- return &_mesa_texformat_argb1555;
+ return MESA_FORMAT_ARGB1555;
}
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
case 3:
case GL_RGB:
@@ -472,7 +471,7 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return &_mesa_texformat_rgb565;
+ return MESA_FORMAT_RGB565;
case GL_ALPHA:
case GL_ALPHA4:
@@ -502,21 +501,21 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_al88;
+ return MESA_FORMAT_AL88;
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
+ return MESA_FORMAT_YCBCR;
else
- return &_mesa_texformat_ycbcr_rev;
+ return MESA_FORMAT_YCBCR_REV;
default:
fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__);
- return NULL;
+ return MESA_FORMAT_NONE;
}
- return NULL; /* never get here */
+ return MESA_FORMAT_NONE; /* never get here */
}
/**
diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c
index 5ad66dbf5c..d93afbf9ef 100644
--- a/src/mesa/drivers/dri/i810/i810texmem.c
+++ b/src/mesa/drivers/dri/i810/i810texmem.c
@@ -30,7 +30,6 @@
#include "main/enums.h"
#include "main/colormac.h"
#include "main/mm.h"
-#include "main/texformat.h"
#include "i810screen.h"
#include "i810_dri.h"
@@ -92,44 +91,47 @@ static void i810UploadTexLevel( i810ContextPtr imesa,
{
const struct gl_texture_image *image = t->image[hwlevel].image;
int j;
+ GLuint texelBytes;
if (!image || !image->Data)
return;
- if (image->Width * image->TexFormat->TexelBytes == t->Pitch) {
+ texelBytes = _mesa_get_format_bytes(image->TexFormat);
+
+ if (image->Width * texelBytes == t->Pitch) {
GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
GLubyte *src = (GLubyte *)image->Data;
memcpy( dst, src, t->Pitch * image->Height );
}
- else switch (image->TexFormat->TexelBytes) {
- case 1:
- {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
- __memcpy(dst, src, image->Width );
- src += image->Width;
- }
+ else {
+ switch (texelBytes) {
+ case 1:
+ {
+ GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
+ GLubyte *src = (GLubyte *)image->Data;
+
+ for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
+ __memcpy(dst, src, image->Width );
+ src += image->Width;
+ }
+ }
+ break;
+ case 2:
+ {
+ GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset);
+ GLushort *src = (GLushort *)image->Data;
+
+ for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) {
+ __memcpy(dst, src, image->Width * 2 );
+ src += image->Width;
+ }
+ }
+ break;
+ default:
+ fprintf(stderr, "%s: Not supported texel size %d\n",
+ __FUNCTION__, texelBytes);
}
- break;
-
- case 2:
- {
- GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset);
- GLushort *src = (GLushort *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) {
- __memcpy(dst, src, image->Width * 2 );
- src += image->Width;
- }
- }
- break;
-
- default:
- fprintf(stderr, "%s: Not supported texel size %d\n",
- __FUNCTION__, image->TexFormat->TexelBytes);
}
}
diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c
index 0e09f54c41..bff28c11c8 100644
--- a/src/mesa/drivers/dri/i810/i810texstate.c
+++ b/src/mesa/drivers/dri/i810/i810texstate.c
@@ -25,7 +25,6 @@
#include "main/glheader.h"
#include "main/macros.h"
#include "main/mtypes.h"
-#include "main/texformat.h"
#include "main/simple_list.h"
#include "main/enums.h"
#include "main/mm.h"
@@ -53,7 +52,7 @@ static void i810SetTexImages( i810ContextPtr imesa,
/* fprintf(stderr, "%s\n", __FUNCTION__); */
t->texelBytes = 2;
- switch (baseImage->TexFormat->MesaFormat) {
+ switch (baseImage->TexFormat) {
case MESA_FORMAT_ARGB1555:
textureFormat = MI1_FMT_16BPP | MI1_PF_16BPP_ARGB1555;
break;