diff options
author | Jason Ekstrand <[email protected]> | 2016-11-15 15:25:55 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-11-22 13:44:55 -0800 |
commit | 1d5ac0a462ac8c7f41e1e1adb1fc5a7db6038d17 (patch) | |
tree | 80fbf2f8417adc459cff6faf413ec96be0d45fe0 /src/intel/vulkan/anv_image.c | |
parent | 140d041fac24b6140f8df8f02418b8bc1503d4a8 (diff) |
anv: Set up binding tables and surface states for input attachments
This commit adds the last remaining bits to support input attachments in
the Intel Vulkan driver. For color and depth attachments, we allocate an
input attachment surface state during vkCmdBeginRenderPass like we do for
the render target surface states. This is so that we can incorporate the
clear color and aux information as used in rendering. For stencil, we just
treat it like a regular texture because we don't there is no aux. Also,
only having to worry about at most one input attachment surface for each
attachment makes some of the vkCmdBeginRenderPass code simpler.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index ed221a7730e..6f19c84df99 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -521,7 +521,14 @@ anv_CreateImageView(VkDevice _device, iview->isl.usage = 0; } - if (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT) { + /* Input attachment surfaces for color or depth are allocated and filled + * out at BeginRenderPass time because they need compression information. + * Stencil image do not support compression so we just use the texture + * surface from the image view. + */ + if (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT || + (image->usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT && + (iview->aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT))) { iview->sampler_surface_state = alloc_surface_state(device); struct isl_view view = iview->isl; |