summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.cpp')
-rw-r--r--libs/hwui/renderthread/VulkanManager.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 1517f579a084..038e13c513fd 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -40,7 +40,7 @@ namespace renderthread {
VulkanManager::VulkanManager(RenderThread& thread) : mRenderThread(thread) {}
void VulkanManager::destroy() {
- mRenderThread.renderState().onVkContextDestroyed();
+ mRenderThread.renderState().onContextDestroyed();
mRenderThread.setGrContext(nullptr);
if (VK_NULL_HANDLE != mCommandPool) {
@@ -391,7 +391,8 @@ void VulkanManager::initialize() {
GrContextOptions options;
options.fDisableDistanceFieldPaths = true;
- mRenderThread.cacheManager().configureContext(&options);
+ // TODO: get a string describing the SPIR-V compiler version and use it here
+ mRenderThread.cacheManager().configureContext(&options, nullptr, 0);
sk_sp<GrContext> grContext(GrContext::MakeVulkan(backendContext, options));
LOG_ALWAYS_FATAL_IF(!grContext.get());
mRenderThread.setGrContext(grContext);
@@ -404,7 +405,7 @@ void VulkanManager::initialize() {
mSwapBehavior = SwapBehavior::BufferAge;
}
- mRenderThread.renderState().onVkContextCreated();
+ mRenderThread.renderState().onContextCreated();
}
// Returns the next BackbufferInfo to use for the next draw. The function will make sure all
@@ -981,6 +982,22 @@ int VulkanManager::getAge(VulkanSurface* surface) {
return surface->mCurrentTime - lastUsed;
}
+status_t VulkanManager::fenceWait(sp<Fence>& fence) {
+ //TODO: Insert a wait on fence command into the Vulkan command buffer.
+ // Block CPU on the fence.
+ status_t err = fence->waitForever("VulkanManager::fenceWait");
+ if (err != NO_ERROR) {
+ ALOGE("VulkanManager::fenceWait: error waiting for fence: %d", err);
+ return err;
+ }
+ return OK;
+}
+
+status_t VulkanManager::createReleaseFence(sp<Fence>& nativeFence) {
+ //TODO: Create a fence that is signaled, when all the pending Vulkan commands are flushed.
+ return OK;
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */