aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2017-01-11 15:12:35 -0800
committerNanley Chery <[email protected]>2017-01-12 20:52:20 -0800
commit2852efcda40274acf3272611c6a3b7731523a72d (patch)
tree2d1d5e95c9746e9b09b4caf6302ed6a1d54edec7 /src/intel/vulkan/anv_image.c
parentb62d8ad2aee2f67fb290332b285a0a5aa93e7724 (diff)
anv: Disable HiZ for input attachments
v2 (Jason Ekstrand): - Add spec citation - Drop conditional Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index d8216291914..e21374b1abc 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -182,6 +182,20 @@ make_surface(const struct anv_device *dev,
*/
if (!(image->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
/* It will never be used as an attachment, HiZ is pointless. */
+ } else if (image->usage & VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT) {
+ /* From the 1.0.37 spec:
+ *
+ * "An attachment used as an input attachment and depth/stencil
+ * attachment must be in either VK_IMAGE_LAYOUT_GENERAL or
+ * VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL."
+ *
+ * It will never have a layout of
+ * VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, so HiZ is
+ * currently pointless. If transfer operations learn to use the HiZ
+ * buffer, we can enable HiZ for VK_IMAGE_LAYOUT_GENERAL and support
+ * input attachments.
+ */
+ anv_finishme("Implement HiZ for input attachments");
} else if (!env_var_as_boolean("INTEL_VK_HIZ", dev->info.gen >= 8)) {
anv_finishme("Implement gen7 HiZ");
} else if (vk_info->mipLevels > 1) {
@@ -529,14 +543,15 @@ anv_CreateImageView(VkDevice _device,
if (surf_usage == ISL_AUX_USAGE_HIZ)
surf_usage = ISL_AUX_USAGE_NONE;
- /* Input attachment surfaces for color or depth are allocated and filled
+ /* Input attachment surfaces for color 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.
+ * Compression is not yet enabled for depth textures and stencil doesn't
+ * allow compression so we can just use the texture surface state from the
+ * 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->aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT))) {
iview->sampler_surface_state = alloc_surface_state(device);
struct isl_view view = iview->isl;