Open twaik opened 4 months ago
mesa
22.0.5 is the last version without kopper
, and this makes it possible to run zink
over Android's vulkan.
We have wsi-vulkan-layer so kopper should work.
Even if no we have a patch to use zink without kopper with old-fashion copying to shared memory fragment.
We have wsi-vulkan-layer so kopper should work.
I don't think wsi-vulkan-layer
could work on Termux with Android's Vulkan Loader.
For Android's Vulkan Loader, the layer will be searched in /data/local/debug/vulkan
or android::GraphicsEnv::getLayerPaths()
.
void DiscoverLayers() {
ATRACE_CALL();
if (android::GraphicsEnv::getInstance().isDebuggable()) {
DiscoverLayersInPathList(kSystemLayerLibraryDir);
}
if (!android::GraphicsEnv::getInstance().getLayerPaths().empty())
DiscoverLayersInPathList(android::GraphicsEnv::getInstance().getLayerPaths());
}
android::GraphicsEnv::getLayerPaths()
can be controlled by android::GraphicsEnv::setLayerPaths()
, but the latter function is designed to be called from the Java side.
void GraphicsEnv::setLayerPaths(NativeLoaderNamespace* appNamespace,
const std::string& layerPaths) {
if (mLayerPaths.empty()) {
mLayerPaths = layerPaths;
mAppNamespace = appNamespace;
} else {
ALOGV("Vulkan layer search path already set, not clobbering with '%s' for namespace %p'",
layerPaths.c_str(), appNamespace);
}
}
NativeLoaderNamespace* GraphicsEnv::getAppNamespace() {
return mAppNamespace;
}
const std::string& GraphicsEnv::getLayerPaths() {
return mLayerPaths;
}
void setLayerPaths_native(JNIEnv* env, jobject clazz, jobject classLoader, jstring layerPaths) {
android::NativeLoaderNamespace* appNamespace = android::FindNativeLoaderNamespaceByClassLoader(
env, classLoader);
ScopedUtfChars layerPathsChars(env, layerPaths);
android::GraphicsEnv::getInstance().setLayerPaths(appNamespace, layerPathsChars.c_str());
}
/data/local/debug/vulkan
may not be writable for users and setLayerPaths
heavily depends on the Java side.
Even if no we have a patch to use zink without kopper with old-fashion copying to shared memory fragment.
I've tried it but it is much difficult now. Newer mesa
requires lots of other extensions and it is a nightmare to revert every commit about using extension beyond the Android Loader.
@twaik
After applying vulkan-wsi-layer
to Xclipse 940 GPU
of Exynos2400
I compared mesa 24.0.5
from the main repo
and mesa-zink 22.0.5
from the tur repo
.
In OpenGL4.6 & OpenGL ES3.2, mesa-zink 22.0.5
showed better performance and compatibility than mesa 24.0.5
.
Hello. Just a question: do we need mesa-zink package here? Main repo has mesa with zink enabled and there is freedreno icd with termux-x11 support. Do we need duplcating mesa-zink here?