在Android 上也把脸画出来了。
This commit is contained in:
+21
-3
@@ -501,7 +501,7 @@ void FaceApp::render(VkCommandBuffer commandBuffer)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
vkCmdDrawIndexed(commandBuffer, obj_indices.size(), 1, 0, 0, 0);
|
vkCmdDrawIndexed(commandBuffer, obj_indices.size(), 1, 0, 0, 0);
|
||||||
#else
|
#else
|
||||||
if (getCurrentTimeMillis() - last_update_time < 1000)
|
if (getCurrentTimeMillis() - last_update_time < 2000)
|
||||||
{
|
{
|
||||||
vkCmdDrawIndexed(commandBuffer, obj_indices.size(), 1, 0, 0, 0);
|
vkCmdDrawIndexed(commandBuffer, obj_indices.size(), 1, 0, 0, 0);
|
||||||
}
|
}
|
||||||
@@ -510,11 +510,28 @@ void FaceApp::render(VkCommandBuffer commandBuffer)
|
|||||||
|
|
||||||
void FaceApp::createVmaAllocator()
|
void FaceApp::createVmaAllocator()
|
||||||
{
|
{
|
||||||
VmaAllocatorCreateInfo allocatorInfo = {};
|
//VmaAllocatorCreateInfo allocatorInfo = {};
|
||||||
|
//allocatorInfo.physicalDevice = physicalDevice;
|
||||||
|
//allocatorInfo.device = device;
|
||||||
|
//allocatorInfo.instance = instance;
|
||||||
|
//allocatorInfo.vulkanApiVersion = VK_API_VERSION_1_0;
|
||||||
|
//vmaCreateAllocator(&allocatorInfo, &allocator);
|
||||||
|
|
||||||
|
// 1. 设置 Vulkan 函数指针
|
||||||
|
VmaVulkanFunctions vulkanFunctions{};
|
||||||
|
vulkanFunctions.vkGetInstanceProcAddr = vkGetInstanceProcAddr;
|
||||||
|
vulkanFunctions.vkGetDeviceProcAddr = vkGetDeviceProcAddr;
|
||||||
|
|
||||||
|
// 2. 配置 Allocator
|
||||||
|
VmaAllocatorCreateInfo allocatorInfo{};
|
||||||
allocatorInfo.physicalDevice = physicalDevice;
|
allocatorInfo.physicalDevice = physicalDevice;
|
||||||
allocatorInfo.device = device;
|
allocatorInfo.device = device;
|
||||||
allocatorInfo.instance = instance;
|
allocatorInfo.instance = instance;
|
||||||
vmaCreateAllocator(&allocatorInfo, &allocator);
|
allocatorInfo.vulkanApiVersion = VK_API_VERSION_1_0;
|
||||||
|
allocatorInfo.pVulkanFunctions = &vulkanFunctions;
|
||||||
|
|
||||||
|
|
||||||
|
VkResult result = vmaCreateAllocator(&allocatorInfo, &allocator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FaceApp::initVulkan()
|
void FaceApp::initVulkan()
|
||||||
@@ -537,6 +554,7 @@ void FaceApp::initVulkan()
|
|||||||
create_pipelines_bg();
|
create_pipelines_bg();
|
||||||
|
|
||||||
uploadVertexData();
|
uploadVertexData();
|
||||||
|
last_update_time = getCurrentTimeMillis();
|
||||||
faceAppInited = true;
|
faceAppInited = true;
|
||||||
|
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
|
|||||||
Reference in New Issue
Block a user