浏览代码

update bee build & vulkan opengl texture

/siyaoH-1.17-vulkan
siyao 4 年前
当前提交
47979a75
共有 2 个文件被更改,包括 30 次插入12 次删除
  1. 18
      engine/Build.bee.cs
  2. 24
      engine/src/shell/platform/unity/android/unity_surface_manager.cc

18
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 UserNDKLocator: AndroidNdkLocator
// {
// public UserNDKLocator(): base(Architecture.Armv7) { }
// public AndroidNdk xx(NPath path)
// {
// }
// }
//ios build helpers
class UserIOSSdkLocator : IOSSdkLocator

public IOSAppToolchain() : base((new UserIOSSdkLocator()).UserIOSSdk(XcodePath))
{
}
// public AndroidToolChain():base((new UserNDKLocator()).UserDefault()
// {
// }
}
/**

"-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-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",

var deoployNp = buildNP.DeployTo("../com.unity.uiwidgets/Runtime/Plugins/Android");
dependencies.Add(buildNP.Path);
dependencies.Add(deoployNp.Path);
buildNP.DeployTo("/Users/siyao/temp/androidBuild/Vulkan28/unityLibrary/src/main/jniLibs/armeabi-v7a");
}
np.ValidConfigurations = validConfigurations;
}

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


std::tie(success, egl_resource_context_) = CreateContext(egl_display_, egl_config_, egl_context_);
eglMakeCurrent(egl_display_, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_context_);
// glewInit();
glGenFramebuffers(1, &fbo_);
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
error = eglGetError();
GLuint mTexture = 0;
glGenTextures(1, &mTexture);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D , mTexture, 0);
// glewInit();
error = eglGetError();
EGLClientBuffer clientBuffer = eglGetNativeClientBufferANDROID(buffer);
error = eglGetError();
bool isProtectedContent = true;

// EGLImageKHR imagekhr = eglCreateImageKHR(egl_display_, egl_context_, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, attribs);
EGLImageKHR imagekhr = eglCreateImageKHR(egl_display_, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, attribs);
//EGLImageKHR imagekhr = eglCreateImageKHR(egl_display_, egl_context_, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, attribs);
EGLImageKHR imagekhr = eglCreateImageKHR(egl_display_, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, clientBuffer, attribs);
error = eglGetError();
glGenFramebuffers(1, &fbo_);
error = eglGetError();
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
error = eglGetError();
GLuint mTexture = 0;
glGenTextures(1, &mTexture);
error = eglGetError();
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, imagekhr);
error = eglGetError();

正在加载...
取消
保存