aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-12-21 07:52:20 -0700
committerTobin Ehlis <tobine@google.com>2016-12-23 10:00:06 -0700
commit078031a3120770269657149494709cdeabc10810 (patch)
tree1090a2679db19aad6b175390714acb83b42accd6 /layers/core_validation.cpp
parentfcdecf3bd0ab162c68b1a5ff1e9ec795cca654a4 (diff)
downloadusermoji-078031a3120770269657149494709cdeabc10810.tar.xz
layers:Add PostCallRecordCmdDraw()
Add PostCallRecordCmdDraw() to perform state updates for CmdDraw() function. Don't quite have all state updates in there yet. Remaining state updates will be in follow-on commit.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index ca1e81e0..b47522f6 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -8028,6 +8028,13 @@ static void MarkStoreImagesAndBuffersAsWritten(layer_data *dev_data, GLOBAL_CB_N
}
}
+static void PostCallRecordCmdDraw(layer_data *dev_data, GLOBAL_CB_NODE *cb_state) {
+ MarkStoreImagesAndBuffersAsWritten(dev_data, cb_state);
+ updateResourceTrackingOnDraw(cb_state);
+ UpdateCmdBufferLastCmd(dev_data, cb_state, CMD_DRAW);
+ cb_state->drawCount[DRAW]++;
+}
+
VKAPI_ATTR void VKAPI_CALL CmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount,
uint32_t firstVertex, uint32_t firstInstance) {
bool skip_call = false;
@@ -8036,28 +8043,25 @@ VKAPI_ATTR void VKAPI_CALL CmdDraw(VkCommandBuffer commandBuffer, uint32_t verte
GLOBAL_CB_NODE *pCB = getCBNode(dev_data, commandBuffer);
if (pCB) {
skip_call |= ValidateCmd(dev_data, pCB, CMD_DRAW, "vkCmdDraw()");
- UpdateCmdBufferLastCmd(dev_data, pCB, CMD_DRAW);
- pCB->drawCount[DRAW]++; // TODO : This should be in
// TODO : Split this into validate/state update. Also at state update time, set bool to note if/when
// vtx buffers are consumed and only flag perf warning if bound vtx buffers have not been consumed
skip_call |= validate_and_update_draw_state(dev_data, pCB, false, VK_PIPELINE_BIND_POINT_GRAPHICS, "vkCmdDraw");
- MarkStoreImagesAndBuffersAsWritten(dev_data, pCB); // state update only
// TODO : Do we need to do this anymore?
skip_call |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
reinterpret_cast<uint64_t &>(commandBuffer), __LINE__, DRAWSTATE_NONE, "DS",
"vkCmdDraw() call 0x%" PRIx64 ", reporting descriptor set state:", g_drawCount[DRAW]++);
skip_call |= synchAndPrintDSConfig(dev_data, commandBuffer);
- if (!skip_call) {
- // TODO : This should go to Post-call
- updateResourceTrackingOnDraw(pCB);
- }
// TODO : This is only validation
skip_call |= outsideRenderPass(dev_data, pCB, "vkCmdDraw()", VALIDATION_ERROR_01365);
}
lock.unlock();
- if (!skip_call)
+ if (!skip_call) {
dev_data->dispatch_table.CmdDraw(commandBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
+ lock.lock();
+ PostCallRecordCmdDraw(dev_data, pCB);
+ lock.unlock();
+ }
}
VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount,