diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-05-11 20:55:37 -0700 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-05-14 14:18:21 -0700 |
commit | b05c68fc8acf760acc3d124450fc5879f9385597 (patch) | |
tree | 54ba3816092f6584eb2e9010840874abdfb8d6aa /src/mesa/drivers/dri/i965/brw_meta_updownsample.c | |
parent | 672cffee0f24a40585c6c0a77caedd3aa0af60b1 (diff) | |
download | external_mesa3d-b05c68fc8acf760acc3d124450fc5879f9385597.zip external_mesa3d-b05c68fc8acf760acc3d124450fc5879f9385597.tar.gz external_mesa3d-b05c68fc8acf760acc3d124450fc5879f9385597.tar.bz2 |
i965: Move brw_get_rb_for_slice to brw_meta_util
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_meta_updownsample.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_meta_updownsample.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_meta_updownsample.c b/src/mesa/drivers/dri/i965/brw_meta_updownsample.c index f5fc207..91c92bd 100644 --- a/src/mesa/drivers/dri/i965/brw_meta_updownsample.c +++ b/src/mesa/drivers/dri/i965/brw_meta_updownsample.c @@ -24,6 +24,7 @@ #include "brw_context.h" #include "intel_batchbuffer.h" #include "intel_fbo.h" +#include "brw_meta_util.h" #include "main/blit.h" #include "main/buffers.h" @@ -42,50 +43,6 @@ */ /** - * Creates a new named renderbuffer that wraps the first slice - * of an existing miptree. - * - * Clobbers the current renderbuffer binding (ctx->CurrentRenderbuffer). - */ -struct gl_renderbuffer * -brw_get_rb_for_slice(struct brw_context *brw, - struct intel_mipmap_tree *mt, - unsigned level, unsigned layer, bool flat) -{ - struct gl_context *ctx = &brw->ctx; - struct gl_renderbuffer *rb = ctx->Driver.NewRenderbuffer(ctx, 0xDEADBEEF); - struct intel_renderbuffer *irb = intel_renderbuffer(rb); - - rb->RefCount = 1; - rb->Format = mt->format; - rb->_BaseFormat = _mesa_get_format_base_format(mt->format); - - /* Program takes care of msaa and mip-level access manually for stencil. - * The surface is also treated as Y-tiled instead of as W-tiled calling for - * twice the width and half the height in dimensions. - */ - if (flat) { - const unsigned halign_stencil = 8; - - rb->NumSamples = 0; - rb->Width = ALIGN(mt->total_width, halign_stencil) * 2; - rb->Height = (mt->total_height / mt->physical_depth0) / 2; - irb->mt_level = 0; - } else { - rb->NumSamples = mt->num_samples; - rb->Width = mt->logical_width0; - rb->Height = mt->logical_height0; - irb->mt_level = level; - } - - irb->mt_layer = layer; - - intel_miptree_reference(&irb->mt, mt); - - return rb; -} - -/** * Implementation of up or downsampling for window-system MSAA miptrees. */ void |