From 17aa201cf751c055df635c6716274e21893b6aa4 Mon Sep 17 00:00:00 2001 From: Benson Joeris Date: Thu, 29 Nov 2018 18:36:42 -0500 Subject: [PATCH] Vulkan: Validate command buffer state when adding commands --- gapis/api/vulkan/api/command_buffer_control.api | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gapis/api/vulkan/api/command_buffer_control.api b/gapis/api/vulkan/api/command_buffer_control.api index 5b4e6508cd..010a215906 100644 --- a/gapis/api/vulkan/api/command_buffer_control.api +++ b/gapis/api/vulkan/api/command_buffer_control.api @@ -286,7 +286,11 @@ sub void AddCommand( SparseBinds: as!ref!QueuedSparseBinds(null), SignalFence: as!VkFence(0), ) - CommandBuffers[commandBuffer].CommandReferences[commandIndex] = cmd + cb := CommandBuffers[commandBuffer] + if cb.Recording != RECORDING { + vkErrorCommandBufferNotRecording(commandBuffer) + } + cb.CommandReferences[commandIndex] = cmd onCommandAdded(commandBuffer) }