|
|
@ -253,16 +253,11 @@ void Application::addSoftBody(const std::string &modelFile, size_t count) { |
|
|
|
vertexBuffers[0] = make_unique<SimulationBuffer>(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); |
|
|
|
vertexBuffers[0] = make_unique<SimulationBuffer>(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); |
|
|
|
vertexBuffers[1] = make_unique<SimulationBuffer>(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); |
|
|
|
vertexBuffers[1] = make_unique<SimulationBuffer>(VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT); |
|
|
|
faceBuffer = make_unique<SimulationBuffer>(VK_BUFFER_USAGE_INDEX_BUFFER_BIT); |
|
|
|
faceBuffer = make_unique<SimulationBuffer>(VK_BUFFER_USAGE_INDEX_BUFFER_BIT); |
|
|
|
edgeBuffer = make_unique<SimulationBuffer>(); |
|
|
|
|
|
|
|
// triangleBuffer = make_unique<SimulationBuffer>();
|
|
|
|
|
|
|
|
tetrahedronBuffer = make_unique<SimulationBuffer>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vertexBuffers[0]->setName("Vertices 0"); |
|
|
|
vertexBuffers[0]->setName("Vertices 0"); |
|
|
|
vertexBuffers[1]->setName("Vertices 1"); |
|
|
|
vertexBuffers[1]->setName("Vertices 1"); |
|
|
|
faceBuffer->setName("Faces"); |
|
|
|
faceBuffer->setName("Faces"); |
|
|
|
edgeBuffer->setName("Edges"); |
|
|
|
|
|
|
|
// triangleBuffer->setName("Triangles");
|
|
|
|
|
|
|
|
tetrahedronBuffer->setName("Tetrahedra"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VkQueue queue = Instance::instance->graphicsAndPresentQueue; |
|
|
|
VkQueue queue = Instance::instance->graphicsAndPresentQueue; |
|
|
|
Instance::instance->renderingCommandPool->endSingleTimeCommandBuffer(commandBuffer, queue); |
|
|
|
Instance::instance->renderingCommandPool->endSingleTimeCommandBuffer(commandBuffer, queue); |
|
|
@ -279,6 +274,16 @@ void Application::removeSoftBody(const unique_ptr<SoftBody> &softBody) { |
|
|
|
// cpu: erase vector element
|
|
|
|
// cpu: erase vector element
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Application::updateConstraintBuffers(VkCommandBuffer commandBuffer) { |
|
|
|
|
|
|
|
edgeBuffer = make_unique<SimulationBuffer>(constraintData.edges.size() * sizeof(Edge), constraintData.edges.data()); |
|
|
|
|
|
|
|
// triangleBuffer = make_unique<SimulationBuffer>();
|
|
|
|
|
|
|
|
tetrahedronBuffer = make_unique<SimulationBuffer>(constraintData.tetrahedra.size() * sizeof(Tetrahedron), constraintData.tetrahedra.data()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
edgeBuffer.value()->setName("Edges"); |
|
|
|
|
|
|
|
// triangleBuffer->setName("Triangles");
|
|
|
|
|
|
|
|
tetrahedronBuffer.value()->setName("Tetrahedra"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Application::createComputePipelines() { |
|
|
|
void Application::createComputePipelines() { |
|
|
|
vector<VkDescriptorSetLayout> layouts; |
|
|
|
vector<VkDescriptorSetLayout> layouts; |
|
|
|
vector<VkPushConstantRange> pushRanges; |
|
|
|
vector<VkPushConstantRange> pushRanges; |
|
|
|