-#ifndef MSP_GL_SL_COMPATIBILITY_H_
-#define MSP_GL_SL_COMPATIBILITY_H_
+#ifndef MSP_GL_SL_FINALIZE_H_
+#define MSP_GL_SL_FINALIZE_H_
#include <string>
#include "visitor.h"
namespace GL {
namespace SL {
+/** Assigns offset layout qualifiers to struct members. */
+class StructOrganizer: private TraversingVisitor
+{
+private:
+ int offset = -1;
+
+public:
+ void apply(Stage &s) { s.content.visit(*this); }
+
+private:
+ virtual void visit(StructDeclaration &);
+ virtual void visit(VariableDeclaration &);
+};
+
+/** Assigns location and binding layout qualifiers to interface variables and
+blocks. */
class LocationAllocator: private TraversingVisitor
{
private:
class PrecisionConverter: private TraversingVisitor
{
private:
- Stage *stage;
+ Stage *stage = 0;
std::set<std::string> have_default;
NodeList<Statement>::iterator insert_point;
std::set<Node *> nodes_to_remove;
public:
- PrecisionConverter();
-
void apply(Stage &);
private:
class LegacyConverter: private TraversingVisitor
{
private:
- Stage *stage;
+ Stage *stage = 0;
Features features;
- VariableDeclaration *frag_out;
+ VariableDeclaration *frag_out = 0;
NodeList<Statement>::iterator uniform_insert_point;
std::set<Node *> nodes_to_remove;
public:
- LegacyConverter();
-
virtual void apply(Stage &, const Features &);
private: