Add RenderThreadInfoVk
... and move VkDecoder into a RenderThreadInfoVk to have an object
to package VK info into to parallel RenderThreadInfoGl in
aosp/2167843.
This is useful for upcoming changes to avoid a circular dependency
between `libgfxstream_backend` and `gfxstream_vulkan_server` when
wanting to have thread info in VkDecoderGlobalState.
Bug: b/233939967
Test: cvd start --gpu_mode=gfxstream --enable_gpu_angle=true
Change-Id: I6cb73a122253e0e897100ba95c1bff32c0234310
diff --git a/stream-servers/RenderThread.cpp b/stream-servers/RenderThread.cpp
index 5310e2b..88eb3b8 100644
--- a/stream-servers/RenderThread.cpp
+++ b/stream-servers/RenderThread.cpp
@@ -295,7 +295,7 @@
// it's completely initialized before running any GL commands.
FrameBuffer::waitUntilInitialized();
if (goldfish_vk::getGlobalVkEmulation()) {
- tInfo.m_vkDec = std::make_unique<VkDecoder>();
+ tInfo.m_vkInfo.emplace();
}
// This is the only place where we try loading from snapshot.
@@ -451,9 +451,9 @@
//
// Note: It's risky to limit Vulkan decoding to one thread,
// so we do it outside the limiter
- if (tInfo.m_vkDec) {
- last = tInfo.m_vkDec->decode(readBuf.buf(), readBuf.validData(), ioStream, seqnoPtr,
- gfxLogger);
+ if (tInfo.m_vkInfo) {
+ last = tInfo.m_vkInfo->m_vkDec.decode(readBuf.buf(), readBuf.validData(), ioStream,
+ seqnoPtr, gfxLogger);
if (last > 0) {
readBuf.consume(last);
progress = true;