diff options
author | Keith Whitwell <[email protected]> | 2004-01-27 16:34:45 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2004-01-27 16:34:45 +0000 |
commit | 18fa367ac6e035341f5eb86ecc4231124b2921e3 (patch) | |
tree | e0902aabb61e55a785e8742aa809f53dcf5fa16c /src/mesa/swrast/s_triangle.c | |
parent | 740f7de085f143b2bb1fe623d68c5efb3560e1a7 (diff) |
Consolidate texObj->Pos/Neg/X/Y/Z and texObj->Image into a single
array, texObj->Image[face][level].
Diffstat (limited to 'src/mesa/swrast/s_triangle.c')
-rw-r--r-- | src/mesa/swrast/s_triangle.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 3e429664670..ebbba34af5c 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -154,12 +154,12 @@ GLboolean _swrast_culltriangle( GLcontext *ctx, SWcontext *swrast = SWRAST_CONTEXT(ctx); \ struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \ const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[b]->Height; \ - const GLint twidth_log2 = obj->Image[b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \ - const GLint smask = obj->Image[b]->Width - 1; \ - const GLint tmask = obj->Image[b]->Height - 1; \ + const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ + const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ + const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ + const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ + const GLint smask = obj->Image[0][b]->Width - 1; \ + const GLint tmask = obj->Image[0][b]->Height - 1; \ if (!texture) { \ /* this shouldn't happen */ \ return; \ @@ -205,12 +205,12 @@ GLboolean _swrast_culltriangle( GLcontext *ctx, SWcontext *swrast = SWRAST_CONTEXT(ctx); \ struct gl_texture_object *obj = ctx->Texture.Unit[0].Current2D; \ const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[b]->Height; \ - const GLint twidth_log2 = obj->Image[b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[b]->Data; \ - const GLint smask = obj->Image[b]->Width - 1; \ - const GLint tmask = obj->Image[b]->Height - 1; \ + const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ + const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ + const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ + const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ + const GLint smask = obj->Image[0][b]->Width - 1; \ + const GLint tmask = obj->Image[0][b]->Height - 1; \ if (!texture) { \ /* this shouldn't happen */ \ return; \ @@ -538,13 +538,13 @@ affine_span(GLcontext *ctx, struct sw_span *span, struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ struct gl_texture_object *obj = unit->Current2D; \ const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[b]->Height; \ - info.texture = (const GLchan *) obj->Image[b]->Data; \ - info.twidth_log2 = obj->Image[b]->WidthLog2; \ - info.smask = obj->Image[b]->Width - 1; \ - info.tmask = obj->Image[b]->Height - 1; \ - info.format = obj->Image[b]->Format; \ + const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ + const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ + info.texture = (const GLchan *) obj->Image[0][b]->Data; \ + info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ + info.smask = obj->Image[0][b]->Width - 1; \ + info.tmask = obj->Image[0][b]->Height - 1; \ + info.format = obj->Image[0][b]->Format; \ info.filter = obj->MinFilter; \ info.envmode = unit->EnvMode; \ span.arrayMask |= SPAN_RGBA; \ @@ -565,22 +565,22 @@ affine_span(GLcontext *ctx, struct sw_span *span, case GL_ALPHA: \ case GL_LUMINANCE: \ case GL_INTENSITY: \ - info.tbytesline = obj->Image[b]->Width; \ + info.tbytesline = obj->Image[0][b]->Width; \ break; \ case GL_LUMINANCE_ALPHA: \ - info.tbytesline = obj->Image[b]->Width * 2; \ + info.tbytesline = obj->Image[0][b]->Width * 2; \ break; \ case GL_RGB: \ - info.tbytesline = obj->Image[b]->Width * 3; \ + info.tbytesline = obj->Image[0][b]->Width * 3; \ break; \ case GL_RGBA: \ - info.tbytesline = obj->Image[b]->Width * 4; \ + info.tbytesline = obj->Image[0][b]->Width * 4; \ break; \ default: \ _mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\ return; \ } \ - info.tsize = obj->Image[b]->Height * info.tbytesline; + info.tsize = obj->Image[0][b]->Height * info.tbytesline; #define RENDER_SPAN( span ) affine_span(ctx, &span, &info); @@ -808,11 +808,11 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ const struct gl_texture_object *obj = unit->Current2D; \ const GLint b = obj->BaseLevel; \ - info.texture = (const GLchan *) obj->Image[b]->Data; \ - info.twidth_log2 = obj->Image[b]->WidthLog2; \ - info.smask = obj->Image[b]->Width - 1; \ - info.tmask = obj->Image[b]->Height - 1; \ - info.format = obj->Image[b]->Format; \ + info.texture = (const GLchan *) obj->Image[0][b]->Data; \ + info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ + info.smask = obj->Image[0][b]->Width - 1; \ + info.tmask = obj->Image[0][b]->Height - 1; \ + info.format = obj->Image[0][b]->Format; \ info.filter = obj->MinFilter; \ info.envmode = unit->EnvMode; \ \ @@ -832,22 +832,22 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span, case GL_ALPHA: \ case GL_LUMINANCE: \ case GL_INTENSITY: \ - info.tbytesline = obj->Image[b]->Width; \ + info.tbytesline = obj->Image[0][b]->Width; \ break; \ case GL_LUMINANCE_ALPHA: \ - info.tbytesline = obj->Image[b]->Width * 2; \ + info.tbytesline = obj->Image[0][b]->Width * 2; \ break; \ case GL_RGB: \ - info.tbytesline = obj->Image[b]->Width * 3; \ + info.tbytesline = obj->Image[0][b]->Width * 3; \ break; \ case GL_RGBA: \ - info.tbytesline = obj->Image[b]->Width * 4; \ + info.tbytesline = obj->Image[0][b]->Width * 4; \ break; \ default: \ _mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\ return; \ } \ - info.tsize = obj->Image[b]->Height * info.tbytesline; + info.tsize = obj->Image[0][b]->Height * info.tbytesline; #define RENDER_SPAN( span ) \ span.interpMask &= ~SPAN_RGBA; \ @@ -1062,7 +1062,7 @@ _swrast_choose_triangle( GLcontext *ctx ) GLenum minFilter, magFilter, envMode; GLint format; texObj2D = ctx->Texture.Unit[0].Current2D; - texImg = texObj2D ? texObj2D->Image[texObj2D->BaseLevel] : NULL; + texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL; format = texImg ? texImg->TexFormat->MesaFormat : -1; minFilter = texObj2D ? texObj2D->MinFilter : (GLenum) 0; magFilter = texObj2D ? texObj2D->MagFilter : (GLenum) 0; |