Windows 下面终于是编译通过

This commit is contained in:
xsl
2025-10-19 16:26:38 +08:00
parent 234e30bd50
commit 2284911161
4 changed files with 30 additions and 20 deletions
+12 -19
View File
@@ -1,5 +1,5 @@
#include "FaceApp.h"
#include "common/helpers.h"
FaceApp::FaceApp(/* args */)
{
@@ -18,27 +18,20 @@ void FaceApp::initVulkan()
void FaceApp::generate_quad()
{
//std::vector<TextureLoadingVertexStructure>& vertices = obj_vertices;
//std::vector<uint32_t> indices = obj_indices;
std::vector<TextureLoadingVertexStructure>& vertices = obj_vertices;
std::vector<uint32_t> indices = obj_indices;
//index_count = static_cast<uint32_t>(indices.size());
index_count = static_cast<uint32_t>(indices.size());
//auto vertex_buffer_size = vkb::to_u32(vertices.size() * sizeof(TextureLoadingVertexStructure));
//auto index_buffer_size = vkb::to_u32(indices.size() * sizeof(uint32_t));
auto vertex_buffer_size = vkb::to_u32(vertices.size() * sizeof(TextureLoadingVertexStructure));
auto index_buffer_size = vkb::to_u32(indices.size() * sizeof(uint32_t));
//// Create buffers
//// For the sake of simplicity we won't stage the vertex data to the gpu memory
//// Vertex buffer
//vertex_buffer = std::make_unique<vkb::core::BufferC>(get_device(),
// vertex_buffer_size,
// VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
// VMA_MEMORY_USAGE_CPU_TO_GPU);
//vertex_buffer->update(vertices.data(), vertex_buffer_size);
vkb::core::DeviceC& cDevice = reinterpret_cast<vkb::core::DeviceC&>(*v_device);
//index_buffer = std::make_unique<vkb::core::BufferC>(get_device(),
// index_buffer_size,
// VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
// VMA_MEMORY_USAGE_CPU_TO_GPU);
auto vertex_buffer = std::make_unique<vkb::core::BufferC>(cDevice, vertex_buffer_size,VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,VMA_MEMORY_USAGE_CPU_TO_GPU);
vertex_buffer->update(vertices.data(), vertex_buffer_size);
//index_buffer->update(indices.data(), index_buffer_size);
index_buffer = std::make_unique<vkb::core::BufferC>(cDevice,index_buffer_size,VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,VMA_MEMORY_USAGE_CPU_TO_GPU);
index_buffer->update(indices.data(), index_buffer_size);
}