fix Android Vulkan instrumentation tests (#4091)
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
|
||||
#include "vk_mem_alloc.h"
|
||||
|
||||
#ifndef NDEBUG
|
||||
#if !defined(NDEBUG) && !defined(__ANDROID__)
|
||||
#define ENABLE_VULKAN_VALIDATION
|
||||
// #define ENABLE_VULKAN_GPU_ASSISTED_VALIDATION
|
||||
// #define ENABLE_VMA_DEBUG
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
if (!debugUtilsEnabled) return;
|
||||
const uint64_t handle = reinterpret_cast<uint64_t>(static_cast<typename T::CType>(object));
|
||||
device->setDebugUtilsObjectNameEXT(vk::DebugUtilsObjectNameInfoEXT()
|
||||
.setObjectType(object.objectType)
|
||||
.setObjectType(T::objectType)
|
||||
.setObjectHandle(handle)
|
||||
.setPObjectName(name.c_str()),
|
||||
dispatcher);
|
||||
|
||||
@@ -196,11 +196,8 @@ void MapRenderer::requestSnapshot(SnapshotCallback callback) {
|
||||
|
||||
void MapRenderer::resetRenderer() {
|
||||
renderer.reset();
|
||||
#if MLN_RENDER_BACKEND_OPENGL
|
||||
// GL requires the context managed by the java surface for cleanup
|
||||
// Vulkan resources can be released on any thread (finalizer in this case)
|
||||
backend.reset();
|
||||
#endif
|
||||
window.reset();
|
||||
swapBehaviorFlush = false;
|
||||
}
|
||||
|
||||
@@ -316,7 +313,6 @@ void MapRenderer::onRendererReset(JNIEnv&) {
|
||||
// needs to be called on GL thread
|
||||
void MapRenderer::onSurfaceDestroyed(JNIEnv&) {
|
||||
resetRenderer();
|
||||
window.reset();
|
||||
}
|
||||
|
||||
void MapRenderer::setSwapBehaviorFlush(JNIEnv&, jboolean flush) {
|
||||
|
||||
@@ -85,7 +85,7 @@ abstract class TextureViewRenderThread extends Thread implements TextureView.Sur
|
||||
this.requestRender = false;
|
||||
lock.notifyAll();
|
||||
|
||||
while (this.hasNativeSurface) {
|
||||
while (this.hasNativeSurface && !this.exited) {
|
||||
try {
|
||||
lock.wait();
|
||||
} catch (InterruptedException ex) {
|
||||
|
||||
@@ -16,14 +16,12 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
|
||||
}
|
||||
|
||||
void cleanup() {
|
||||
if (surface == null) {
|
||||
return;
|
||||
if (surface != null) {
|
||||
mapRenderer.onSurfaceDestroyed();
|
||||
surface.release();
|
||||
surface = null;
|
||||
}
|
||||
|
||||
mapRenderer.onSurfaceDestroyed();
|
||||
surface.release();
|
||||
surface = null;
|
||||
|
||||
hasNativeSurface = false;
|
||||
}
|
||||
|
||||
@@ -56,14 +54,17 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
|
||||
}
|
||||
|
||||
if (this.destroySurface) {
|
||||
surface = null;
|
||||
destroySurface = true;
|
||||
if (surface != null) {
|
||||
surface.release();
|
||||
surface = null;
|
||||
}
|
||||
|
||||
this.destroySurface = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (surfaceTexture != null && !paused && requestRender
|
||||
&& (surface == null || this.sizeChanged)) {
|
||||
if (surfaceTexture != null && !paused && requestRender) {
|
||||
|
||||
w = width;
|
||||
h = height;
|
||||
@@ -87,10 +88,6 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
|
||||
break;
|
||||
}
|
||||
|
||||
if (requestRender && !paused) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Wait until needed
|
||||
lock.wait();
|
||||
|
||||
@@ -113,11 +110,11 @@ public class VulkanTextureViewRenderThread extends TextureViewRenderThread {
|
||||
|
||||
if (destroySurface) {
|
||||
mapRenderer.onSurfaceDestroyed();
|
||||
destroySurface = false;
|
||||
synchronized (lock) {
|
||||
this.hasNativeSurface = false;
|
||||
lock.notifyAll();
|
||||
}
|
||||
destroySurface = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ open class MapLibreApplication : MultiDexApplication() {
|
||||
StrictMode.setVmPolicy(
|
||||
VmPolicy.Builder()
|
||||
.detectLeakedSqlLiteObjects()
|
||||
.detectLeakedClosableObjects()
|
||||
.penaltyLog()
|
||||
.penaltyDeath()
|
||||
.build()
|
||||
|
||||
@@ -48,7 +48,7 @@ class ViewPagerActivity : AppCompatActivity() {
|
||||
|
||||
override fun getItem(position: Int): androidx.fragment.app.Fragment {
|
||||
val options = MapLibreMapOptions.createFromAttributes(context)
|
||||
options.textureMode(true)
|
||||
options.textureMode(false)
|
||||
options.camera(
|
||||
CameraPosition.Builder()
|
||||
.zoom(3.0)
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.net.URL
|
||||
*/
|
||||
|
||||
// Define the validation layer version, with a default value.
|
||||
var vvlVersion = "1.4.313.0"
|
||||
var vvlVersion = "1.4.341.0"
|
||||
if (extra.has("vvl_version")) {
|
||||
vvlVersion = extra["vvl_version"] as String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user