summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-27 09:26:04 -0800
committerJason Ekstrand <[email protected]>2016-02-27 11:23:18 -0800
commitad50896c8769adcf141619774f8c156a2bcf920a (patch)
tree27fc336d3420996dec4ca95a26f0ccc1a5b07852
parent4b34f2ccb8b97aaf46b2dadb8098463969064753 (diff)
anv/gen7: Only try to get the depth format the surface has depth
-rw-r--r--src/intel/vulkan/gen7_cmd_buffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/intel/vulkan/gen7_cmd_buffer.c b/src/intel/vulkan/gen7_cmd_buffer.c
index 7377487cf7e..9681f22dc3d 100644
--- a/src/intel/vulkan/gen7_cmd_buffer.c
+++ b/src/intel/vulkan/gen7_cmd_buffer.c
@@ -458,7 +458,10 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
const struct anv_image_view *iview =
anv_cmd_buffer_get_depth_stencil_view(cmd_buffer);
const struct anv_image *image = iview ? iview->image : NULL;
- const uint32_t depth_format = image ?
+ const struct anv_format *anv_format =
+ iview ? anv_format_for_vk_format(iview->vk_format) : NULL;
+ const bool has_depth = iview && anv_format->has_depth;
+ const uint32_t depth_format = has_depth ?
isl_surf_get_depth_format(&cmd_buffer->device->isl_dev,
&image->depth_surface.isl) : D16_UNORM;