- if(!vku_write_memory(vk_vertices->mem_pool, vsz, (void*)vertices.data())) {
- fprintf(stderr, "Failed to write the vertices on GPU.\n");
+ if(!vku_write_memory(vk_vertices->mem_pool, vsz, (void *)vertices.data())) {
+ fprintf(stderr, "Failed to write the vertices to GPU.\n");
+ return false;
+ }
+ if(vkBindBufferMemory(vk_device, vk_vertices->buf, vk_vertices->mem_pool,
+ 0) != VK_SUCCESS) {
+ fprintf(stderr, "Failed to bind the vertex buffer memory\n");
+ return false;
+ }
+
+ if(!vku_write_memory(vk_normals->mem_pool, nsz, (void *)normals.data())) {
+ fprintf(stderr, "Failed to write the normals to GPU.\n");