On Thu, 17 Nov 2011 19:58:42 -0800, Chad Versace <chad.vers...@linux.intel.com> wrote: > This is in preparation for properly implementing glFramebufferTexture*() > for mipmapped depthstencil textures. The FIXME comments deleted by this > patch give a rough explanation of what was broken. > > This refactor does the following: > - In intel_update_wrapper() and intel_wrap_texture(), prepare to > replace the 'att' parameter with a miptree. > - Move the call to intel_renderbuffer_set_draw_offsets() from > intel_render_texture() into intel_udpate_wrapper(). > > Each time I encounter those functions, I dislike their vague names. > (Update which wrapper? What is wrapped? What is the wrapper?). So, while > I was mucking around, I also renamed the functions. > > Signed-off-by: Chad Versace <chad.vers...@linux.intel.com> > --- > src/mesa/drivers/dri/intel/intel_fbo.c | 113 > +++++++++++++++++++++++--------- > 1 files changed, 81 insertions(+), 32 deletions(-) > > diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c > b/src/mesa/drivers/dri/intel/intel_fbo.c > index 8e4f7a9..a61c74c 100644 > --- a/src/mesa/drivers/dri/intel/intel_fbo.c > +++ b/src/mesa/drivers/dri/intel/intel_fbo.c > @@ -945,41 +945,54 @@ intel_framebuffer_renderbuffer(struct gl_context * ctx, > intel_draw_buffer(ctx); > } > > +/** > + * NOTE: The 'att' parameter is a kludge that will soon be removed. Its > + * presence allows us to refactor the wrapping of depthstencil textures that > + * use separate stencil in two easily manageable steps, rather than in one > + * large, hairy step. First, refactor the common wrapping code used by all > + * texture formats. Second, refactor the separate stencil code paths. > + */ > static bool > -intel_update_wrapper(struct gl_context *ctx, struct intel_renderbuffer *irb, > - struct gl_renderbuffer_attachment *att) > +intel_renderbuffer_update_wrapper(struct intel_context *intel, > + struct intel_renderbuffer *irb, > + struct intel_mipmap_tree *mt, > + uint32_t level, > + uint32_t layer, > + GLenum internal_format, > + struct gl_renderbuffer_attachment *att) > { > + struct gl_context *ctx = &intel->ctx; > + struct gl_renderbuffer *rb = &irb->Base; > + > + /* The image variables are a kludge. See the note above for the att > + * parameter. > + */ > struct gl_texture_image *texImage = _mesa_get_attachment_teximage(att); > struct intel_texture_image *intel_image = intel_texture_image(texImage); > - int width, height, depth; > > - if (!intel_span_supports_format(texImage->TexFormat)) { > + irb->Base.Format = ctx->Driver.ChooseTextureFormat(ctx, internal_format, > + GL_NONE, GL_NONE); > + > + if (!intel_span_supports_format(rb->Format)) {
This ChooseTextureFormat looks really out of place. I don't know why you'd be choosing a new format here. Actually, I can't even figure out where the "-" lines here, like intel_span_supports_format(), came from. I don't think I can review this patch.
pgpTXdOSGSGE8.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev