比较提交

...
此合并请求有变更与目标分支冲突。
/engine/Build.bee.cs
/engine/src/shell/platform/unity/android/uiwidgets_panel.h
/engine/src/shell/platform/unity/android/uiwidgets_panel.cc
/com.unity.uiwidgets/Runtime/engine/UIWidgetsPanelWrapper.cs

3 次代码提交

作者 SHA1 备注 提交日期
siyao 82b622e7 vulkan support 3 年前
siyao a9d23021 fix 3 年前
siyao d41bceb1 onRenderTexture 3 年前
共有 7 个文件被更改,包括 340 次插入110 次删除
  1. 70
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanelWrapper.cs
  2. 17
      engine/Build.bee.cs
  3. 1
      engine/src/shell/gpu/gpu_surface_gl.cc
  4. 68
      engine/src/shell/platform/unity/android/uiwidgets_panel.cc
  5. 6
      engine/src/shell/platform/unity/android/uiwidgets_panel.h
  6. 263
      engine/src/shell/platform/unity/android/unity_surface_manager.cc
  7. 25
      engine/src/shell/platform/unity/android/unity_surface_manager.h

70
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanelWrapper.cs


namespace Unity.UIWidgets.engine {
#region Platform: MacOs/iOS/Windows Specific Functionalities
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_ANDROID
public partial class UIWidgetsPanelWrapper {
Texture _renderTexture;

void _enableUIWidgetsPanel(string font_settings) {
D.assert(_renderTexture == null);
#if !UNITY_EDITOR && UNITY_ANDROID
IntPtr native_tex_ptr = UIWidgetsPanel_onEnable(_ptr, _width, _height, devicePixelRatio,
Application.temporaryCachePath, font_settings);
#else
#endif
D.assert(native_tex_ptr != IntPtr.Zero);
_renderTexture =

[DllImport(NativeBindings.dllName)]
static extern IntPtr UIWidgetsPanel_onRenderTexture(
IntPtr ptr, int width, int height, float dpi);
#region Platform: Android Runtime Specific Functionalities
#if (!UNITY_EDITOR && UNITY_ANDROID )
public partial class UIWidgetsPanelWrapper {
RenderTexture _renderTexture;
public RenderTexture renderTexture {
get { return _renderTexture; }
}
void _createRenderTexture(int width, int height, float devicePixelRatio) {
D.assert(_renderTexture == null);
var desc = new RenderTextureDescriptor(
width, height, RenderTextureFormat.ARGB32, 0) {
useMipMap = false,
autoGenerateMips = false,
};
_renderTexture = new RenderTexture(desc) {hideFlags = HideFlags.HideAndDontSave};
_renderTexture.Create();
_width = width;
_height = height;
this.devicePixelRatio = devicePixelRatio;
}
void _destroyRenderTexture() {
D.assert(_renderTexture != null);
ObjectUtils.SafeDestroy(_renderTexture);
_renderTexture = null;
}
void _enableUIWidgetsPanel(string font_settings) {
UIWidgetsPanel_onEnable(_ptr, _renderTexture.GetNativeTexturePtr(),
_width, _height, devicePixelRatio, Application.temporaryCachePath, font_settings);
}
void _resizeUIWidgetsPanel() {
UIWidgetsPanel_onRenderTexture(_ptr,
_renderTexture.GetNativeTexturePtr(),
_width, _height, devicePixelRatio);
}
void _disableUIWidgetsPanel() {
_renderTexture = null;
}
[DllImport(NativeBindings.dllName)]
static extern void UIWidgetsPanel_onEnable(IntPtr ptr,
IntPtr nativeTexturePtr, int width, int height, float dpi, string streamingAssetsPath,
string font_settings);
[DllImport(NativeBindings.dllName)]
static extern void UIWidgetsPanel_onRenderTexture(
IntPtr ptr, IntPtr nativeTexturePtr, int width, int height, float dpi);
}
#endif
#endregion
#region Window Common Properties and Functions
public partial class UIWidgetsPanelWrapper {

17
engine/Build.bee.cs


using Bee.Toolchain.GNU;
using Bee.Toolchain.IOS;
using System.Diagnostics;
using Bee.Toolchain.Android;
enum UIWidgetsBuildTargetPlatform
{

{
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
}
}
class AndroidAppToolchain : AndroidNdkToolchain
{
public AndroidAppToolchain(NPath path) : base(new AndroidNdkLocator(Architecture.Armv7).UseSpecific(path).WithForcedApiLevel(28))
{
}
}
//ios build helpers

"SK_CODEC_DECODES_WEBP",
"SK_ENCODE_WEBP",
"SK_XML",
"EGL_EGLEXT_PROTOTYPES",
"GL_GLEXT_PROTOTYPES",
//"UIWIDGETS_ENGINE_VERSION=\"0.0\"",
//"SKIA_VERSION=\"0.0\"",

"-nostdlib++",
"-Wl,--warn-shared-textrel",
"-nostdlib",
"--sysroot="+ flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm",
"--sysroot="+ flutterRoot+"/third_party/android_tools/ndk/platforms/android-28/arch-arm",
"-L"+ flutterRoot + "/third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
"-Wl,--build-id=sha1",
"-g",

}
else if (platform == UIWidgetsBuildTargetPlatform.android)
{
var androidToolchain = ToolChain.Store.Android().r19().Armv7();
var androidToolchain = new AndroidAppToolchain(new NPath ("/Users/siyao/temp/flutter/engine/src/third_party/android_tools/ndk"));
var validConfigurations = new List<NativeProgramConfiguration>();

new SystemLibrary("EGL"),
new SystemLibrary("GLESv2"),
new SystemLibrary("log"),
new SystemLibrary("vulkan"),
};
});
}

1
engine/src/shell/gpu/gpu_surface_gl.cc


if (delegate_->GLContextFBOResetAfterPresent()) {
auto current_size =
SkISize::Make(onscreen_surface_->width(), onscreen_surface_->height());
context_->resetContext();
// The FBO has changed, ask the delegate for the new FBO and do a surface
// re-wrap.

68
engine/src/shell/platform/unity/android/uiwidgets_panel.cc


return window_type_ == EditorWindowPanel;
}
void UIWidgetsPanel::OnEnable(void *native_texture_ptr, size_t width,
size_t height, float device_pixel_ratio,
const char *streaming_assets_path,
const char *settings)
void* UIWidgetsPanel::OnEnable(size_t width,
size_t height, float device_pixel_ratio,
const char *streaming_assets_path,
const char *settings)
{
surface_manager_ = std::make_unique<UnitySurfaceManager>(
UIWidgetsSystem::GetInstancePtr()->GetUnityInterfaces());

fbo_ = surface_manager_->CreateRenderSurface(native_texture_ptr);
fbo_ = surface_manager_->CreateRenderSurface(width, height);
surface_manager_->ClearCurrent();
fml::AutoResetWaitableEvent latch;

{
std::cerr << "Failed to start UIWidgets engine: error " << result
<< std::endl;
return;
return 0;
}
engine_ = engine;

process_events_ = true;
return surface_manager_->GetTexture();
}
void UIWidgetsPanel::MonoEntrypoint() { entrypoint_callback_(handle_); }

surface_manager_ = nullptr;
}
void UIWidgetsPanel::OnRenderTexture(void *native_texture_ptr, size_t width,
size_t height, float device_pixel_ratio)
void* UIWidgetsPanel::OnRenderTexture(size_t width,
size_t height, float device_pixel_ratio)
reinterpret_cast<EmbedderEngine *>(engine_)->PostRenderThreadTask(
[this, native_texture_ptr]() -> void {
surface_manager_->MakeCurrent(EGL_NO_DISPLAY);
if (fbo_)
{
surface_manager_->DestroyRenderSurface();
fbo_ = 0;
}
fbo_ = surface_manager_->CreateRenderSurface(native_texture_ptr);
surface_manager_->ClearCurrent();
});
ViewportMetrics metrics;
metrics.physical_width = static_cast<float>(width);

surface_manager_->MakeCurrent(EGL_NO_DISPLAY);
if (fbo_)
{
surface_manager_->DestroyRenderSurface();
fbo_ = 0;
}
fbo_ = surface_manager_->CreateRenderSurface(width, height);
surface_manager_->ClearCurrent();
return surface_manager_->GetTexture();
}
int UIWidgetsPanel::RegisterTexture(void *native_texture_ptr)

}
}
bool UIWidgetsPanel::ReleaseNativeRenderTexture()
{
// for android this process is done during OnRenderTexture
//surface_manager_->DestroyRenderSurface();
return true;
}
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown)
{
if (process_events_)

panel->Release();
}
UIWIDGETS_API(void)
UIWidgetsPanel_onEnable(UIWidgetsPanel *panel, void *native_texture_ptr,
UIWIDGETS_API(void*)
UIWidgetsPanel_onEnable(UIWidgetsPanel *panel,
panel->OnEnable(native_texture_ptr, width, height, device_pixel_ratio,
streaming_assets_path, settings);
return (void*)panel->OnEnable(width, height, device_pixel_ratio,
streaming_assets_path, settings);
}
UIWIDGETS_API(void)

}
UIWIDGETS_API(void)
UIWidgetsPanel_onRenderTexture(UIWidgetsPanel *panel, void *native_texture_ptr,
UIWIDGETS_API(void*)
UIWidgetsPanel_onRenderTexture(UIWidgetsPanel *panel,
panel->OnRenderTexture(native_texture_ptr, width, height, dpi);
return panel->OnRenderTexture(width, height, dpi);
}
UIWIDGETS_API(bool)
UIWidgetsPanel_releaseNativeTexture(UIWidgetsPanel *panel)
{
return panel->ReleaseNativeRenderTexture();
}
UIWIDGETS_API(int)

6
engine/src/shell/platform/unity/android/uiwidgets_panel.h


~UIWidgetsPanel();
void OnEnable(void* native_texture_ptr, size_t width, size_t height,
void* OnEnable(size_t width, size_t height,
float device_pixel_ratio, const char* streaming_assets_path,
const char* settings);

void OnRenderTexture(void* native_texture_ptr, size_t width, size_t height,
void* OnRenderTexture(size_t width, size_t height,
bool ReleaseNativeRenderTexture();
int RegisterTexture(void* native_texture_ptr);
void UnregisterTexture(int texture_id);

263
engine/src/shell/platform/unity/android/unity_surface_manager.cc


#include <flutter/fml/logging.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2ext.h>
#include <android/hardware_buffer.h>
#define UNITY_USED_VULKAN_API_FUNCTIONS(apply) \
apply(vkGetDeviceProcAddr); \
apply(vkCreateInstance); \
apply(vkCmdBeginRenderPass); \
apply(vkCreateBuffer); \
apply(vkGetPhysicalDeviceMemoryProperties); \
apply(vkGetBufferMemoryRequirements); \
apply(vkMapMemory); \
apply(vkBindBufferMemory); \
apply(vkAllocateMemory); \
apply(vkDestroyBuffer); \
apply(vkFreeMemory); \
apply(vkUnmapMemory); \
apply(vkQueueWaitIdle); \
apply(vkDeviceWaitIdle); \
apply(vkCmdCopyBufferToImage); \
apply(vkFlushMappedMemoryRanges); \
apply(vkCreatePipelineLayout); \
apply(vkCreateShaderModule); \
apply(vkDestroyShaderModule); \
apply(vkCreateGraphicsPipelines); \
apply(vkCmdBindPipeline); \
apply(vkCmdDraw); \
apply(vkCmdPushConstants); \
apply(vkCmdBindVertexBuffers); \
apply(vkDestroyPipeline); \
apply(vkGetAndroidHardwareBufferPropertiesANDROID); \
apply(vkDestroyPipelineLayout);
#define VULKAN_DEFINE_API_FUNCPTR(func) static PFN_##func my_##func
VULKAN_DEFINE_API_FUNCPTR(vkGetInstanceProcAddr);
UNITY_USED_VULKAN_API_FUNCTIONS(VULKAN_DEFINE_API_FUNCPTR);
#undef VULKAN_DEFINE_API_FUNCPTR
static void LoadVulkanAPI(PFN_vkGetInstanceProcAddr getInstanceProcAddr,
VkInstance instance)
{
if (!my_vkGetInstanceProcAddr && getInstanceProcAddr)
my_vkGetInstanceProcAddr = getInstanceProcAddr;
if (!my_vkCreateInstance)
my_vkCreateInstance = (PFN_vkCreateInstance)my_vkGetInstanceProcAddr(
VK_NULL_HANDLE, "vkCreateInstance");
#define LOAD_VULKAN_FUNC(fn) \
if (!my_##fn) \
my_##fn = (PFN_##fn)my_vkGetInstanceProcAddr(instance, #fn)
UNITY_USED_VULKAN_API_FUNCTIONS(LOAD_VULKAN_FUNC);
#undef LOAD_VULKAN_FUNC
}
static bool getMemoryTypeIndex(uint32_t typeBits, VkPhysicalDevice device, VkFlags quirementsMaks,
uint32_t &index)
{
// const auto& memoryPropertys =
// VulkanManager::Get().physical->mempryProperties;
VkPhysicalDeviceMemoryProperties memoryPropertys;
vkGetPhysicalDeviceMemoryProperties(device, &memoryPropertys);
for (uint32_t i = 0; i < memoryPropertys.memoryTypeCount; i++)
{
if ((typeBits & 1) == 1)
{
// Type is available, does it match user properties?
if ((memoryPropertys.memoryTypes[i].propertyFlags &
quirementsMaks) == quirementsMaks)
{
index = i;
return true;
}
}
typeBits >>= 1;
}
return false;
}
namespace uiwidgets
{

UnitySurfaceManager::~UnitySurfaceManager() { CleanUp(); }
GLuint UnitySurfaceManager::CreateRenderSurface(void *native_texture_ptr)
GLuint UnitySurfaceManager::CreateRenderSurface(size_t width, size_t height)
GLint old_framebuffer_binding;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &old_framebuffer_binding);
buffer = nullptr;
AHardwareBuffer_Desc usage = {};
// filling in the usage for HardwareBuffer
usage.format = AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM;
usage.height = height; //format.height;
usage.width = width; //format.width;
usage.layers = 1;
usage.rfu0 = 0;
usage.rfu1 = 0;
usage.stride = 10;
usage.usage = AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN |
AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER |
AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT;
FML_CHECK(AHardwareBuffer_allocate(&usage, &buffer) == 0);
if (m_UnityVulkan != nullptr)
{
auto vkDevice = m_Instance.device;
// auto memoryPropertys = m_Instance.memoryTypeIndex;
// VkImage vkImage;
bool useExternalFormat = true;
VkResult err;
AHardwareBuffer_Desc bufferDesc;
AHardwareBuffer_describe(buffer, &bufferDesc);
VkAndroidHardwareBufferFormatPropertiesANDROID formatInfo = {
.sType =
VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_ANDROID,
.pNext = nullptr,
};
VkAndroidHardwareBufferPropertiesANDROID properties = {
.sType = VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_PROPERTIES_ANDROID,
.pNext = &formatInfo,
};
err = vkGetAndroidHardwareBufferPropertiesANDROID(vkDevice, buffer, &properties);
VkExternalFormatANDROID externalFormat{
.sType = VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID,
.pNext = nullptr,
.externalFormat = formatInfo.externalFormat,
};
VkExternalMemoryImageCreateInfo externalCreateInfo{
.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO,
.pNext = &externalFormat,
.handleTypes =
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID,
};
VkImageCreateInfo imageInfo = {};
imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
imageInfo.pNext = &externalCreateInfo;
imageInfo.flags = 0;
imageInfo.imageType = VK_IMAGE_TYPE_2D;
imageInfo.format =
VK_FORMAT_UNDEFINED;
imageInfo.extent = {
bufferDesc.width,
bufferDesc.height,
1,
};
imageInfo.mipLevels = 1, imageInfo.arrayLayers = 1;
imageInfo.samples = VK_SAMPLE_COUNT_1_BIT;
imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT;
imageInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
imageInfo.queueFamilyIndexCount = 0;
imageInfo.pQueueFamilyIndices = nullptr;
imageInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
auto result = vkCreateImage(vkDevice, &imageInfo, nullptr, &vk_Image_);
VkImportAndroidHardwareBufferInfoANDROID androidHardwareBufferInfo{
.sType = VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID,
.pNext = nullptr,
.buffer = buffer,
};
VkMemoryDedicatedAllocateInfo memoryAllocateInfo{
.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
.pNext = &androidHardwareBufferInfo,
.image = vk_Image_,
.buffer = VK_NULL_HANDLE,
};
// android的hardbuffer位置(properties)
VkMemoryRequirements requires;
vkGetImageMemoryRequirements(vkDevice, vk_Image_, &requires);
uint32_t memoryTypeIndex = 0;
bool getIndex =
getMemoryTypeIndex(properties.memoryTypeBits, m_Instance.physicalDevice, 0, memoryTypeIndex);
assert(getIndex);
VkMemoryAllocateInfo memoryInfo = {};
memoryInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
memoryInfo.pNext = &memoryAllocateInfo;
memoryInfo.memoryTypeIndex = memoryTypeIndex;
memoryInfo.allocationSize = properties.allocationSize;
auto al = vkAllocateMemory(vkDevice, &memoryInfo, nullptr, &memory);
VkBindImageMemoryInfo bindImageInfo;
bindImageInfo.sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO;
bindImageInfo.pNext = nullptr;
bindImageInfo.image = vk_Image_;
bindImageInfo.memory = memory;
bindImageInfo.memoryOffset = 0;
// vkBindImageMemory2KHR(vkDevice, 1, &bindImageInfo);
vkBindImageMemory2(vkDevice, 1, &bindImageInfo);
}
EGLClientBuffer native_buffer = eglGetNativeClientBufferANDROID(buffer);
assert(native_buffer);
auto success = false;
EGLint attrs[] = {EGL_NONE};
image = eglCreateImageKHR(egl_display_, EGL_NO_CONTEXT,
EGL_NATIVE_BUFFER_ANDROID, native_buffer, attrs);
egl_texture_ = 0;
glGenTextures(1, &egl_texture_);
glBindTexture(GL_TEXTURE_2D, egl_texture_);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLuint gltex = (GLuint)(size_t)(native_texture_ptr);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gltex, 0);
FML_CHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
glBindFramebuffer(GL_FRAMEBUFFER, old_framebuffer_binding);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, egl_texture_, 0);
// GLuint gltex = (GLuint)(size_t)(native_texture_ptr);
// glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, gltex, 0);
FML_CHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
if (buffer != nullptr)
{
AHardwareBuffer_release(buffer);
}
if (image)
{
eglDestroyImageKHR(egl_display_, image);
}
eglDestroyImageKHR(egl_display_, image);
glDeleteTextures(1, &egl_texture_);
egl_texture_ = 0;
}
bool UnitySurfaceManager::ClearCurrent()

void UnitySurfaceManager::GetUnityContext()
{
if(egl_unity_context_ != nullptr){
if (egl_unity_context_ != nullptr)
{
FML_CHECK(egl_display_ != EGL_NO_DISPLAY)
<< "Renderer type is invalid";
FML_CHECK(egl_display_ != EGL_NO_DISPLAY)
<< "Renderer type is invalid";
auto *graphics = unity_interfaces->Get<IUnityGraphics>();
UnityGfxRenderer renderer = graphics->GetRenderer();
FML_DCHECK(renderer == kUnityGfxRendererOpenGLES30 ||
renderer == kUnityGfxRendererOpenGLES20 ||
renderer == kUnityGfxRendererVulkan);
if (renderer == kUnityGfxRendererVulkan)
{
m_UnityVulkan = unity_interfaces->Get<IUnityGraphicsVulkan>();
m_Instance = m_UnityVulkan->Instance();
LoadVulkanAPI(m_Instance.getInstanceProcAddr, m_Instance.instance);
egl_display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); // eglGetCurrentDisplay(); //
FML_CHECK(egl_display_ != EGL_NO_DISPLAY);
eglBindAPI(EGL_OPENGL_ES_API);
}
// Initialize the display connection.
FML_CHECK(eglInitialize(egl_display_, nullptr, nullptr) == EGL_TRUE)

std::tie(success, egl_context_) = CreateContext(egl_display_, egl_config_, egl_unity_context_);
std::tie(success, egl_resource_context_) = CreateContext(egl_display_, egl_config_, egl_context_);
MakeCurrent(EGL_NO_DISPLAY);
egl_texture_ = 0;
glGenTextures(1, &egl_texture_);
return success;
}

25
engine/src/shell/platform/unity/android/unity_surface_manager.h


#include "Unity/IUnityGraphics.h"
#include "Unity/IUnityGraphicsVulkan.h"
#include "include/gpu/vk/GrVkBackendContext.h"
namespace uiwidgets
{

UnitySurfaceManager(IUnityInterfaces *unity_interfaces);
~UnitySurfaceManager();
GLuint CreateRenderSurface(void *native_texture_ptr);
GLuint CreateRenderSurface(size_t width, size_t height);
void* GetTexture() {
if( m_UnityVulkan != nullptr){
return (void*)&vk_Image_;
}
return (void*)egl_texture_;
}
bool ClearCurrent();
bool MakeCurrent(const EGLSurface surface);

EGLContext egl_context_;
EGLContext egl_resource_context_;
EGLConfig egl_config_;
GLuint egl_texture_;
AHardwareBuffer *buffer;
EGLImageKHR image;
IUnityGraphicsVulkan* m_UnityVulkan = nullptr;
UnityVulkanInstance m_Instance;
sk_sp<GrContext> gr_context_;
sk_sp<SkSurface> m_SkSurface;
VkImage vk_Image_ = 0;
VkDeviceMemory memory;
GLuint fbo_ = 0;
};
正在加载...
取消
保存