浏览代码

mesa: move freeing of software renderbuffers into swrast

tags/i965-primitive-restart-v2
Brian Paul 13 年前
父节点
当前提交
f6a3979a04
共有 2 个文件被更改,包括 16 次插入6 次删除
  1. 1
    6
      src/mesa/main/renderbuffer.c
  2. 15
    0
      src/mesa/swrast/s_renderbuffer.c

+ 1
- 6
src/mesa/main/renderbuffer.c 查看文件

@@ -55,8 +55,6 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name)
rb->InternalFormat = GL_RGBA;
rb->Format = MESA_FORMAT_NONE;

rb->Data = NULL;

/* Point back to ourself so that we don't have to check for Wrapped==NULL
* all over the drivers.
*/
@@ -86,10 +84,7 @@ _mesa_new_renderbuffer(struct gl_context *ctx, GLuint name)
void
_mesa_delete_renderbuffer(struct gl_renderbuffer *rb)
{
if (rb->Data) {
free(rb->Data);
}
free(rb);
/* no-op */
}



+ 15
- 0
src/mesa/swrast/s_renderbuffer.c 查看文件

@@ -156,6 +156,20 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
}


/**
* Called via gl_renderbuffer::Delete()
*/
static void
soft_renderbuffer_delete(struct gl_renderbuffer *rb)
{
if (rb->Data) {
free(rb->Data);
rb->Data = NULL;
}
free(rb);
}


void
_swrast_map_soft_renderbuffer(struct gl_context *ctx,
struct gl_renderbuffer *rb,
@@ -198,6 +212,7 @@ _swrast_new_soft_renderbuffer(struct gl_context *ctx, GLuint name)
struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, name);
if (rb) {
rb->AllocStorage = soft_renderbuffer_storage;
rb->Delete = soft_renderbuffer_delete;
}
return rb;
}

正在加载...
取消
保存