From eecadbe36b18018b815341aa0f3f32396e2e12c2 Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Sat, 22 Aug 2020 07:11:26 +0100 Subject: [PATCH] Introduced base functionality with opmult --- src/Algorithm.cpp | 8 +++++--- src/Algorithm.hpp | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Algorithm.cpp b/src/Algorithm.cpp index ced642de9..c24965e43 100644 --- a/src/Algorithm.cpp +++ b/src/Algorithm.cpp @@ -147,7 +147,9 @@ void Algorithm::createPipeline() { // TODO: Confirm what the best structure is with pipeline cache this->mFreePipelineCache = true; - this->mPipelineCache = std::make_shared(vk::PipelineCacheCreateInfo()); + vk::PipelineCacheCreateInfo pipelineCacheInfo = vk::PipelineCacheCreateInfo(); + this->mPipelineCache = std::make_shared(); + this->mDevice->createPipelineCache(&pipelineCacheInfo, nullptr, this->mPipelineCache.get()); vk::ResultValue pipelineResult = this->mDevice->createComputePipeline(*this->mPipelineCache, pipelineInfo); @@ -165,9 +167,9 @@ void Algorithm::recordDispatch(uint32_t x, uint32_t y, uint32_t z) { this->mCommandBuffer->bindPipeline(vk::PipelineBindPoint::eCompute, *this->mPipeline); // TODO: Simplify interaction given we store array of pointers - std::vector descriptorSetRefs(this->mDescriptorSets.size()); + std::vector descriptorSetRefs(this->mDescriptorSets.size()); for (size_t i = 0; i < this->mDescriptorSets.size(); i++) { - descriptorSetRefs[i] = this->mDescriptorSets[i]; + descriptorSetRefs[i] = *this->mDescriptorSets[i]; } this->mCommandBuffer->bindDescriptorSets(vk::PipelineBindPoint::eCompute, *this->mPipelineLayout, 0, descriptorSetRefs, nullptr); diff --git a/src/Algorithm.hpp b/src/Algorithm.hpp index 7620ece14..c8e3f38c2 100644 --- a/src/Algorithm.hpp +++ b/src/Algorithm.hpp @@ -41,6 +41,7 @@ private: bool mFreeDescriptorSetLayout = false; std::shared_ptr mDescriptorPool; bool mFreeDescriptorPool = false; + // TODO: Potentially change to vector pointer of objects depending on whether it will be expected to pass a pointer (or reference) to the constructor std::vector> mDescriptorSets; bool mFreeDescriptorSet = false; std::shared_ptr mShaderModule;