vkvg: android / enable scalarBlockLayout

Android currently does not build because Vulkan 1.2 is not supported. I’m not particularly familiar with Vulkan, but I think these steps are needed.

  1. VK_MAKE_API_VERSION is not present, so just fallback to VK_MAKE_VERSION if VK_MAKE_API_VERSION is not defined (vkh_app.c).
  2. Use ‘#ifdef VK_VERSION_1_2’ to guard against the usage of VkPhysicalDeviceVulkan12Features
  3. If Vulkan 1.2 is detected at runtime, set scalarBlockLayout in VkPhysicalDeviceVulkan12Features
  4. Otherwise, if VK_EXT_scalar_block_layout is detected set scalarBlockLayout in VkPhysicalDeviceScalarBlockLayoutFeaturesEXT and point pNext to this struct.
  5. Fallback to default layout???

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

I’ve merge both fixes on master this morning, and remote git https://github.com/jpbruyere/vkvg/tree/master/src/recording/vkvg_record_internal.h looks good to me, try maybe with a clean git clone, sometimes with rebase there are some changes in remote history that are not applied locally. Wait, that’s recording=false, I check…ok you’re right, I make the fix now. Done, the fix is pushed on master, thanks for the report.

I’ve pushed a fix #104

So I don’t automatically enable scalar block if version = 1.2, but by default the option is enabled.

Awesome, thanks. One more suggestion: Latest NDK defines VK_VERSION_1_2, even though few android devices support it, and you use this to set VKVG_VK_SCALAR_BLOCK_SUPPORTED. So with the latest NDK, I can’t disable scalar block layout. Maybe the cmake setting to be to force disable scalar block?

VK_MAKE_API_VERSION fix, is pushed with note on readme for min vulkan version, for the return values, it’s on my todo list, thanks again.

or just:

#ifdef VK_MAKE_API_VERSION
                                                                .apiVersion = VK_MAKE_API_VERSION (0, version_major, version_minor, 0),
#else
                                                                .apiVersion = VK_MAKE_VERSION (version_major, version_minor, 0),
#endif

One more comment. vkGetPhysicalDeviceFeatures2 is a 1.1 feature, maybe update the readme that 1.1 is a minumum requirement.