From 7ea707a42a21bced33de482f95b4a3dca781ae19 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Thu, 25 Jun 2015 19:46:42 -0700 Subject: [PATCH] vk/image: Add qpitch fields to anv_depth_stencil_view For now, hard-code them to 0. --- src/vulkan/device.c | 4 ++-- src/vulkan/image.c | 2 ++ src/vulkan/private.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 3c5691f3cb3..e637d2064ec 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -3779,7 +3779,7 @@ anv_cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer, .MinimumArrayElement = 0, .DepthBufferObjectControlState = GEN8_MOCS, .RenderTargetViewExtent = 1 - 1, - .SurfaceQPitch = 0); + .SurfaceQPitch = view->depth_qpitch >> 2); /* Disable hierarchial depth buffers. */ anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_HIER_DEPTH_BUFFER); @@ -3789,7 +3789,7 @@ anv_cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer, .StencilBufferObjectControlState = GEN8_MOCS, .SurfacePitch = view->stencil_stride > 0 ? view->stencil_stride - 1 : 0, .SurfaceBaseAddress = { view->bo, view->stencil_offset }, - .SurfaceQPitch = 0); + .SurfaceQPitch = view->stencil_qpitch >> 2); /* Clear the clear params. */ anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_CLEAR_PARAMS); diff --git a/src/vulkan/image.c b/src/vulkan/image.c index 5999318baaa..f3487302f28 100644 --- a/src/vulkan/image.c +++ b/src/vulkan/image.c @@ -487,9 +487,11 @@ VkResult anv_CreateDepthStencilView( view->depth_stride = image->stride; view->depth_offset = image->offset; view->depth_format = format->depth_format; + view->depth_qpitch = 0; /* FINISHME: QPitch */ view->stencil_stride = image->stencil_stride; view->stencil_offset = image->offset + image->stencil_offset; + view->stencil_qpitch = 0; /* FINISHME: QPitch */ *pView = (VkDepthStencilView) view; diff --git a/src/vulkan/private.h b/src/vulkan/private.h index 397881f75a4..353a51401eb 100644 --- a/src/vulkan/private.h +++ b/src/vulkan/private.h @@ -863,9 +863,11 @@ struct anv_depth_stencil_view { uint32_t depth_offset; /**< Offset into bo. */ uint32_t depth_stride; /**< 3DSTATE_DEPTH_BUFFER.SurfacePitch */ uint32_t depth_format; /**< 3DSTATE_DEPTH_BUFFER.SurfaceFormat */ + uint16_t depth_qpitch; /**< 3DSTATE_DEPTH_BUFFER.SurfaceQPitch */ uint32_t stencil_offset; /**< Offset into bo. */ uint32_t stencil_stride; /**< 3DSTATE_STENCIL_BUFFER.SurfacePitch */ + uint16_t stencil_qpitch; /**< 3DSTATE_DEPTH_BUFFER.SurfaceQPitch */ }; struct anv_framebuffer { -- 2.30.2