On Fri, Oct 7, 2016 at 4:45 PM, Nanley Chery <nanleych...@gmail.com> wrote:
> On Sun, Sep 25, 2016 at 09:59:02AM -0700, Jason Ekstrand wrote: > > Signed-off-by: Jason Ekstrand <ja...@jlekstrand.net> > > --- > > src/intel/vulkan/anv_image.c | 16 ++++++++++++---- > > 1 file changed, 12 insertions(+), 4 deletions(-) > > > > diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c > > index f6e8672..f55c9b6 100644 > > --- a/src/intel/vulkan/anv_image.c > > +++ b/src/intel/vulkan/anv_image.c > > @@ -432,6 +432,18 @@ anv_image_view_init(struct anv_image_view *iview, > > .depth = anv_minify(image->extent.depth , range->baseMipLevel), > > }; > > > > + if (image->type == VK_IMAGE_TYPE_3D && > > + usage_mask != VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) { > > + /* Meta renders to 3D texture slices. When it does so, it passes > > + * usage_mask == VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT. Since > meta is the > > + * only thing that uses a non-zero usage_mask, this lets us easily > > + * detect the one case where we actually want an array range used > for > > + * 3-D textures. > > + */ > > + isl_view.base_array_layer = 0; > > + isl_view.array_len = iview->extent.depth; > > + } > > + > > Any idea why we modify the array_len here instead of just looking up the > depth and miplevel in isl_surf_fill_state()? > Because rendering to a subrange of a 3D texture is a thing (and required by GL). In Vulkan, things are a bit simpler. > -Nanley > > > isl_surf_usage_flags_t cube_usage; > > if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE || > > pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) { > > @@ -492,10 +504,6 @@ anv_image_view_init(struct anv_image_view *iview, > > isl_view.usage = cube_usage | ISL_SURF_USAGE_STORAGE_BIT; > > isl_view.format = isl_lower_storage_image_ > format(&device->info, > > > isl_view.format); > > - if (image->type == VK_IMAGE_TYPE_3D) { > > - isl_view.base_array_layer = 0; > > - isl_view.array_len = iview->extent.depth; > > - } > > isl_surf_fill_state(&device->isl_dev, > > iview->storage_surface_state.map, > > .surf = &surface->isl, > > -- > > 2.5.0.400.gff86faf > > > > _______________________________________________ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev