Vulkan: Add debugging of the command buffer.

Add a debugger context and server to vk::Device, along with a getter for acquiring the debugger context.

Generate a synthetic file containing all the Vulkan commands in the command buffer, and allow the debugger to single line step over these.

All of this is no-op unless ENABLE_VK_DEBUGGER is defined at compile time, and the VK_DEBUGGER_PORT env var is set at run time.

Bug: b/145351270
Change-Id: I8bea398a6c08d4cb23d76172dbca2a08ae109a6d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/38913
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Vulkan/VkCommandPool.cpp b/src/Vulkan/VkCommandPool.cpp
index 35ec438..fe467e0 100644
--- a/src/Vulkan/VkCommandPool.cpp
+++ b/src/Vulkan/VkCommandPool.cpp
@@ -46,7 +46,7 @@
 	return 0;
 }
 
-VkResult CommandPool::allocateCommandBuffers(VkCommandBufferLevel level, uint32_t commandBufferCount, VkCommandBuffer *pCommandBuffers)
+VkResult CommandPool::allocateCommandBuffers(Device *device, VkCommandBufferLevel level, uint32_t commandBufferCount, VkCommandBuffer *pCommandBuffers)
 {
 	for(uint32_t i = 0; i < commandBufferCount; i++)
 	{
@@ -54,7 +54,7 @@
 		void *deviceMemory = vk::allocate(sizeof(DispatchableCommandBuffer), REQUIRED_MEMORY_ALIGNMENT,
 		                                  DEVICE_MEMORY, DispatchableCommandBuffer::GetAllocationScope());
 		ASSERT(deviceMemory);
-		DispatchableCommandBuffer *commandBuffer = new(deviceMemory) DispatchableCommandBuffer(level);
+		DispatchableCommandBuffer *commandBuffer = new(deviceMemory) DispatchableCommandBuffer(device, level);
 		if(commandBuffer)
 		{
 			pCommandBuffers[i] = *commandBuffer;