Hi andreyogld3d,
I built your apk and managed to reproduce the issue on a PVR device. Taking a look at the logcat below, seems the crash is due to the function pointer vkGetImageMemoryRequirements2 being NULL:
--------- beginning of crash
10-28 17:33:08.094 4666 4666 E AndroidRuntime: FATAL EXCEPTION: main
10-28 17:33:08.094 4666 4666 E AndroidRuntime: Process: vkpipeline.android.d, PID: 4666
10-28 17:33:08.094 4666 4666 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{vkpipeline.android.d/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to find native library vkGetImageMemoryRequirements2 using classloader: dalvik.system.PathClassLoader[DexPathList[[],nativeLibraryDirectories=[/data/app/vkpipeline.android.d-bM_nuWDrUSmdiwVQrcwHPw==/lib/arm64, /data/app/vkpipeline.android.d-bM_nuWDrUSmdiwVQrcwHPw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]]
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Unable to find native library vkGetImageMemoryRequirements2 using classloader: dalvik.system.PathClassLoader[DexPathList[[],nativeLibraryDirectories=[/data/app/vkpipeline.android.d-bM_nuWDrUSmdiwVQrcwHPw==/lib/arm64, /data/app/vkpipeline.android.d-bM_nuWDrUSmdiwVQrcwHPw==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]]
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.NativeActivity.onCreate(NativeActivity.java:164)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7802)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7791)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
10-28 17:33:08.094 4666 4666 E AndroidRuntime: ... 11 more
I quickly modified the VulkanBumpmap demo from our SDK to add the code needed to reproduce the issue, adding the changes below to VulkanBumpmap.cpp:
// New code start
#define InitVkStruct(vkStruct, sType) InitVulkanStruct(&vkStruct, sType)
#define InitVkStructNextPtr(vkStruct, sType, pNext) InitVulkanStruct(&vkStruct, sType, pNext)
inline void InitVulkanStruct(void* vkStruct, VkStructureType sType, void* pNext = nullptr)
{
struct VkStruct
{
VkStructureType sType;
void* pNext;
};
const VkStruct vkSt = { sType, pNext };
assert(vkStruct && "NULL Pointer");
memcpy(vkStruct, &vkSt, sizeof(vkSt));
}
pvrvk::ImageView texBase;
pvrvk::ImageView texNormalMap;
// New code end
/// <summary>Loads the textures required for this training course.</summary>
/// <returns>Return true if no error occurred.</returns>
void VulkanBumpmap::createImageSamplerDescriptor(pvrvk::CommandBuffer& imageUploadCmd)
{
pvrvk::Device& device = _deviceResources->device;
// Remove "texBase" and "texNormalMap" and put them in the global scope
// create the bilinear sampler
pvrvk::SamplerCreateInfo samplerInfo;
samplerInfo.magFilter = pvrvk::Filter::e_LINEAR;
samplerInfo.minFilter = pvrvk::Filter::e_LINEAR;
...
...
pvr::utils::endQueueDebugLabel(_deviceResources->queue);
// New code start
Log(LogLevel::Information, "PRE-vkGetImageMemoryRequirements2 call");
const VkImageMemoryRequirementsInfo2 imageRequirementsInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, NULL, texBase->getImage()->getVkHandle() };
VkMemoryDedicatedRequirements dedicatedRequirements;
InitVkStructNextPtr(dedicatedRequirements, VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR, nullptr);
VkMemoryRequirements2 memoryRequirements2;
InitVkStructNextPtr(memoryRequirements2, VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2, &dedicatedRequirements);
_deviceResources->device->getVkBindings().vkGetImageMemoryRequirements2(_deviceResources->device->getVkHandle(), &imageRequirementsInfo, &memoryRequirements2);
Log(LogLevel::Information, "POST-vkGetImageMemoryRequirements2 call");
// New code end
// Initialize UIRenderer
...
I tried the modified demo and it worked fine. I could verify the code vkGetImageMemoryRequirements2 code was executed and the two debug messages were outputted to the logcat.
If possible, please add the changes I proposed to the VulkanBumpmap (let me know if you want me to prepare a fork with those changes). If the issue is still there, I think the problem might be driver-related, and for that I would ask you please to provide the drivers version from your PVR device, which you can get in the Aida64 apk, if you go to the field Display → GPU Version.
If the application runs fine, then I would say the issue is related with the vulkan wrapper being used, which is not getting the function pointers correctly.
Best regards and many thanks,
Alejandro