Fixed UI Rendering #326

Merged
Xenosas1337 merged 13 commits from SP3-1-Rendering into main 2023-01-31 22:53:04 +08:00
4 changed files with 15 additions and 15 deletions
Showing only changes of commit c2aa067cc4 - Show all commits

View File

@ -92,11 +92,17 @@ namespace SHADE
if (vertShader && fragShader && gfxSystem)
{
// - Retrieve pipeline from pipeline library
auto renderPass = gfxSystem->GetPrimaryRenderpass();
auto subPass = renderPass->GetSubpass(currentMatSpec->subpassName);
auto pipeline = renderPass->GetOrCreatePipeline({ vertShader, fragShader }, subPass);
// - Set Pipeline
matHandle->SetPipeline(pipeline);
auto subPass = gfxSystem->GetUsableSubpass(currentMatSpec->subpassName);
if (subPass)
{
// Set Pipeline if valid
auto pipeline = subPass->GetParentNode()->GetOrCreatePipeline({vertShader, fragShader}, subPass);
matHandle->SetPipeline(pipeline);
}
else
{
SHLOG_ERROR("[SHMaterialInspector] Failed to find material subpass of type \"{}\"", currentMatSpec->subpassName);
}
}
}

View File

@ -474,7 +474,7 @@ namespace SHADE
*/
/***************************************************************************/
Handle<SHRenderGraphNode> const& SHSubpass::GetParentNode(void) const noexcept
Handle<SHRenderGraphNode> SHSubpass::GetParentNode(void) const noexcept
{
return parentNode;
}

View File

@ -159,7 +159,7 @@ namespace SHADE
/*-----------------------------------------------------------------------*/
void SetCompanionSubpass (Handle<SHSubpass> companion, Handle<SHVkPipeline> pipeline) noexcept;
Handle<SHRenderGraphNode> const& GetParentNode(void) const noexcept;
Handle<SHRenderGraphNode> GetParentNode(void) const noexcept;
SHSubPassIndex GetIndex() const noexcept;
Handle<SHSuperBatch> GetSuperBatch(void) const noexcept;
std::vector<vk::AttachmentReference> const& GetColorAttachmentReferences (void) const noexcept;

View File

@ -270,14 +270,8 @@ namespace SHADE
return {};
}
// Grab subpass from worldRenderer
auto renderPass = gfxSystem->GetPrimaryRenderpass();
if (!renderPass)
{
SHLOG_ERROR("[SHResourceManager] Failed to load material as RenderPass could not be found.");
return {};
}
auto subPass = renderPass->GetSubpass(assetData.subpassName);
// Grab subpass
auto subPass = gfxSystem->GetUsableSubpass(assetData.subpassName);
if (!subPass)
{
SHLOG_ERROR("[SHResourceManager] Failed to load material as SubPass could not be found.");