Use createBuffer function from Vulkan device class
This commit is contained in:
parent
927660680d
commit
e573a4c244
15 changed files with 222 additions and 233 deletions
|
|
@ -502,23 +502,25 @@ public:
|
|||
};
|
||||
#undef QUAD_COLOR_NORMAL
|
||||
|
||||
createBuffer(
|
||||
VK_CHECK_RESULT(vulkanDevice->createBuffer(
|
||||
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
vertexBuffer.size() * sizeof(Vertex),
|
||||
vertexBuffer.data(),
|
||||
&meshes.quad.vertices.buf,
|
||||
&meshes.quad.vertices.mem);
|
||||
&meshes.quad.vertices.mem,
|
||||
vertexBuffer.data()));
|
||||
|
||||
// Setup indices
|
||||
std::vector<uint32_t> indexBuffer = { 0,1,2, 2,3,0 };
|
||||
meshes.quad.indexCount = indexBuffer.size();
|
||||
|
||||
createBuffer(
|
||||
VK_CHECK_RESULT(vulkanDevice->createBuffer(
|
||||
VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
indexBuffer.size() * sizeof(uint32_t),
|
||||
indexBuffer.data(),
|
||||
&meshes.quad.indices.buf,
|
||||
&meshes.quad.indices.mem);
|
||||
&meshes.quad.indices.mem,
|
||||
indexBuffer.data()));
|
||||
}
|
||||
|
||||
void setupVertexDescriptions()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue