summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-03-25 22:14:09 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-03-25 22:14:09 +0000
commit7fb177c367cc8f522dd1dced1e80908ee51befd4 (patch)
tree47cffd030eab1824d94a16b46c4a2c96867375ac
parentd65cda4ce3173e4e57752eb99ba8b413c8b7db24 (diff)
Shorten ctx->Driver.RenderbufferTexture to ctx->Driver.RenderTexture since
calls to it no longer directly correspond to glRenderbufferTextureEXT.
-rw-r--r--src/mesa/drivers/common/driverfuncs.c2
-rw-r--r--src/mesa/drivers/dri/i915/intel_fbo.c16
-rw-r--r--src/mesa/main/dd.h6
-rw-r--r--src/mesa/main/fbobject.c6
-rw-r--r--src/mesa/main/teximage.c2
-rw-r--r--src/mesa/main/texrender.c16
-rw-r--r--src/mesa/main/texrender.h6
7 files changed, 31 insertions, 23 deletions
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index 9eb05442be..c554be0743 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -206,7 +206,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
#if FEATURE_EXT_framebuffer_object
driver->NewFramebuffer = _mesa_new_framebuffer;
driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
- driver->RenderbufferTexture = _mesa_renderbuffer_texture;
+ driver->RenderTexture = _mesa_render_texture;
driver->FinishRenderTexture = _mesa_finish_render_texture;
driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
#endif
diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c
index fbd23ee773..dbbc1bd9b2 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -531,13 +531,15 @@ intel_wrap_texture(GLcontext *ctx, struct gl_texture_image *texImage)
/**
- * Called via glFramebufferTexture[123]DEXT() to prepare for rendering
- * into texture memory.
+ * Called by glFramebufferTexture[123]DEXT() (and other places) to
+ * prepare for rendering into texture memory. This might be called
+ * many times to choose different texture levels, cube faces, etc
+ * before intel_finish_render_texture() is ever called.
*/
static void
-intel_renderbuffer_texture(GLcontext *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att)
+intel_render_texture(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
{
struct gl_texture_image *newImage
= att->Texture->Image[att->CubeMapFace][att->TextureLevel];
@@ -558,7 +560,7 @@ intel_renderbuffer_texture(GLcontext *ctx,
}
else {
/* fallback to software rendering */
- _mesa_renderbuffer_texture(ctx, fb, att);
+ _mesa_render_texture(ctx, fb, att);
return;
}
}
@@ -631,6 +633,6 @@ intel_fbo_init( struct intel_context *intel )
intel->ctx.Driver.NewRenderbuffer = intel_new_renderbuffer;
intel->ctx.Driver.BindFramebuffer = intel_bind_framebuffer;
intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
- intel->ctx.Driver.RenderbufferTexture = intel_renderbuffer_texture;
+ intel->ctx.Driver.RenderTexture = intel_render_texture;
intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index bc22b8dbc2..4f1a962731 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -807,9 +807,9 @@ struct dd_function_table {
struct gl_framebuffer *fb,
GLenum attachment,
struct gl_renderbuffer *rb);
- void (*RenderbufferTexture)(GLcontext *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att);
+ void (*RenderTexture)(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att);
void (*FinishRenderTexture)(GLcontext *ctx,
struct gl_renderbuffer_attachment *att);
/*@}*/
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 569979791b..fdc1ad300b 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -210,7 +210,7 @@ _mesa_set_texture_attachment(GLcontext *ctx,
att->Complete = GL_FALSE;
if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) {
- ctx->Driver.RenderbufferTexture(ctx, fb, att);
+ ctx->Driver.RenderTexture(ctx, fb, att);
}
}
@@ -918,12 +918,12 @@ static void
check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb)
{
GLuint i;
- ASSERT(ctx->Driver.RenderbufferTexture);
+ ASSERT(ctx->Driver.RenderTexture);
for (i = 0; i < BUFFER_COUNT; i++) {
struct gl_renderbuffer_attachment *att = fb->Attachment + i;
struct gl_texture_object *texObj = att->Texture;
if (texObj) {
- ctx->Driver.RenderbufferTexture(ctx, fb, att);
+ ctx->Driver.RenderTexture(ctx, fb, att);
}
}
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 385297b3f5..ff1d51d7d0 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -2172,7 +2172,7 @@ update_fbo_texture(GLcontext *ctx, struct gl_texture_object *texObj,
att->CubeMapFace == face) {
ASSERT(att->Texture->Image[att->CubeMapFace][att->TextureLevel]);
/* Tell driver about the new renderbuffer texture */
- ctx->Driver.RenderbufferTexture(ctx, ctx->DrawBuffer, att);
+ ctx->Driver.RenderTexture(ctx, ctx->DrawBuffer, att);
}
}
}
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index 01e6d6748a..b01e63b781 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -163,7 +163,6 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
trb->Zoffset = att->Zoffset;
- trb->Base.RefCount = 1;
trb->Base.Width = trb->TexImage->Width;
trb->Base.Height = trb->TexImage->Height;
trb->Base.InternalFormat = trb->TexImage->InternalFormat; /* XXX fix? */
@@ -201,7 +200,8 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
/**
- * Called when rendering to a texture image begins.
+ * Called when rendering to a texture image begins, or when changing
+ * the dest mipmap level, cube face, etc.
* This is a fallback routine for software render-to-texture.
*
* Called via the glRenderbufferTexture1D/2D/3D() functions
@@ -217,9 +217,9 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
* \sa _mesa_framebuffer_renderbuffer
*/
void
-_mesa_renderbuffer_texture(GLcontext *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att)
+_mesa_render_texture(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
{
struct gl_texture_image *newImage
= att->Texture->Image[att->CubeMapFace][att->TextureLevel];
@@ -246,10 +246,16 @@ void
_mesa_finish_render_texture(GLcontext *ctx,
struct gl_renderbuffer_attachment *att)
{
+ /* do nothing */
+ /* The renderbuffer texture wrapper will get deleted by the
+ * normal mechanism for deleting renderbuffers.
+ */
+#if 0
if (att->Renderbuffer) {
att->Renderbuffer->RefCount--;
}
if (att->Renderbuffer->RefCount <= 0) {
_mesa_debug(ctx, "%s refcount == 0!\n", __FUNCTION__);
}
+#endif
}
diff --git a/src/mesa/main/texrender.h b/src/mesa/main/texrender.h
index 575d84415f..7c3fb0871b 100644
--- a/src/mesa/main/texrender.h
+++ b/src/mesa/main/texrender.h
@@ -3,9 +3,9 @@
extern void
-_mesa_renderbuffer_texture(GLcontext *ctx,
- struct gl_framebuffer *fb,
- struct gl_renderbuffer_attachment *att);
+_mesa_render_texture(GLcontext *ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att);
extern void
_mesa_finish_render_texture(GLcontext *ctx,