diff options
author | Chad Versace <[email protected]> | 2015-08-28 07:52:19 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-08-28 07:52:19 -0700 |
commit | c6f19b42486dd8f17c19779e38f7ee84f4f14a52 (patch) | |
tree | c411224fdef9ffbc2a12badafc0162b82a30a2b0 /src/vulkan/gen7_cmd_buffer.c | |
parent | 35b0262a2d80b8b21dfccaf9a099278d3f3f6a6c (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/gen7_cmd_buffer.c')
-rw-r--r-- | src/vulkan/gen7_cmd_buffer.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vulkan/gen7_cmd_buffer.c b/src/vulkan/gen7_cmd_buffer.c index c157155cd99..84b733ca458 100644 --- a/src/vulkan/gen7_cmd_buffer.c +++ b/src/vulkan/gen7_cmd_buffer.c @@ -539,6 +539,7 @@ gen7_cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer) view = (const struct anv_depth_stencil_view *)aview; } + const struct anv_image *image = view ? view->image : NULL; const bool has_depth = view && view->format->depth_format; const bool has_stencil = view && view->format->has_stencil; @@ -550,8 +551,11 @@ gen7_cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer) .StencilWriteEnable = has_stencil, .HierarchicalDepthBufferEnable = false, .SurfaceFormat = view->format->depth_format, - .SurfacePitch = view->depth_stride - 1, - .SurfaceBaseAddress = { view->bo, view->depth_offset }, + .SurfacePitch = image->depth_surface.stride - 1, + .SurfaceBaseAddress = { + .bo = image->bo, + .offset = image->depth_surface.offset, + }, .Height = fb->height - 1, .Width = fb->width - 1, .LOD = 0, @@ -589,8 +593,11 @@ gen7_cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer) if (has_stencil) { anv_batch_emit(&cmd_buffer->batch, GEN7_3DSTATE_STENCIL_BUFFER, .StencilBufferObjectControlState = GEN7_MOCS, - .SurfacePitch = view->stencil_stride - 1, - .SurfaceBaseAddress = { view->bo, view->stencil_offset }); + .SurfacePitch = image->stencil_surface.stride - 1, + .SurfaceBaseAddress = { + .bo = image->bo, + .offset = image->offset + image->stencil_surface.offset, + }); } else { anv_batch_emit(&cmd_buffer->batch, GEN7_3DSTATE_STENCIL_BUFFER); } |