Run MapLibreAndroidTestApp activities as instrumentation tests (#3594)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Adrian Cojocaru
2025-07-23 18:46:00 +03:00
committed by GitHub
parent b7f129cc00
commit a015b6bf12
20 changed files with 394 additions and 199 deletions

View File

@@ -45,6 +45,7 @@ struct TextureInfo {
namespace vulkan {
class RenderableResource;
class RendererBackend;
class Context;
class ShaderProgram;
using UniqueShaderProgram = std::unique_ptr<ShaderProgram>;
@@ -78,10 +79,11 @@ public:
protected:
std::string shaderName;
RendererBackend& backend;
Context& context;
vk::UniqueShaderModule vertexShader;
vk::UniqueShaderModule fragmentShader;
std::unordered_map<std::size_t, vk::UniquePipeline> pipelines;
std::shared_ptr<std::unordered_map<std::size_t, vk::UniquePipeline>> pipelines;
VertexAttributeArray vertexAttributes;
VertexAttributeArray instanceAttributes;

View File

@@ -151,15 +151,12 @@ public:
private:
struct FrameResources {
vk::UniqueCommandBuffer commandBuffer;
vk::UniqueSemaphore acquireSurfaceSemaphore;
vk::UniqueFence flightFrameFence;
std::vector<std::function<void(Context&)>> deletionQueue;
FrameResources(vk::UniqueCommandBuffer& cb, vk::UniqueSemaphore&& surf, vk::UniqueFence&& flight)
FrameResources(vk::UniqueCommandBuffer& cb, vk::UniqueFence&& flight)
: commandBuffer(std::move(cb)),
acquireSurfaceSemaphore(std::move(surf)),
flightFrameFence(std::move(flight)) {}
void runDeletionQueue(Context&);

View File

@@ -58,7 +58,8 @@ public:
uint32_t getAcquiredImageIndex() const { return acquiredImageIndex; };
void setAcquiredImageIndex(uint32_t index) { acquiredImageIndex = index; };
const vk::Image getAcquiredImage() const;
const vk::Semaphore& getAcquiredSemaphore() const;
const vk::Semaphore& getAcquireSemaphore() const;
const vk::Semaphore& getPresentSemaphore() const;
bool hasSurfaceTransformSupport() const;
bool didSurfaceTransformUpdate() const;
@@ -87,7 +88,8 @@ protected:
std::vector<vk::Image> swapchainImages;
std::vector<vk::UniqueImageView> swapchainImageViews;
std::vector<vk::UniqueFramebuffer> swapchainFramebuffers;
std::vector<vk::UniqueSemaphore> swapchainSemaphores;
std::vector<vk::UniqueSemaphore> acquireSemaphores;
std::vector<vk::UniqueSemaphore> presentSemaphores;
vk::Format colorFormat{vk::Format::eUndefined};
UniqueImageAllocation depthAllocation;

View File

@@ -4,6 +4,7 @@
#include <mbgl/gfx/context.hpp>
#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
#define VULKAN_HPP_NO_DEFAULT_DISPATCHER
#ifdef _WIN32
#define VK_USE_PLATFORM_WIN32_KHR
@@ -39,6 +40,7 @@ public:
void initShaders(gfx::ShaderRegistry&, const ProgramParameters& programParameters) override;
void init();
const vk::DispatchLoaderDynamic& getDispatcher() const { return dispatcher; }
const vk::UniqueInstance& getInstance() const { return instance; }
const vk::PhysicalDevice& getPhysicalDevice() const { return physicalDevice; }
const vk::UniqueDevice& getDevice() const { return device; }
@@ -60,7 +62,8 @@ public:
device->setDebugUtilsObjectNameEXT(vk::DebugUtilsObjectNameInfoEXT()
.setObjectType(object.objectType)
.setObjectHandle(handle)
.setPObjectName(name.c_str()));
.setPObjectName(name.c_str()),
dispatcher);
#endif
}
@@ -94,6 +97,8 @@ protected:
protected:
vk::DynamicLoader dynamicLoader;
vk::DispatchLoaderDynamic dispatcher;
vk::UniqueInstance instance;
vk::UniqueDebugUtilsMessengerEXT debugUtilsCallback;
vk::UniqueDebugReportCallbackEXT debugReportCallback;