Renderer/ShaderAst: Add serialization
This commit is contained in:
@@ -103,9 +103,6 @@ void MainWindow::OnCompileToGLSL()
|
||||
{
|
||||
Nz::ShaderNodes::StatementPtr shaderAst = m_shaderGraph.ToAst();
|
||||
|
||||
Nz::File file("shader.shader", Nz::OpenMode_WriteOnly);
|
||||
file.Write(Nz::ShaderNodes::Serialize(shaderAst));
|
||||
|
||||
//TODO: Put in another function
|
||||
auto GetExpressionFromInOut = [&] (InOutType type)
|
||||
{
|
||||
@@ -145,6 +142,9 @@ void MainWindow::OnCompileToGLSL()
|
||||
|
||||
shader.AddFunction("main", shaderAst);
|
||||
|
||||
Nz::File file("shader.shader", Nz::OpenMode_WriteOnly);
|
||||
file.Write(Nz::SerializeShader(shader));
|
||||
|
||||
Nz::GlslWriter writer;
|
||||
Nz::String glsl = writer.Generate(shader);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user