diff --git a/kraken/CMakeLists.txt b/kraken/CMakeLists.txt index 73ffa12..da87e0f 100644 --- a/kraken/CMakeLists.txt +++ b/kraken/CMakeLists.txt @@ -22,6 +22,8 @@ add_sources(KRBundleManager.cpp) add_sources(KRCamera.cpp) add_sources(KRCollider.cpp) add_sources(KRContext.cpp) +add_sources(KRDescriptorManager.cpp) +add_sources(KRDescriptorSet.cpp) add_sources(KRDevice.cpp) add_sources(KRDeviceManager.cpp) add_sources(KRRenderPass.cpp) diff --git a/kraken/KRContext.cpp b/kraken/KRContext.cpp index d3c93e2..4c15aae 100755 --- a/kraken/KRContext.cpp +++ b/kraken/KRContext.cpp @@ -102,6 +102,8 @@ KRContext::KRContext(const KrInitializeInfo* initializeInfo) m_pBundleManager = std::make_unique(*this); m_deviceManager = std::make_unique(*this); m_deviceManager->initialize(); + m_descriptorManager = std::make_unique(*this); + m_descriptorManager->init(); m_surfaceManager = std::make_unique(*this); m_pPipelineManager = std::make_unique(*this); m_pSamplerManager = std::make_unique(*this); @@ -162,6 +164,7 @@ KRContext::~KRContext() m_pShaderManager.reset(); m_surfaceManager.reset(); m_deviceManager.reset(); + m_descriptorManager.reset(); // The bundles must be destroyed last, as the other objects may be using mmap'ed data from bundles m_pBundleManager.reset(); @@ -255,6 +258,10 @@ KRDeviceManager* KRContext::getDeviceManager() { return m_deviceManager.get(); } +KRDescriptorManager* KRContext::getDescriptorManager() +{ + return m_descriptorManager.get(); +} KRUnknownManager* KRContext::getUnknownManager() { return m_pUnknownManager.get(); diff --git a/kraken/KRContext.h b/kraken/KRContext.h index 5b8e86f..37fa0ae 100755 --- a/kraken/KRContext.h +++ b/kraken/KRContext.h @@ -45,6 +45,7 @@ #include "KRShaderManager.h" #include "KRSourceManager.h" #include "KRSurfaceManager.h" +#include "KRDescriptorManager.h" #include "KRDeviceManager.h" #include "KRDevice.h" #include "KRSurface.h" @@ -53,6 +54,7 @@ class KRAudioManager; class KRPresentationThread; class KRStreamerThread; class KRDeviceManager; +class KRDescriptorManager; class KRSurfaceManager; class KRSamplerManager; @@ -118,6 +120,7 @@ public: KRSourceManager* getSourceManager(); KRSurfaceManager* getSurfaceManager(); KRDeviceManager* getDeviceManager(); + KRDescriptorManager* getDescriptorManager(); void startFrame(float deltaTime); void endFrame(float deltaTime); @@ -170,6 +173,7 @@ private: std::unique_ptr m_pShaderManager; std::unique_ptr m_pSourceManager; std::unique_ptr m_deviceManager; + std::unique_ptr m_descriptorManager; std::unique_ptr m_surfaceManager; KRResource** m_resourceMap; diff --git a/kraken/KRDescriptorManager.cpp b/kraken/KRDescriptorManager.cpp new file mode 100644 index 0000000..2abc853 --- /dev/null +++ b/kraken/KRDescriptorManager.cpp @@ -0,0 +1,48 @@ +// +// ShaderManager.cpp +// Kraken Engine +// +// Copyright 2022 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +#include "KRDescriptorManager.h" + +KRDescriptorManager::KRDescriptorManager(KRContext& context) + : KRContextObject(context) +{ + +} + +KRDescriptorManager::~KRDescriptorManager() +{ + +} + +void KRDescriptorManager::init() +{ + +} diff --git a/kraken/KRDescriptorManager.h b/kraken/KRDescriptorManager.h new file mode 100644 index 0000000..7afe6f1 --- /dev/null +++ b/kraken/KRDescriptorManager.h @@ -0,0 +1,51 @@ +// +// KRSurfaceManager.h +// Kraken Engine +// +// Copyright 2022 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +#pragma once + +#include "KREngine-common.h" + +#include "KRContext.h" +#include "KRDescriptorSet.h" + +class KRDescriptorSet; + +class KRDescriptorManager : KRContextObject +{ +public: + KRDescriptorManager(KRContext& context); + ~KRDescriptorManager(); + + void init(); + +private: + set m_descriptorSets; +}; diff --git a/kraken/KRDescriptorSet.cpp b/kraken/KRDescriptorSet.cpp new file mode 100644 index 0000000..1bbe0cf --- /dev/null +++ b/kraken/KRDescriptorSet.cpp @@ -0,0 +1,43 @@ +// +// ShaderManager.cpp +// Kraken Engine +// +// Copyright 2022 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +#include "KRDescriptorSet.h" + +KRDescriptorSet::KRDescriptorSet(KRContext& context) + : KRContextObject(context) +{ + +} + +KRDescriptorSet::~KRDescriptorSet() +{ + +} \ No newline at end of file diff --git a/kraken/KRDescriptorSet.h b/kraken/KRDescriptorSet.h new file mode 100644 index 0000000..1e33875 --- /dev/null +++ b/kraken/KRDescriptorSet.h @@ -0,0 +1,46 @@ +// +// KRPipeline.h +// Kraken Engine +// +// Copyright 2022 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + + +#pragma once + +#include "KREngine-common.h" +#include "KRContext.h" + +class KRDescriptorSet : public KRContextObject +{ +public: + + KRDescriptorSet(KRContext& context); + virtual ~KRDescriptorSet(); + +private: +};