summaryrefslogtreecommitdiffstats
path: root/src/vulkan/meta.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-05-28 10:06:45 -0700
committerJason Ekstrand <[email protected]>2015-05-28 10:06:45 -0700
commitde221a672d9585510b7525610c1dce0c6d069e92 (patch)
treeff2be30085364ba711153b8ee5055e7da028a341 /src/vulkan/meta.c
parent6eefeb1f8430bfa3f6f141dd563f2a4f82caede8 (diff)
meta: Add a default ds_state and use it when no ds state is set
Diffstat (limited to 'src/vulkan/meta.c')
-rw-r--r--src/vulkan/meta.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vulkan/meta.c b/src/vulkan/meta.c
index 4ce917124f9..8e9529595a2 100644
--- a/src/vulkan/meta.c
+++ b/src/vulkan/meta.c
@@ -290,6 +290,11 @@ anv_cmd_buffer_clear(struct anv_cmd_buffer *cmd_buffer,
VK_STATE_BIND_POINT_VIEWPORT,
cmd_buffer->framebuffer->vp_state);
+ if (cmd_buffer->ds_state == NULL)
+ anv_CmdBindDynamicStateObject((VkCmdBuffer) cmd_buffer,
+ VK_STATE_BIND_POINT_DEPTH_STENCIL,
+ device->meta_state.shared.ds_state);
+
anv_CmdDraw((VkCmdBuffer) cmd_buffer, 0, 3, 0, pass->num_clear_layers);
/* Restore API state */
@@ -484,6 +489,10 @@ meta_prepare_blit(struct anv_cmd_buffer *cmd_buffer,
anv_CmdBindDynamicStateObject((VkCmdBuffer) cmd_buffer,
VK_STATE_BIND_POINT_RASTER,
device->meta_state.shared.rs_state);
+ if (cmd_buffer->ds_state == NULL)
+ anv_CmdBindDynamicStateObject((VkCmdBuffer) cmd_buffer,
+ VK_STATE_BIND_POINT_DEPTH_STENCIL,
+ device->meta_state.shared.ds_state);
saved_state->cb_state = (VkDynamicCbState) cmd_buffer->cb_state;
anv_CmdBindDynamicStateObject((VkCmdBuffer) cmd_buffer,
@@ -1226,4 +1235,10 @@ anv_device_init_meta(struct anv_device *device)
.sType = VK_STRUCTURE_TYPE_DYNAMIC_CB_STATE_CREATE_INFO
},
&device->meta_state.shared.cb_state);
+
+ anv_CreateDynamicDepthStencilState((VkDevice) device,
+ &(VkDynamicDsStateCreateInfo) {
+ .sType = VK_STRUCTURE_TYPE_DYNAMIC_DS_STATE_CREATE_INFO
+ },
+ &device->meta_state.shared.ds_state);
}