summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-20 23:01:30 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-04-20 23:01:30 +0000
commit50d964e48e37e2338682a215394ffb41659cd831 (patch)
treedb0045eaa070657671a8bf3cda9d06ded022772f
parent1bab8cc7fc48efa2226cfd5e86fd9628bc799e5f (diff)
parent179e89150c130948e1784c59c185fa4b62b4292b (diff)
downloadvulkan-cereal-50d964e48e37e2338682a215394ffb41659cd831.tar.gz
Snap for 9982304 from 179e89150c130948e1784c59c185fa4b62b4292b to udc-d1-release
Change-Id: I84dc03252710a5e7481f2c97e627464d8daf9f24
-rw-r--r--stream-servers/vulkan/VkDecoderGlobalState.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/stream-servers/vulkan/VkDecoderGlobalState.cpp b/stream-servers/vulkan/VkDecoderGlobalState.cpp
index 7ad1b1ca..1922dbef 100644
--- a/stream-servers/vulkan/VkDecoderGlobalState.cpp
+++ b/stream-servers/vulkan/VkDecoderGlobalState.cpp
@@ -3756,9 +3756,14 @@ class VkDecoderGlobalState::Impl {
}
std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* deviceInfo = android::base::find(mDeviceInfo, device);
+ if (!deviceInfo) return VK_ERROR_UNKNOWN;
+
for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) {
mCmdBufferInfo[pCommandBuffers[i]] = CommandBufferInfo();
mCmdBufferInfo[pCommandBuffers[i]].device = device;
+ mCmdBufferInfo[pCommandBuffers[i]].debugUtilsHelper = deviceInfo->debugUtilsHelper;
mCmdBufferInfo[pCommandBuffers[i]].cmdPool = pAllocateInfo->commandPool;
auto boxed = new_boxed_VkCommandBuffer(pCommandBuffers[i], vk,
false /* does not own dispatch */);
@@ -4199,8 +4204,16 @@ class VkDecoderGlobalState::Impl {
}
std::lock_guard<std::recursive_mutex> lock(mLock);
- auto& bufferInfo = mCmdBufferInfo[commandBuffer];
- bufferInfo.reset();
+
+ auto* commandBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!commandBufferInfo) return VK_ERROR_UNKNOWN;
+ commandBufferInfo->reset();
+
+ if (context.processName) {
+ commandBufferInfo->debugUtilsHelper.cmdBeginDebugLabel(commandBuffer, "Process %s",
+ context.processName);
+ }
+
return VK_SUCCESS;
}
@@ -4217,6 +4230,15 @@ class VkDecoderGlobalState::Impl {
auto commandBuffer = unbox_VkCommandBuffer(boxed_commandBuffer);
auto vk = dispatch_VkCommandBuffer(boxed_commandBuffer);
+ std::lock_guard<std::recursive_mutex> lock(mLock);
+
+ auto* commandBufferInfo = android::base::find(mCmdBufferInfo, commandBuffer);
+ if (!commandBufferInfo) return VK_ERROR_UNKNOWN;
+
+ if (context.processName) {
+ commandBufferInfo->debugUtilsHelper.cmdEndDebugLabel(commandBuffer);
+ }
+
return vk->vkEndCommandBuffer(commandBuffer);
}
@@ -5696,6 +5718,7 @@ class VkDecoderGlobalState::Impl {
VkDevice device = VK_NULL_HANDLE;
VkCommandPool cmdPool = VK_NULL_HANDLE;
VkCommandBuffer boxed = VK_NULL_HANDLE;
+ DebugUtilsHelper debugUtilsHelper = DebugUtilsHelper::withUtilsDisabled();
// Most recently bound compute pipeline and descriptor sets. We save it here so that we can
// restore it after doing emulated texture decompression.