summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-10-21 18:11:42 -0700
committerJason Ekstrand <[email protected]>2016-11-16 10:32:20 -0800
commit633677194f1d33f0dfbdfdfb7ac5b4f1b4dffdcb (patch)
tree044472d7d2e2177aa27f1ea9d4854e16c1598711 /src/intel
parenta380f954610319782811bb2aa44180c4e1231823 (diff)
Allocate a null state whenever there is depth/stencil
Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index e076e18f7e6..3ee8c758699 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -180,18 +180,19 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
}
bool need_null_state = false;
- for (uint32_t s = 0; s < pass->subpass_count; ++s) {
- if (pass->subpasses[s].color_count == 0) {
- need_null_state = true;
- break;
- }
- }
-
- unsigned num_states = need_null_state;
+ unsigned num_states = 0;
for (uint32_t i = 0; i < pass->attachment_count; ++i) {
- if (vk_format_is_color(pass->attachments[i].format))
+ if (vk_format_is_color(pass->attachments[i].format)) {
num_states++;
+ } else {
+ /* We need a null state for any depth-stencil-only subpasses.
+ * Importantly, this includes depth/stencil clears so we create one
+ * whenever we have depth or stencil
+ */
+ need_null_state = true;
+ }
}
+ num_states += need_null_state;
const uint32_t ss_stride = align_u32(isl_dev->ss.size, isl_dev->ss.align);
state->render_pass_states =