Repository navigation
refactor: OSMesa 从内置剥离为 FCLRendererPlugin 插件,保留原生加载通路 - #1959
Merged
Merged
Conversation
…ibvirgl_test_server、libvirglrenderer_1 与内置 Freedreno/VirGL 渲染器条目,保留全部原生加载通路并为插件渲染器补全 VIRGL_TEST_SERVER/VTEST_SOCKET_NAME/MESA_GLSL_CACHE_DIR 运行时路径
…搜不到插件目录导致 SIGSEGV
…3+ 声明),首帧 flush 写只读代码页 SIGSEGV;改为按保存的宽高分配真实缓冲区
…keCurrent 守卫跳过本次绑定,避免 OOM 时向 OSMesaMakeCurrent 传 NULL
…/ID_FREEDRENO 分支与无关 VTEST_SOCKET_NAME),删除未引用的 VirGL/Freedreno 字符串资源
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机
OSMesa 离屏渲染路径依赖两份独立构建的 Mesa(libOSMesa_8.so=Mesa 23.0.4 zink/freedreno、libOSMesa_81.so=Mesa 21.2.1 virgl),每个 ABI 占 APK 约 26-30MB(三 ABI 共 ~95MB 未压缩,压缩率仅 ~12%)。本 PR 将这些库从 APK 移除,改为由 FCLRendererPlugin 的
freedreno/virgl分支以插件形式提供(遵循既有"分支即插件"模式,与 zink/angle/gl4es 分支一致)。改动
删除
libOSMesa_8.so、libOSMesa_81.so、libvirgl_test_server.so(arm64/armv7/x86_64)、libvirglrenderer_1.so(armv7/x86_64)RendererManager内置 VirGL/Freedreno 渲染器条目(旧存档选择经getRenderer自动回落 NGGL4ES,RendererSelectDialog对缺失 id 已有保护)保留(外部插件的加载通路不动)
ctxbridges/osm_bridge、osmesa_loader、virgl/全部原生加载代码FCLauncher内置 VirGL/Freedreno env 分支(Renderer.ID_*常量保留)pojavRendererId透传与LIB_MESA_NAME/MESA_LIBRARY插件路径前缀逻辑插件渲染器通路补全(均为 if-absent,不覆盖插件值)
FCLauncher:插件渲染器自动补MESA_GLSL_CACHE_DIR;POJAV_RENDERER=gallium_virgl时补VTEST_SOCKET_NAMEFCLauncher+virgl.c:插件目录内存在libvirgl_test_server.so时经VIRGL_TEST_SERVER绝对路径加载(原生侧默认只在主 APK 目录找)真机测试暴露的两处修复(diting / SM8475 / Android 15)
dlsym_OSMesaVIRGL 分支裸库名dlopen("libOSMesa_81.so")在类加载器命名空间下搜不到插件目录(LD_LIBRARY_PATH对命名空间无效)→ 改为LIB_MESA_NAME优先virglMakeCurrent把 libc 的setbuffer()函数地址(bionic API 23+ 声明)误当 OSMesa 颜色缓冲传给OSMesaMakeCurrent,首帧 flush 写只读代码页 SIGSEGV → 改为按宽高分配真实缓冲区(呈现由 vtest 服务端 EGL surface 直出,该缓冲仅为管线要求的可写内存)兼容性
测试
\-Darch=arm64assembleDebug 编译通过插件侧
freedreno、virgl分支(Freedreno:libOSMesa_8.so / VirGLRenderer:libOSMesa_81.so,均含 pojavEnv 与三 ABI 库)