-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from KonstantinTomashevich/73-render-foundatio…
…n-improvement Celerity::RenderFoundation: Frame buffers and render to textures.
- Loading branch information
Showing
59 changed files
with
1,384 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Library/Public/Celerity/Extension/Asset/Celerity/Asset/ManualAssetConstructor.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <Celerity/Asset/Asset.hpp> | ||
#include <Celerity/Asset/AssetManagerSingleton.hpp> | ||
#include <Celerity/Asset/ManualAssetConstructor.hpp> | ||
#include <Celerity/PipelineBuilderMacros.hpp> | ||
|
||
namespace Emergence::Celerity | ||
{ | ||
ManualAssetConstructor::ManualAssetConstructor (TaskConstructor &_constructor) noexcept | ||
: modifyAssetManager (MODIFY_SINGLETON (AssetManagerSingleton)), | ||
insertAsset (INSERT_LONG_TERM (Asset)) | ||
{ | ||
} | ||
|
||
void ManualAssetConstructor::ConstructManualAsset (Memory::UniqueString _assetId, | ||
const StandardLayout::Mapping &_assetType) noexcept | ||
{ | ||
auto managerCursor = modifyAssetManager.Execute (); | ||
auto *manager = static_cast<AssetManagerSingleton *> (*managerCursor); | ||
++manager->unusedAssetCount; | ||
|
||
auto assetCursor = insertAsset.Execute (); | ||
auto *asset = static_cast<Asset *> (++assetCursor); | ||
asset->id = _assetId; | ||
asset->type = _assetType; | ||
asset->state = AssetState::READY; | ||
asset->usages = 0u; | ||
} | ||
} // namespace Emergence::Celerity |
31 changes: 31 additions & 0 deletions
31
Library/Public/Celerity/Extension/Asset/Celerity/Asset/ManualAssetConstructor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <Celerity/PipelineBuilder.hpp> | ||
|
||
namespace Emergence::Celerity | ||
{ | ||
/// \brief Utility class for systems that need to manually construct | ||
/// assets instead of constructing them through references. | ||
class ManualAssetConstructor final | ||
{ | ||
public: | ||
/// \brief Initializes internal queries using given task constructor, | ||
ManualAssetConstructor (TaskConstructor &_constructor) noexcept; | ||
|
||
ManualAssetConstructor (const ManualAssetConstructor &_other) = delete; | ||
|
||
ManualAssetConstructor (ManualAssetConstructor &&_other) = delete; | ||
|
||
~ManualAssetConstructor () noexcept = default; | ||
|
||
/// \brief Constructs ready to use asset with given id, given type and zero references. | ||
/// \warning Asset might be cleaned up later by asset management system unless something references it. | ||
void ConstructManualAsset (Memory::UniqueString _assetId, const StandardLayout::Mapping &_assetType) noexcept; | ||
|
||
EMERGENCE_DELETE_ASSIGNMENT (ManualAssetConstructor); | ||
|
||
private: | ||
ModifySingletonQuery modifyAssetManager; | ||
InsertLongTermQuery insertAsset; | ||
}; | ||
} // namespace Emergence::Celerity |
Oops, something went wrong.