Graphics/MaterialPipeline: Rework GetRenderPipeline

Decrease the need for memory allocations in most cases (especially for sprites)
This commit is contained in:
SirLynix
2022-08-30 19:29:23 +02:00
parent 017a6c7af3
commit 04d2f4a6c2
7 changed files with 25 additions and 39 deletions

View File

@@ -32,15 +32,11 @@ namespace Nz
const std::shared_ptr<VertexDeclaration>& vertexDeclaration = VertexDeclaration::Get(VertexLayout::XYZ_Color_UV);
std::vector<RenderPipelineInfo::VertexBufferData> vertexBufferData = {
{
{
0,
vertexDeclaration
}
}
RenderPipelineInfo::VertexBufferData vertexBufferData = {
0,
vertexDeclaration
};
const auto& renderPipeline = materialPass->GetPipeline()->GetRenderPipeline(vertexBufferData);
const auto& renderPipeline = materialPass->GetPipeline()->GetRenderPipeline(&vertexBufferData, 1);
const auto& whiteTexture = Graphics::Instance()->GetDefaultTextures().whiteTextures[UnderlyingCast(ImageType::E2D)];