summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c51
1 files changed, 27 insertions, 24 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 7116d920f7..b97b760f18 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -307,7 +307,7 @@ _mesa_meta_free(GLcontext *ctx)
* freed by the normal context destruction code. But this would be
* the place to free other meta data someday.
*/
- _mesa_free(ctx->Meta);
+ free(ctx->Meta);
ctx->Meta = NULL;
}
@@ -493,12 +493,12 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state)
if (state & META_TRANSFORM) {
GLuint activeTexture = ctx->Texture.CurrentUnit;
- _mesa_memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m,
- 16 * sizeof(GLfloat));
- _mesa_memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m,
- 16 * sizeof(GLfloat));
- _mesa_memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m,
- 16 * sizeof(GLfloat));
+ memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m,
+ 16 * sizeof(GLfloat));
+ memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m,
+ 16 * sizeof(GLfloat));
+ memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m,
+ 16 * sizeof(GLfloat));
save->MatrixMode = ctx->Transform.MatrixMode;
/* set 1:1 vertex:pixel coordinate transform */
_mesa_ActiveTextureARB(GL_TEXTURE0);
@@ -1304,7 +1304,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx,
}
if (mask & GL_DEPTH_BUFFER_BIT) {
- GLuint *tmp = (GLuint *) _mesa_malloc(srcW * srcH * sizeof(GLuint));
+ GLuint *tmp = (GLuint *) malloc(srcW * srcH * sizeof(GLuint));
if (tmp) {
if (!blit->DepthFP)
init_blit_depth_pixels(ctx);
@@ -1328,7 +1328,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx,
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
mask &= ~GL_DEPTH_BUFFER_BIT;
- _mesa_free(tmp);
+ free(tmp);
}
}
@@ -1895,7 +1895,7 @@ _mesa_meta_DrawPixels(GLcontext *ctx,
_mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->StencilFP);
_mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_TRUE);
- for (bit = 0; bit < ctx->Visual.stencilBits; bit++) {
+ for (bit = 0; bit < ctx->DrawBuffer->Visual.stencilBits; bit++) {
const GLuint mask = 1 << bit;
if (mask & origStencilMask) {
_mesa_StencilFunc(GL_ALWAYS, mask, mask);
@@ -2065,7 +2065,7 @@ _mesa_meta_Bitmap(GLcontext *ctx,
if (!bitmap1)
return;
- bitmap8 = (GLubyte *) _mesa_calloc(width * height);
+ bitmap8 = (GLubyte *) calloc(1, width * height);
if (bitmap8) {
_mesa_expand_bitmap(width, height, &unpackSave, bitmap1,
bitmap8, width, 0xff);
@@ -2082,7 +2082,7 @@ _mesa_meta_Bitmap(GLcontext *ctx,
_mesa_set_enable(ctx, tex->Target, GL_FALSE);
- _mesa_free(bitmap8);
+ free(bitmap8);
}
_mesa_unmap_pbo_source(ctx, &unpackSave);
@@ -2131,12 +2131,15 @@ _mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target,
GL_COLOR_ATTACHMENT0_EXT,
target, texObj->Name, srcLevel);
}
+#if 0
+ /* other work is needed to enable 3D mipmap generation */
else if (target == GL_TEXTURE_3D) {
GLint zoffset = 0;
_mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
target, texObj->Name, srcLevel, zoffset);
}
+#endif
else {
/* 2D / cube */
_mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
@@ -2531,7 +2534,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
/*
* Alloc image buffer (XXX could use a PBO)
*/
- buf = _mesa_malloc(width * height * bpp);
+ buf = malloc(width * height * bpp);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims);
return;
@@ -2592,7 +2595,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
_mesa_lock_texture(ctx, texObj); /* re-lock */
- _mesa_free(buf);
+ free(buf);
}
@@ -2647,7 +2650,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
/*
* Alloc image buffer (XXX could use a PBO)
*/
- buf = _mesa_malloc(width * height * bpp);
+ buf = malloc(width * height * bpp);
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage%uD", dims);
return;
@@ -2688,7 +2691,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
_mesa_lock_texture(ctx, texObj); /* re-lock */
- _mesa_free(buf);
+ free(buf);
}
@@ -2731,7 +2734,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable");
return;
@@ -2748,7 +2751,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
@@ -2758,7 +2761,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable");
return;
@@ -2775,7 +2778,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
@@ -2786,7 +2789,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D");
return;
@@ -2805,7 +2808,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}
@@ -2816,7 +2819,7 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
{
GLfloat *buf;
- buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
+ buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
if (!buf) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D");
return;
@@ -2836,5 +2839,5 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target,
_mesa_meta_end(ctx);
- _mesa_free(buf);
+ free(buf);
}