X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ffinalize.h;h=ec5f459ae53b59f1db6371dedcc2928e6d75cd36;hb=b6c4e1a794276ca343c0c9bb0a300e729ca41931;hp=79ba54b81b027c8b16743e0f1281b3e961611319;hpb=03b2ea5c9c611cfa5f02afb49ed7e05743e691b4;p=libs%2Fgl.git diff --git a/source/glsl/finalize.h b/source/glsl/finalize.h index 79ba54b8..ec5f459a 100644 --- a/source/glsl/finalize.h +++ b/source/glsl/finalize.h @@ -56,6 +56,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