its running i think

This commit is contained in:
Dynamitos
2023-11-09 22:15:51 +01:00
parent 19c3e559b1
commit effb0c6214
34 changed files with 299 additions and 249 deletions
+4 -8
View File
@@ -53,32 +53,28 @@ void ShaderCompiler::compile()
ShaderPermutation permutation;
for (const auto& [name, pass] : passes)
{
permutation.hasFragment = pass.hasFragmentShader;
permutation.useMeshShading = pass.useMeshShading;
permutation.hasTaskShader = pass.hasTaskShader;
std::strncpy(permutation.vertexMeshFile, pass.mainFile.c_str(), sizeof(permutation.vertexMeshFile));
if (pass.hasFragmentShader)
{
std::strncpy(permutation.fragmentFile, pass.fragmentFile.c_str(), sizeof(permutation.fragmentFile));
permutation.setFragmentFile(pass.fragmentFile);
}
if (pass.hasTaskShader)
{
std::strncpy(permutation.taskFile, pass.taskFile.c_str(), sizeof(permutation.taskFile));
permutation.setTaskFile(pass.taskFile);
}
for (const auto& [vdName, vd] : vertexData)
{
std::strncpy(permutation.vertexDataName, vd->getTypeName().c_str(), sizeof(permutation.vertexDataName));
permutation.setVertexData(vd->getTypeName());
if (pass.useMaterial)
{
for (const auto& [matName, mat] : materials)
{
std::strncpy(permutation.materialName, matName.c_str(), sizeof(permutation.materialName));
permutation.setMaterial(mat->getName());
createShaders(permutation);
}
}
else
{
std::memset(permutation.materialName, 0, sizeof(permutation.materialName));
createShaders(permutation);
}
}