intel: Change signature of intel_create_wrapped_renderbuffer
authorChad Versace <chad@chad-versace.us>
Tue, 21 Jun 2011 21:06:13 +0000 (14:06 -0700)
committerChad Versace <chad@chad-versace.us>
Fri, 24 Jun 2011 21:47:20 +0000 (14:47 -0700)
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_fbo.h

index f48703e155cb43a1dafcc548b403918d43600007..8dd3696507f58815aceecbcaec21e3a30a9e38fb 100644 (file)
@@ -107,12 +107,6 @@ intel_get_pointer(struct gl_context * ctx, struct gl_renderbuffer *rb,
 }
 
 
-static struct gl_renderbuffer*
-intel_create_wrapped_renderbuffer(struct gl_context * ctx,
-                                 struct gl_renderbuffer *wrapper,
-                                 gl_format format);
-
-
 /**
  * Called via glRenderbufferStorageEXT() to set the format and allocate
  * storage for a user-created renderbuffer.
@@ -214,9 +208,9 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
       struct gl_renderbuffer *depth_rb;
       struct gl_renderbuffer *stencil_rb;
 
-      depth_rb = intel_create_wrapped_renderbuffer(ctx, rb,
+      depth_rb = intel_create_wrapped_renderbuffer(ctx, width, height,
                                                   MESA_FORMAT_X8_Z24);
-      stencil_rb = intel_create_wrapped_renderbuffer(ctx, rb,
+      stencil_rb = intel_create_wrapped_renderbuffer(ctx, width, height,
                                                     MESA_FORMAT_S8);
       ok = depth_rb && stencil_rb;
       ok = ok && intel_alloc_renderbuffer_storage(ctx, depth_rb,
@@ -236,6 +230,8 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
         return false;
       }
 
+      depth_rb->Wrapped = rb;
+      stencil_rb->Wrapped = rb;
       _mesa_reference_renderbuffer(&irb->wrapped_depth, depth_rb);
       _mesa_reference_renderbuffer(&irb->wrapped_stencil, stencil_rb);
 
@@ -409,9 +405,9 @@ intel_create_renderbuffer(gl_format format)
 }
 
 
-static struct gl_renderbuffer *
+struct gl_renderbuffer*
 intel_create_wrapped_renderbuffer(struct gl_context * ctx,
-                                 struct gl_renderbuffer *wrapper,
+                                 int width, int height,
                                  gl_format format)
 {
    /*
@@ -433,18 +429,8 @@ intel_create_wrapped_renderbuffer(struct gl_context * ctx,
    rb->Format = format;
    rb->InternalFormat = rb->_BaseFormat;
    rb->DataType = intel_mesa_format_to_rb_datatype(format);
-   rb->Width = wrapper->Width;
-   rb->Height = wrapper->Height;
-
-   rb->AllocStorage = intel_nop_alloc_storage;
-   rb->Delete = intel_delete_renderbuffer;
-   rb->GetPointer = intel_get_pointer;
-
-   /*
-    * A refcount here would cause a cyclic reference. The wrapper references
-    * the unwrapper.
-    */
-   rb->Wrapped = wrapper;
+   rb->Width = width;
+   rb->Height = height;
 
    return rb;
 }
index da0b24064dff8d02ae9cb43569d305113aabcc08..08cf577a91cfaf6ee4531c7bcf072b8cb69a4b7b 100644 (file)
@@ -169,6 +169,10 @@ intel_renderbuffer_set_hiz_region(struct intel_context *intel,
 extern struct intel_renderbuffer *
 intel_create_renderbuffer(gl_format format);
 
+struct gl_renderbuffer*
+intel_create_wrapped_renderbuffer(struct gl_context * ctx,
+                                 int width, int height,
+                                 gl_format format);
 
 extern void
 intel_fbo_init(struct intel_context *intel);