summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-04-22 10:38:41 -0700
committerEric Anholt <[email protected]>2013-05-06 14:33:38 -0700
commit749a92786d378ee55cf9ebbbe8596c217fbae0f9 (patch)
tree57b80a3a7cc6378d6db4b8172ea56e58f3410f44 /src/mesa/drivers/dri
parent5b9609f59ac4e9079a6dea1212178070a45ab8e9 (diff)
mesa: Make core Mesa allocate the texture renderbuffer wrapper.
Every driver did the same thing. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c17
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fbo.c10
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_fbo.c14
3 files changed, 1 insertions, 40 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index bf440a12c83..caecd3f4b03 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -606,28 +606,13 @@ intel_render_texture(struct gl_context * ctx,
/* Fallback on drawing to a texture that doesn't have a miptree
* (has a border, width/height 0, etc.)
*/
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
_swrast_render_texture(ctx, fb, att);
return;
}
- else if (!irb) {
- intel_miptree_check_level_layer(mt, att->TextureLevel, layer);
- irb = (struct intel_renderbuffer *)intel_new_renderbuffer(ctx, ~0);
-
- if (irb) {
- /* bind the wrapper to the attachment point */
- _mesa_reference_renderbuffer(&att->Renderbuffer, &irb->Base.Base);
- }
- else {
- /* fallback to software rendering */
- _swrast_render_texture(ctx, fb, att);
- return;
- }
- }
+ intel_miptree_check_level_layer(mt, att->TextureLevel, layer);
if (!intel_renderbuffer_update_wrapper(intel, irb, image, layer)) {
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
_swrast_render_texture(ctx, fb, att);
return;
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
index b4870099a28..adead3d1bd4 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
@@ -270,16 +270,6 @@ nouveau_render_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
struct gl_texture_image *ti =
att->Texture->Image[att->CubeMapFace][att->TextureLevel];
- /* Allocate a renderbuffer object for the texture if we
- * haven't already done so. */
- if (!rb) {
- rb = nouveau_renderbuffer_new(ctx, ~0);
- assert(rb);
-
- rb->AllocStorage = NULL;
- _mesa_reference_renderbuffer(&att->Renderbuffer, rb);
- }
-
/* Update the renderbuffer fields from the texture. */
set_renderbuffer_format(rb, get_tex_format(ti));
rb->Width = ti->Width;
diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index eb592dbf8c5..5f996c52b67 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -835,25 +835,11 @@ radeon_render_texture(struct gl_context * ctx,
if (!radeon_image->mt) {
/* Fallback on drawing to a texture without a miptree.
*/
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
_swrast_render_texture(ctx, fb, att);
return;
}
- else if (!rrb) {
- rrb = radeon_wrap_texture(ctx, newImage);
- if (rrb) {
- /* bind the wrapper to the attachment point */
- _mesa_reference_renderbuffer(&att->Renderbuffer, &rrb->base.Base);
- }
- else {
- /* fallback to software rendering */
- _swrast_render_texture(ctx, fb, att);
- return;
- }
- }
if (!radeon_update_wrapper(ctx, rrb, newImage)) {
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
_swrast_render_texture(ctx, fb, att);
return;
}