aboutsummaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-01-01 13:47:18 -0800
committerJason Ekstrand <jason.ekstrand@intel.com>2016-01-04 16:08:05 -0800
commita7cc12910d1963d21fda8165ce790c4cb4241fba (patch)
treeabc82a968606830300f4d6ce7ff3f380dbfd26f5 /src/vulkan/anv_image.c
parent87dd59e5784774aebc6ff8eab8086ee2067590d3 (diff)
anv/image: Do more work in anv_image_view_init
There was a bunch of common code in gen7/8_image_view_init that we really should be sharing.
Diffstat (limited to 'src/vulkan/anv_image.c')
-rw-r--r--src/vulkan/anv_image.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c
index 5a9f826ec43..5bee5a236e8 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -432,6 +432,22 @@ anv_image_view_init(struct anv_image_view *iview,
break;
}
+ struct anv_surface *surface =
+ anv_image_get_surface_for_aspect_mask(image, range->aspectMask);
+
+ iview->image = image;
+ iview->bo = image->bo;
+ iview->offset = image->offset + surface->offset;
+
+ iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask;
+ iview->format = anv_format_for_vk_format(pCreateInfo->format);
+
+ iview->extent = (VkExtent3D) {
+ .width = anv_minify(image->extent.width, range->baseMipLevel),
+ .height = anv_minify(image->extent.height, range->baseMipLevel),
+ .depth = anv_minify(image->extent.depth, range->baseMipLevel),
+ };
+
switch (device->info.gen) {
case 7:
if (device->info.is_haswell)