Minor improvements to Pipeline and Uniformbuffer

This commit is contained in:
Thraix
2024-10-01 19:53:19 +02:00
parent 9133bce7fc
commit 1ffcc7fc1a
4 changed files with 13 additions and 3 deletions
@@ -72,4 +72,12 @@ namespace Copium
{ {
Buffer::Update(buffer.data(), Vulkan::GetSwapChain().GetFlightIndex()); Buffer::Update(buffer.data(), Vulkan::GetSwapChain().GetFlightIndex());
} }
void UniformBuffer::UpdateStatic()
{
for (int i = 0; i < SwapChain::MAX_FRAMES_IN_FLIGHT; i++)
{
Buffer::Update(buffer.data(), i);
}
}
} }
@@ -30,5 +30,6 @@ namespace Copium
void Set(const std::string& str, int data); void Set(const std::string& str, int data);
void Update(); void Update();
void UpdateStatic();
}; };
} }
@@ -42,6 +42,7 @@ namespace Copium
else if (type == "Mesh") else if (type == "Mesh")
{ {
creator.SetVertexDescriptor(Vertex::GetDescriptor()); creator.SetVertexDescriptor(Vertex::GetDescriptor());
creator.SetBlending(metaFileClass.GetValue("alpha-blending", "false") == "true" ? true : false);
} }
InitializeDescriptorSetLayout(creator); InitializeDescriptorSetLayout(creator);
InitializePipeline(creator); InitializePipeline(creator);
@@ -21,7 +21,7 @@ namespace Copium
return offset; return offset;
offset += GetUniformTypeOffset(uniformElem.first); offset += GetUniformTypeOffset(uniformElem.first);
} }
CP_ABORT("Uniform not found=%s", uniform); CP_ABORT("Uniform not found=%s", uniform.c_str());
} }
uint32_t ShaderBinding::GetUniformSize(const std::string& uniform) const uint32_t ShaderBinding::GetUniformSize(const std::string& uniform) const
@@ -31,7 +31,7 @@ namespace Copium
if (uniformElem.second == uniform) if (uniformElem.second == uniform)
return GetUniformTypeSize(uniformElem.first); return GetUniformTypeSize(uniformElem.first);
} }
CP_ABORT("Uniform not found=%s", uniform); CP_ABORT("Uniform not found=%s", uniform.c_str());
} }
UniformType ShaderBinding::GetUniformType(const std::string& uniform) const UniformType ShaderBinding::GetUniformType(const std::string& uniform) const
@@ -41,7 +41,7 @@ namespace Copium
if (uniformElem.second == uniform) if (uniformElem.second == uniform)
return uniformElem.first; return uniformElem.first;
} }
CP_ABORT("Uniform not found=%s", uniform); CP_ABORT("Uniform not found=%s", uniform.c_str());
} }
uint32_t ShaderBinding::GetUniformBufferSize() const uint32_t ShaderBinding::GetUniformBufferSize() const