Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce447b00 authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

Merge \\"Use the first Vulkan layer path\\" into nyc-mr1-dev am: bbadc5d3

am: 4f9e02e4

Change-Id: I140125840832f895b39ff29792883d0fec4fc110
parents 0654d888 4f9e02e4
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -14,6 +14,8 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


#define LOG_TAG "ApplicationLoaders"

#include <nativehelper/ScopedUtfChars.h>
#include <nativehelper/ScopedUtfChars.h>
#include <nativeloader/native_loader.h>
#include <nativeloader/native_loader.h>
#include <vulkan/vulkan_loader_data.h>
#include <vulkan/vulkan_loader_data.h>
@@ -22,10 +24,17 @@


static void setupVulkanLayerPath_native(JNIEnv* env, jobject clazz,
static void setupVulkanLayerPath_native(JNIEnv* env, jobject clazz,
        jobject classLoader, jstring librarySearchPath) {
        jobject classLoader, jstring librarySearchPath) {
    android_namespace_t* ns = android::FindNamespaceByClassLoader(env, classLoader);
    ScopedUtfChars layerPathChars(env, librarySearchPath);
    ScopedUtfChars layerPathChars(env, librarySearchPath);

    vulkan::LoaderData& loader_data = vulkan::LoaderData::GetInstance();
    vulkan::LoaderData& loader_data = vulkan::LoaderData::GetInstance();
    if (loader_data.layer_path.empty()) {
        loader_data.layer_path = layerPathChars.c_str();
        loader_data.layer_path = layerPathChars.c_str();
    loader_data.app_namespace = android::FindNamespaceByClassLoader(env, classLoader);
        loader_data.app_namespace = ns;
    } else {
        ALOGD("ignored Vulkan layer search path %s for namespace %p",
                layerPathChars.c_str(), ns);
    }
}
}


static const JNINativeMethod g_methods[] = {
static const JNINativeMethod g_methods[] = {