Added full support for runtime editing of material properties #215
|
@ -129,11 +129,11 @@ namespace SHADE
|
|||
for (auto& predResource : prereq->attResources)
|
||||
{
|
||||
// if a predecessor's resource is used by this node, we want to copy the final layout from the pred to the initial of this node
|
||||
if (uint64_t resourceID = predResource.GetId().Raw; node->resourceAttachmentMapping.contains(resourceID))
|
||||
if (uint64_t resourceID = predResource.GetId().Raw; node->resourceAttachmentMapping->contains(resourceID))
|
||||
{
|
||||
// Get the resource's attachment index in BOTH the predecessor and the current node
|
||||
uint32_t prereqResourceAttIndex = prereq->resourceAttachmentMapping[resourceID];
|
||||
uint32_t resourceAttIndex = node->resourceAttachmentMapping[resourceID];
|
||||
uint32_t prereqResourceAttIndex = prereq->resourceAttachmentMapping->at(resourceID);
|
||||
uint32_t resourceAttIndex = node->resourceAttachmentMapping->at(resourceID);
|
||||
|
||||
// Use the resource attachment index to get the attachment description in the renderpass
|
||||
auto& attDesc = node->attachmentDescriptions[resourceAttIndex];
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace SHADE
|
|||
, framebuffers{}
|
||||
, prereqNodes{ std::move(predecessors) }
|
||||
, attachmentDescriptions{}
|
||||
, resourceAttachmentMapping{}
|
||||
, resourceAttachmentMapping { new std::unordered_map<uint64_t, uint32_t> }
|
||||
, attResources{ }
|
||||
, subpasses{}
|
||||
, executed{ false }
|
||||
|
@ -163,7 +163,7 @@ namespace SHADE
|
|||
if (attResources[i]->resourceTypeFlags & static_cast<uint32_t>(SH_ATT_DESC_TYPE_FLAGS::COLOR_PRESENT))
|
||||
containsSwapchainImage = true;
|
||||
|
||||
resourceAttachmentMapping.try_emplace(attResources[i].GetId().Raw, i);
|
||||
resourceAttachmentMapping->try_emplace(attResources[i].GetId().Raw, i);
|
||||
}
|
||||
|
||||
if (!containsSwapchainImage)
|
||||
|
@ -254,7 +254,7 @@ namespace SHADE
|
|||
(
|
||||
subpassName,
|
||||
graphStorage, GetHandle(), static_cast<uint32_t>(subpasses.size()),
|
||||
&resourceAttachmentMapping
|
||||
resourceAttachmentMapping.get()
|
||||
)
|
||||
);
|
||||
subpassIndexing.try_emplace(subpassName, static_cast<uint32_t>(subpasses.size()) - 1u);
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace SHADE
|
|||
std::vector<vk::SubpassDependency> spDeps;
|
||||
|
||||
//! For indexing resources fast
|
||||
std::unordered_map<uint64_t, uint32_t> resourceAttachmentMapping;
|
||||
std::unique_ptr<std::unordered_map<uint64_t, uint32_t>> resourceAttachmentMapping;
|
||||
|
||||
//! For indexing subpasses
|
||||
std::map<std::string, uint32_t> subpassIndexing;
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace SHADE
|
|||
colorReferences = std::move(rhs.colorReferences);
|
||||
depthReferences = std::move(rhs.depthReferences);
|
||||
inputReferences = std::move(rhs.inputReferences);
|
||||
resourceAttachmentMapping = rhs.resourceAttachmentMapping;
|
||||
resourceAttachmentMapping = std::move(rhs.resourceAttachmentMapping);
|
||||
descriptorSetLayout = rhs.descriptorSetLayout;
|
||||
exteriorDrawCalls = std::move(rhs.exteriorDrawCalls);
|
||||
graphStorage = rhs.graphStorage;
|
||||
|
|
Loading…
Reference in New Issue