diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/context.c | 1 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 6 | ||||
-rw-r--r-- | src/mesa/main/mipmap.c | 19 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 2 |
4 files changed, 19 insertions, 9 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 11b1d244538..ae91bf5f385 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -860,6 +860,7 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_free_shared_state(ctx, ctx->Shared); if (ctx->Exec) _mesa_free(ctx->Exec); + return GL_FALSE; } #if FEATURE_dispatch _mesa_init_exec_table(ctx->Exec); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 6354ed74748..95c1b9015bd 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1961,6 +1961,9 @@ save_Fogiv(GLenum pname, const GLint *params) case GL_FOG_END: case GL_FOG_INDEX: p[0] = (GLfloat) *params; + p[1] = 0.0f; + p[2] = 0.0f; + p[3] = 0.0f; break; case GL_FOG_COLOR: p[0] = INT_TO_FLOAT(params[0]); @@ -2249,6 +2252,9 @@ save_LightModeliv(GLenum pname, const GLint *params) case GL_LIGHT_MODEL_TWO_SIDE: case GL_LIGHT_MODEL_COLOR_CONTROL: fparam[0] = (GLfloat) params[0]; + fparam[1] = 0.0F; + fparam[2] = 0.0F; + fparam[3] = 0.0F; break; default: /* Error will be caught later in gl_LightModelfv */ diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 3dca09d9f28..c3928fa513f 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1501,8 +1501,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, GLuint comps; ASSERT(texObj); - /* XXX choose cube map face here??? */ - srcImage = texObj->Image[0][texObj->BaseLevel]; + srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel); ASSERT(srcImage); maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); @@ -1510,7 +1509,9 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* Find convertFormat - the format that do_row() will process */ if (srcImage->IsCompressed) { - /* setup for compressed textures */ + /* setup for compressed textures - need to allocate temporary + * image buffers to hold uncompressed images. + */ GLuint row; GLint components, size; GLchan *dst; @@ -1587,11 +1588,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, &dstWidth, &dstHeight, &dstDepth); if (!nextLevel) { /* all done */ - if (srcImage->IsCompressed) { - _mesa_free((void *) srcData); - _mesa_free(dstData); - } - return; + break; } /* get dest gl_texture_image */ @@ -1682,6 +1679,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, } } /* loop over mipmap levels */ + + if (srcImage->IsCompressed) { + /* free uncompressed image buffers */ + _mesa_free((void *) srcData); + _mesa_free(dstData); + } } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index f8ce811eb29..8fd5eaa2661 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -859,7 +859,7 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { if (texObj == unit->CurrentTex[tex]) { _mesa_reference_texobj(&unit->CurrentTex[tex], - ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]); + ctx->Shared->DefaultTex[tex]); ASSERT(unit->CurrentTex[tex]); break; } |