3700 FPS here we go

This commit is contained in:
Dynamitos
2021-04-13 23:09:16 +02:00
parent d5f0fe644f
commit 312ae2af9a
36 changed files with 401 additions and 231 deletions
+2 -1
View File
@@ -42,6 +42,7 @@ void Material::load()
void Material::compile()
{
setStatus(Status::Loading);
layout = WindowManager::getGraphics()->createDescriptorLayout();
auto& stream = getReadStream();
json j;
@@ -142,13 +143,13 @@ void Material::compile()
brdf->generateMaterialCode(codeStream, j["code"]);
codeStream << "};";
codeStream.close();
setStatus(Status::Ready);
}
const Gfx::ShaderCollection* Material::getShaders(Gfx::RenderPassType renderPass, VertexInputType* vertexInput) const
{
Gfx::ShaderPermutation permutation;
permutation.passType = renderPass;
std::string materialName = getFileName();
std::string vertexInputName = vertexInput->getName();
std::memcpy(permutation.materialName, materialName.c_str(), sizeof(permutation.materialName));
std::memcpy(permutation.vertexInputName, vertexInputName.c_str(), sizeof(permutation.vertexInputName));