[native] Update deprecated GrVk type names
These are just aliases for the GPU-backend agnostic type name,
so we should just use them.
This also deletes seemingly unnecessary #includes.
Change-Id: I6d7cb04671fa67c9b59144583a6a296e7acd7b84
Bug: b/309785258
Flag: EXEMPT refactor
diff --git a/libs/renderengine/skia/SkiaVkRenderEngine.cpp b/libs/renderengine/skia/SkiaVkRenderEngine.cpp
index bd50107..a1f917d 100644
--- a/libs/renderengine/skia/SkiaVkRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaVkRenderEngine.cpp
@@ -29,7 +29,6 @@
#include <GrDirectContext.h>
#include <include/gpu/ganesh/vk/GrVkBackendSemaphore.h>
#include <include/gpu/ganesh/vk/GrVkDirectContext.h>
-#include <vk/GrVkExtensions.h>
#include <vk/GrVkTypes.h>
#include <android-base/stringprintf.h>
diff --git a/libs/renderengine/skia/SkiaVkRenderEngine.h b/libs/renderengine/skia/SkiaVkRenderEngine.h
index 0a2f9b2..d2bb3d5 100644
--- a/libs/renderengine/skia/SkiaVkRenderEngine.h
+++ b/libs/renderengine/skia/SkiaVkRenderEngine.h
@@ -17,8 +17,6 @@
#ifndef SF_SKIAVKRENDERENGINE_H_
#define SF_SKIAVKRENDERENGINE_H_
-#include <vk/GrVkBackendContext.h>
-
#include "SkiaRenderEngine.h"
#include "VulkanInterface.h"
#include "compat/SkiaGpuContext.h"
diff --git a/libs/renderengine/skia/VulkanInterface.cpp b/libs/renderengine/skia/VulkanInterface.cpp
index 5e756b0..37b69f6 100644
--- a/libs/renderengine/skia/VulkanInterface.cpp
+++ b/libs/renderengine/skia/VulkanInterface.cpp
@@ -32,21 +32,8 @@
namespace renderengine {
namespace skia {
-GrVkBackendContext VulkanInterface::getGaneshBackendContext() {
- GrVkBackendContext backendContext;
- backendContext.fInstance = mInstance;
- backendContext.fPhysicalDevice = mPhysicalDevice;
- backendContext.fDevice = mDevice;
- backendContext.fQueue = mQueue;
- backendContext.fGraphicsQueueIndex = mQueueIndex;
- backendContext.fMaxAPIVersion = mApiVersion;
- backendContext.fVkExtensions = &mGrExtensions;
- backendContext.fDeviceFeatures2 = mPhysicalDeviceFeatures2;
- backendContext.fGetProc = mGrGetProc;
- backendContext.fProtectedContext = mIsProtected ? Protected::kYes : Protected::kNo;
- backendContext.fDeviceLostContext = this; // VulkanInterface is long-lived
- backendContext.fDeviceLostProc = onVkDeviceFault;
- return backendContext;
+VulkanBackendContext VulkanInterface::getGaneshBackendContext() {
+ return this->getGraphiteBackendContext();
};
VulkanBackendContext VulkanInterface::getGraphiteBackendContext() {
@@ -57,7 +44,7 @@
backendContext.fQueue = mQueue;
backendContext.fGraphicsQueueIndex = mQueueIndex;
backendContext.fMaxAPIVersion = mApiVersion;
- backendContext.fVkExtensions = &mGrExtensions;
+ backendContext.fVkExtensions = &mVulkanExtensions;
backendContext.fDeviceFeatures2 = mPhysicalDeviceFeatures2;
backendContext.fGetProc = mGrGetProc;
backendContext.fProtectedContext = mIsProtected ? Protected::kYes : Protected::kNo;
@@ -429,11 +416,11 @@
mDeviceExtensionNames.push_back(devExt.extensionName);
}
- mGrExtensions.init(sGetProc, instance, physicalDevice, enabledInstanceExtensionNames.size(),
- enabledInstanceExtensionNames.data(), enabledDeviceExtensionNames.size(),
- enabledDeviceExtensionNames.data());
+ mVulkanExtensions.init(sGetProc, instance, physicalDevice, enabledInstanceExtensionNames.size(),
+ enabledInstanceExtensionNames.data(), enabledDeviceExtensionNames.size(),
+ enabledDeviceExtensionNames.data());
- if (!mGrExtensions.hasExtension(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, 1)) {
+ if (!mVulkanExtensions.hasExtension(VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, 1)) {
BAIL("Vulkan driver doesn't support external semaphore fd");
}
@@ -458,7 +445,7 @@
tailPnext = &mProtectedMemoryFeatures->pNext;
}
- if (mGrExtensions.hasExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME, 1)) {
+ if (mVulkanExtensions.hasExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME, 1)) {
mDeviceFaultFeatures = new VkPhysicalDeviceFaultFeaturesEXT;
mDeviceFaultFeatures->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT;
mDeviceFaultFeatures->pNext = nullptr;
@@ -484,7 +471,7 @@
queuePriority,
};
- if (mGrExtensions.hasExtension(VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME, 2)) {
+ if (mVulkanExtensions.hasExtension(VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME, 2)) {
queueNextPtr = &queuePriorityCreateInfo;
}
@@ -606,7 +593,7 @@
mQueue = VK_NULL_HANDLE; // Implicitly destroyed by destroying mDevice.
mQueueIndex = 0;
mApiVersion = 0;
- mGrExtensions = skgpu::VulkanExtensions();
+ mVulkanExtensions = skgpu::VulkanExtensions();
mGrGetProc = nullptr;
mIsProtected = false;
mIsRealtimePriority = false;
diff --git a/libs/renderengine/skia/VulkanInterface.h b/libs/renderengine/skia/VulkanInterface.h
index f20b002..d0fe4d1 100644
--- a/libs/renderengine/skia/VulkanInterface.h
+++ b/libs/renderengine/skia/VulkanInterface.h
@@ -16,7 +16,7 @@
#pragma once
-#include <include/gpu/vk/GrVkBackendContext.h>
+#include <include/gpu/vk/VulkanBackendContext.h>
#include <include/gpu/vk/VulkanExtensions.h>
#include <include/gpu/vk/VulkanTypes.h>
@@ -24,10 +24,6 @@
using namespace skgpu;
-namespace skgpu {
-struct VulkanBackendContext;
-} // namespace skgpu
-
namespace android {
namespace renderengine {
namespace skia {
@@ -48,7 +44,8 @@
bool takeOwnership();
void teardown();
- GrVkBackendContext getGaneshBackendContext();
+ // TODO(b/309785258) Combine these into one now that they are the same implementation.
+ VulkanBackendContext getGaneshBackendContext();
VulkanBackendContext getGraphiteBackendContext();
VkSemaphore createExportableSemaphore();
VkSemaphore importSemaphoreFromSyncFd(int syncFd);
@@ -86,7 +83,7 @@
VkQueue mQueue = VK_NULL_HANDLE;
int mQueueIndex = 0;
uint32_t mApiVersion = 0;
- skgpu::VulkanExtensions mGrExtensions;
+ skgpu::VulkanExtensions mVulkanExtensions;
VkPhysicalDeviceFeatures2* mPhysicalDeviceFeatures2 = nullptr;
VkPhysicalDeviceSamplerYcbcrConversionFeatures* mSamplerYcbcrConversionFeatures = nullptr;
VkPhysicalDeviceProtectedMemoryFeatures* mProtectedMemoryFeatures = nullptr;
diff --git a/libs/renderengine/skia/compat/GaneshGpuContext.cpp b/libs/renderengine/skia/compat/GaneshGpuContext.cpp
index b2eae00..b121fe8 100644
--- a/libs/renderengine/skia/compat/GaneshGpuContext.cpp
+++ b/libs/renderengine/skia/compat/GaneshGpuContext.cpp
@@ -25,7 +25,7 @@
#include <include/gpu/ganesh/gl/GrGLDirectContext.h>
#include <include/gpu/ganesh/vk/GrVkDirectContext.h>
#include <include/gpu/gl/GrGLInterface.h>
-#include <include/gpu/vk/GrVkBackendContext.h>
+#include <include/gpu/vk/VulkanBackendContext.h>
#include "../AutoBackendTexture.h"
#include "GaneshBackendTexture.h"
@@ -56,10 +56,10 @@
}
std::unique_ptr<SkiaGpuContext> SkiaGpuContext::MakeVulkan_Ganesh(
- const GrVkBackendContext& grVkBackendContext,
+ const skgpu::VulkanBackendContext& vkBackendContext,
GrContextOptions::PersistentCache& skSLCacheMonitor) {
return std::make_unique<GaneshGpuContext>(
- GrDirectContexts::MakeVulkan(grVkBackendContext, ganeshOptions(skSLCacheMonitor)));
+ GrDirectContexts::MakeVulkan(vkBackendContext, ganeshOptions(skSLCacheMonitor)));
}
GaneshGpuContext::GaneshGpuContext(sk_sp<GrDirectContext> grContext) : mGrContext(grContext) {
diff --git a/libs/renderengine/skia/compat/SkiaGpuContext.h b/libs/renderengine/skia/compat/SkiaGpuContext.h
index 282dfe7..9fa6fb8 100644
--- a/libs/renderengine/skia/compat/SkiaGpuContext.h
+++ b/libs/renderengine/skia/compat/SkiaGpuContext.h
@@ -23,7 +23,6 @@
#include <include/gpu/GrDirectContext.h>
#include <include/gpu/gl/GrGLInterface.h>
#include <include/gpu/graphite/Context.h>
-#include <include/gpu/vk/GrVkBackendContext.h>
#include "include/gpu/vk/VulkanBackendContext.h"
#include "SkiaBackendTexture.h"
@@ -52,10 +51,10 @@
GrContextOptions::PersistentCache& skSLCacheMonitor);
/**
- * grVkBackendContext must remain valid until after SkiaGpuContext is destroyed.
+ * vkBackendContext must remain valid until after SkiaGpuContext is destroyed.
*/
static std::unique_ptr<SkiaGpuContext> MakeVulkan_Ganesh(
- const GrVkBackendContext& grVkBackendContext,
+ const skgpu::VulkanBackendContext& vkBackendContext,
GrContextOptions::PersistentCache& skSLCacheMonitor);
// TODO: b/293371537 - Need shader / pipeline monitoring support in Graphite.