Fixing visibility generation

This commit is contained in:
Dynamitos
2024-05-31 14:21:32 +02:00
parent 953c90f2de
commit 157368a241
14 changed files with 232 additions and 717 deletions
+23 -13
View File
@@ -42,11 +42,31 @@ BasePass::BasePass(Gfx::PGraphics graphics, PScene scene)
if (graphics->supportMeshShading())
{
graphics->getShaderCompiler()->registerRenderPass(basePassLayout, "BasePass", "MeshletPass", true, true, "BasePass", true, true, "DrawListTask");
graphics->getShaderCompiler()->registerRenderPass("BasePass", Gfx::PassConfig {
.baseLayout = basePassLayout,
.taskFile = "DrawListTask",
.mainFile = "MeshletPass",
.fragmentFile = "BasePass",
.hasFragmentShader = true,
.useMeshShading = true,
.hasTaskShader = true,
.useMaterial = true,
.useVisibility = false,
});
}
else
{
graphics->getShaderCompiler()->registerRenderPass(basePassLayout, "BasePass", "LegacyPass", true, true, "BasePass");
graphics->getShaderCompiler()->registerRenderPass("BasePass", Gfx::PassConfig {
.baseLayout = basePassLayout,
.taskFile = "",
.mainFile = "LegacyPass",
.fragmentFile = "BasePass",
.hasFragmentShader = true,
.useMeshShading = false,
.hasTaskShader = false,
.useMaterial = true,
.useVisibility = false,
});
}
}
@@ -88,17 +108,7 @@ void BasePass::render()
graphics->beginRenderPass(renderPass);
Array<Gfx::ORenderCommand> commands;
Gfx::ShaderPermutation permutation;
if (graphics->supportMeshShading())
{
permutation.setTaskFile("DrawListTask");
permutation.setMeshFile("MeshletPass");
}
else
{
permutation.setVertexFile("LegacyPass");
}
permutation.setFragmentFile("BasePass");
Gfx::ShaderPermutation permutation = graphics->getShaderCompiler()->getTemplate("BasePass");
permutation.setViewCulling(useViewCulling);
for (VertexData* vertexData : VertexData::getList())
{