summaryrefslogtreecommitdiffstats
path: root/src/vulkan/gen7_state.c
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2016-01-08 23:43:20 -0800
committerKristian Høgsberg Kristensen <[email protected]>2016-01-08 23:51:11 -0800
commitbbb2a85c8115bd003639e5e854c0753d613cec95 (patch)
treee74c2dbbe43a9ab2fca0cd2dcb5d0e197e0afbd6 /src/vulkan/gen7_state.c
parenta8cdef3dcef0e5da809f306a82aa6ffc9c1e6a71 (diff)
vk: Assert on use of uninitialized surface state
This exposes a case where we want to anv_CmdCopyBufferToImage() on an image that wasn't created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT and end up using uninitialized color_rt_surface_state from the meta image view.
Diffstat (limited to 'src/vulkan/gen7_state.c')
-rw-r--r--src/vulkan/gen7_state.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c
index 257cb35aca9..88598cea18e 100644
--- a/src/vulkan/gen7_state.c
+++ b/src/vulkan/gen7_state.c
@@ -251,6 +251,8 @@ genX(image_view_init)(struct anv_image_view *iview,
if (!device->info.has_llc)
anv_state_clflush(iview->nonrt_surface_state);
+ } else {
+ iview->nonrt_surface_state.alloc_size = 0;
}
if (image->needs_color_rt_surface_state) {
@@ -271,6 +273,8 @@ genX(image_view_init)(struct anv_image_view *iview,
&surface_state);
if (!device->info.has_llc)
anv_state_clflush(iview->color_rt_surface_state);
+ } else {
+ iview->color_rt_surface_state.alloc_size = 0;
}
if (image->needs_storage_surface_state) {
@@ -287,5 +291,7 @@ genX(image_view_init)(struct anv_image_view *iview,
GENX(RENDER_SURFACE_STATE_pack)(NULL, iview->storage_surface_state.map,
&surface_state);
+ } else {
+ iview->storage_surface_state.alloc_size = 0;
}
}