summaryrefslogtreecommitdiffstats
path: root/src/vulkan/anv_image.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-08-28 07:52:19 -0700
committerChad Versace <[email protected]>2015-08-28 07:52:19 -0700
commitc6f19b42486dd8f17c19779e38f7ee84f4f14a52 (patch)
treec411224fdef9ffbc2a12badafc0162b82a30a2b0 /src/vulkan/anv_image.c
parent35b0262a2d80b8b21dfccaf9a099278d3f3f6a6c (diff)
vk: Don't duplicate anv_depth_stencil_view's surface data
In anv_depth_stencil_view, replace the members bo depth_offset depth_stride depth_format depth_qpitch stencil_offset stencil_stride stencil_qpitch with the single member const struct anv_image *image The removed members duplicated data in anv_image::depth_surface and anv_image::stencil_surface.
Diffstat (limited to 'src/vulkan/anv_image.c')
-rw-r--r--src/vulkan/anv_image.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c
index 6ab541e5bce..242de52f639 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -468,35 +468,15 @@ anv_depth_stencil_view_init(struct anv_depth_stencil_view *view,
view->base.attachment_type = ANV_ATTACHMENT_VIEW_TYPE_DEPTH_STENCIL;
/* XXX: We don't handle any of these */
- assert(anv_format_is_depth_or_stencil(image->format));
anv_assert(pCreateInfo->mipLevel == 0);
anv_assert(pCreateInfo->baseArraySlice == 0);
anv_assert(pCreateInfo->arraySize == 1);
- view->bo = image->bo;
-
+ view->image = image;
view->format = anv_format_for_vk_format(pCreateInfo->format);
- assert(anv_format_is_depth_or_stencil(view->format));
-
- if (view->format->depth_format) {
- view->depth_stride = image->depth_surface.stride;
- view->depth_offset = image->offset + image->depth_surface.offset;
- view->depth_qpitch = 0; /* FINISHME: QPitch */
- } else {
- view->depth_stride = 0;
- view->depth_offset = 0;
- view->depth_qpitch = 0;
- }
- if (view->format->has_stencil) {
- view->stencil_stride = image->stencil_surface.stride;
- view->stencil_offset = image->offset + image->stencil_surface.offset;
- view->stencil_qpitch = 0; /* FINISHME: QPitch */
- } else {
- view->stencil_stride = 0;
- view->stencil_offset = 0;
- view->stencil_qpitch = 0;
- }
+ assert(anv_format_is_depth_or_stencil(image->format));
+ assert(anv_format_is_depth_or_stencil(view->format));
}
struct anv_surface *