Abdiel Janulgue <abdiel.janul...@linux.intel.com> writes: > Add intel_miptree_create_for_offset which adds support for creating a single- > level miptree based on the existing offsets and dimensions of another > mip-tree level. Use this function as well in intel_miptree_create_for_region, > but for the whole region. > > Signed-off-by: Abdiel Janulgue <abdiel.janul...@linux.intel.com> > --- > src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 39 > +++++++++++++++++++++--- > src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 12 ++++++++ > src/mesa/drivers/dri/intel/intel_regions.h | 8 +++++ > 3 files changed, 54 insertions(+), 5 deletions(-) > > diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c > b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c > index 8d814bd..0a64de4 100644 > --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c > +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c > @@ -306,17 +306,26 @@ intel_miptree_create(struct intel_context *intel, > } > > > +/** > + * Create miptree for region based on offset, size, and level > + */ > struct intel_mipmap_tree * > -intel_miptree_create_for_region(struct intel_context *intel, > - GLenum target, > - gl_format format, > - struct intel_region *region) > +intel_miptree_create_for_offset(struct intel_context *intel, > + GLenum target, > + gl_format format, > + struct intel_region *region, > + GLuint width, > + GLuint height, > + GLuint level_x, > + GLuint level_y, > + GLuint slice_x_offset, > + GLuint slice_y_offset) > { > struct intel_mipmap_tree *mt; > > mt = intel_miptree_create_internal(intel, target, format, > 0, 0, > - region->width, region->height, 1, > + width, height, 1, > true, 0 /* num_samples */, > INTEL_MSAA_LAYOUT_NONE);
I'd probably skip this whole patch and just expose intel_miptree_create_internal (perhaps called intel_miptree_create_layout() instead of _internal() to clarify that it doesn't do allocation? Not sure.), then do the fixup in the KHR_gl_texture_image function.
pgpGbhMfHXcRx.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev