]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/finalize.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / glsl / finalize.h
index 79ba54b81b027c8b16743e0f1281b3e961611319..4fc2e1b00c42806768e0aca28b9166eb2284939b 100644 (file)
@@ -43,6 +43,10 @@ private:
        std::vector<VariableDeclaration *> unbound_textures;
        std::vector<VariableDeclaration *> unbound_blocks;
 
+       /* Dirty hack to work around an issue where vertex attributes prevent the
+       flat qualifier from working on the same location. */
+       std::set<unsigned> used_vertex_attribs;
+
 public:
        void apply(Module &, const Features &, bool = true);
 private:
@@ -56,6 +60,28 @@ private:
        virtual void visit(FunctionDeclaration &) { }
 };
 
+/**
+Converts the output depth range to match expectations of the target API.
+*/
+class DepthRangeConverter: private TraversingVisitor
+{
+private:
+       bool assignment_target = false;
+       bool r_gl_pervertex = false;
+       bool r_gl_position = false;
+       bool r_position_z_assigned = false;
+
+public:
+       void apply(Stage &, const Features &);
+
+private:
+       virtual void visit(VariableReference &);
+       virtual void visit(MemberAccess &);
+       virtual void visit(Swizzle &);
+       virtual void visit(Assignment &);
+       virtual void visit(FunctionDeclaration &);
+};
+
 /** Generates default precision declarations or removes precision declarations
 according to the requirements of the target API. */
 class PrecisionConverter: private TraversingVisitor