cancel
Showing results for 
Search instead for 
Did you mean: 

VK_LAYER_ADRENO_debug validation issues in calls in VrApi...

Izhido_VR
Explorer

Recently, I was able to add the VK_LAYER_ADRENO_debug validation / performance layer to my app, in order to check for possible performance issues in it. Which was a complete success, indeed, I found many things I did wrong in my code and that I was able to fix.

 

A few of them, however, I'm not sure I understand correctly.

 

The following piece of code is in my app, near the beginning:

 

...
	// assume isMultiview = true
	auto horizontalFOV = vrapi_GetSystemPropertyInt(&appState.Java, VRAPI_SYS_PROP_SUGGESTED_EYE_FOV_DEGREES_X);
	auto verticalFOV = vrapi_GetSystemPropertyInt(&appState.Java, VRAPI_SYS_PROP_SUGGESTED_EYE_FOV_DEGREES_Y);
	appState.FOV = std::max(horizontalFOV, verticalFOV);
	for (auto& view : appState.Views)
	{
		__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "Creating world mode swapchain...");
		view.colorSwapChain.SwapChain = vrapi_CreateTextureSwapChain3(isMultiview ? VRAPI_TEXTURE_TYPE_2D_ARRAY : VRAPI_TEXTURE_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM, appState.EyeTextureWidth, appState.EyeTextureHeight, 1, 3);
		__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, "World mode swapchain created.");
		view.colorSwapChain.SwapChainLength = vrapi_GetTextureSwapChainLength(view.colorSwapChain.SwapChain);
...

 

Let's focus, for now, in the call to vrapi_CreateTextureSwapChain3(). This code is generating the following messages in logcat: 

 

...
I/VrApi: ------------ vrapi_CreateSystemVulkan -----------
I/VulkanLoader: ovrVulkanLoader::Load
W/VulkanLoader: VulkanLoader::LoadDeviceFunctions: Failed to load vkCmdDebugMarkerInsertEXT
I/Foveation: Vulkan FFR is supported, with density map size 32x32
V/MyAwesomeApp: Creating world mode swapchain...
I/SwapChain_Vulkan: Imported texture has requirements 8, ends up index 3
I/chatty: uid=10183(com.heribertodelgado.myawesomeapp) MyAwesomeApp identical 1 line
I/SwapChain_Vulkan: Imported texture has requirements 8, ends up index 3
I/VkAdrenoDebugLayer: Developer Guidelines [ PERF ] RulePreferOptimallyTiledImg: Image (0x781ddc6400) could have been created with optimal tiling, given its format (VK_FORMAT_R8G8_UNORM) and usage. It is highly recommended to use optimal tiling as it increases performance.
    Developer Guidelines [ PERF ] RulePreferHostCachedMemory: Device Memory (0x77c5c11980) was created as a host visible memory but not as a host cached memory. This will affect performance. It is recommended to select a memory type that supports the host cached flag for this device memory.
    Developer Guidelines [ PERF ] RulePreferOptimallyTiledImg: Image (0x781ddc6780) could have been created with optimal tiling, given its format (VK_FORMAT_R8G8_UNORM) and usage. It is highly recommended to use optimal tiling as it increases performance.
    Developer Guidelines [ PERF ] RulePreferHostCachedMemory: Device Memory (0x77c5c11ec0) was created as a host visible memory but not as a host cached memory. This will affect performance. It is recommended to select a memory type that supports the host cached flag for this device memory.
    Developer Guidelines [ PERF ] RulePreferOptimallyTiledImg: Image (0x781ddc6b00) could have been created with optimal tiling, given its format (VK_FORMAT_R8G8_UNORM) and usage. It is highly recommended to use optimal tiling as it increases performance.
    Developer Guidelines [ PERF ] RulePreferHostCachedMemory: Device Memory (0x77c5c12400) was created as a host visible memory but not as a host cached memory. This will affect performance. It is recommended to select a memory type that supports the host cached flag for this device memory.
V/MyAwesomeApp: World mode swapchain created.
V/threaded_app: activityState=10
V/threaded_app: Resume: 0x781dd93540
V/threaded_app: activityState=11
...

 

Notice how, between the two messages before and after doing the call to vrapi_CreateTextureSwapChain3(), lots of [ PERF ] messages appear? These are generated by the VK_LAYER_ADRENO_debug layer. I've checked my code many times, and I simply cannot find any reason how would my code cause these messages to be generated. 

 

Anyone here has seen this before? Do you think you could provide an answer for the validation messages appearing here, and how to avoid them if possible?

0 REPLIES 0