diff options
author | Chad Versace <[email protected]> | 2015-08-28 07:08:58 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-08-28 07:17:54 -0700 |
commit | 941b48e992ac2272d3034e987a1313f8f5c1ca4f (patch) | |
tree | 80c59c5d77cc0a93873d0e647d565d2d1edf4d19 /src/vulkan/gen7_state.c | |
parent | c313a989b4354318e6842867af35e58f686978bc (diff) |
vk/image: Let anv_image have one anv_surface per aspect
Split anv_image::primary_surface into two: anv_image::color_surface and
depth_surface.
Diffstat (limited to 'src/vulkan/gen7_state.c')
-rw-r--r-- | src/vulkan/gen7_state.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c index 801716ea884..faf99a5aef8 100644 --- a/src/vulkan/gen7_state.c +++ b/src/vulkan/gen7_state.c @@ -273,7 +273,8 @@ gen7_image_view_init(struct anv_image_view *iview, const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange; struct anv_surface_view *view = &iview->view; - struct anv_surface *surface; + struct anv_surface *surface = + anv_image_get_surface_for_aspect(image, range->aspect); const struct anv_format *format = anv_format_for_vk_format(pCreateInfo->format); @@ -284,21 +285,6 @@ gen7_image_view_init(struct anv_image_view *iview, if (pCreateInfo->viewType != VK_IMAGE_VIEW_TYPE_2D) anv_finishme("non-2D image views"); - switch (pCreateInfo->subresourceRange.aspect) { - case VK_IMAGE_ASPECT_STENCIL: - anv_finishme("stencil image views"); - abort(); - break; - case VK_IMAGE_ASPECT_DEPTH: - case VK_IMAGE_ASPECT_COLOR: - view->offset = image->offset; - surface = &image->primary_surface; - break; - default: - unreachable(""); - break; - } - view->bo = image->bo; view->offset = image->offset + surface->offset; view->format = anv_format_for_vk_format(pCreateInfo->format); @@ -381,7 +367,8 @@ gen7_color_attachment_view_init(struct anv_color_attachment_view *aview, { ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image); struct anv_surface_view *view = &aview->view; - struct anv_surface *surface = &image->primary_surface; + struct anv_surface *surface = + anv_image_get_surface_for_color_attachment(image); aview->base.attachment_type = ANV_ATTACHMENT_VIEW_TYPE_COLOR; |