This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Vulkan function vkCreateDevice() returns error VK_ERROR_FEATURE_NOT_PRESENT (VkResult:-8) on HUAWEI P30

Hi,

I have few Vulkan games run well on numbers of Android devices. However, when I test them on HUAWEI P30 (not P30 Pro) with Mali-G76 MP10 GPU and Android 9.0, function vkCreateDevice() returns error VK_ERROR_FEATURE_NOT_PRESENT (VkResult:-8).

My app should have successfully loaded Vulkan dynamic lib since vkInstance has been created before creating vkDevice.

So what is the reason that vkCreateDevice() return VK_ERROR_FEATURE_NOT_PRESENT? Here is my code snippet:

// Create Logical Device, ensure that this device is connecte to graphics queue

// Step 1 - Retrive the queue family that supports graphics pipeline
uint32_t graphicQueueFamilyIndex;
int i = 0;
for (const auto& family : _queueFamilyProps)
{
// Check if the family has queues and that are Graphical and not Computational queues.
if (family.queueCount > 0 && family.queueFlags & VK_QUEUE_GRAPHICS_BIT)
{
graphicQueueFamilyIndex = i; //Found the family, record its index
break;
}
i++;
}

// Step 2 - Get physical device features
vkGetPhysicalDeviceFeatures(vkPhyDevice, &deviceFeatures);
VkPhysicalDeviceFeatures enabledFeatures = {VK_FALSE};
enabledFeatures.samplerAnisotropy = deviceFeatures.samplerAnisotropy;
enabledFeatures.shaderSampledImageArrayDynamicIndexing = deviceFeatures.shaderSampledImageArrayDynamicIndexing;
enabledFeatures.depthClamp = VK_TRUE;
enabledFeatures.sampleRateShading = VK_TRUE;
#if defined (NATIVE_LINEWIDTH_SUPPORT)
enabledFeatures.wideLines = VK_TRUE; //MoltenVK (via Metal API) does not support line width
#endif

// Step 3 - Create the logical device
float queuePriorities[1] = { 0.0f };
VkDeviceQueueCreateInfo queueCreateInfo
{
VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, //sType
nullptr, //pNext
0, //flags
graphicQueueFamilyIndex, //queueFamilyIndex
1, //queueCount
queuePriorities //pQueuePriorities
};
std::vector<const char *> extensionNames { VK_KHR_SWAPCHAIN_EXTENSION_NAME };
VkDeviceCreateInfo deviceInfo
{
VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, //sType
nullptr, //pNext
0, //flags
1, //queueCreateInfoCount
&queueCreateInfo, //pQueueCreateInfos
0, //enabledLayerCount
nullptr, //ppEnabledLayerNames
(uint32_t)extensionNames.size(), //enabledExtensionCount
extensionNames.data(), //ppEnabledExtensionNames
&enabledFeatures //pEnabledFeatures
};
VK_ASSERT(vkCreateDevice(vkPhyDevice, &deviceInfo, nullptr, &vkDevice
));
Parents
  • Hi Pete,

    I double checked my OpenGL ES sourc code, it is true that OpenGL ES 3.0 API does not natively support "glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);". I emulate wireframe rendering by drawing triangle's outlines through "glDrawElements(GL_LINE_LOOP, ...)". Sorry for the wrong information I provided. I will use them same emulation method for Vulkan on Mali GPUs.

    However, having this feature on Mali in the future might be good since other competitors like Adreno and PowerVR do have this handy feature.

    Regards,

    Hongkun

Reply
  • Hi Pete,

    I double checked my OpenGL ES sourc code, it is true that OpenGL ES 3.0 API does not natively support "glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);". I emulate wireframe rendering by drawing triangle's outlines through "glDrawElements(GL_LINE_LOOP, ...)". Sorry for the wrong information I provided. I will use them same emulation method for Vulkan on Mali GPUs.

    However, having this feature on Mali in the future might be good since other competitors like Adreno and PowerVR do have this handy feature.

    Regards,

    Hongkun

Children