X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foptimize.h;h=ed9f91345f71b405209e3b6a32f7adec0d5ebeb3;hb=3c2397dbb6e45fe72214f71048c4edfe4f11ac73;hp=e21dd98fd0fcbe63e578e3012cd072d108c5437d;hpb=55a18f710f07c51f05d0dc55741a7f3cc8e70cdd;p=libs%2Fgl.git diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index e21dd98f..ed9f9134 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -175,13 +175,14 @@ public: bool apply(Stage &s) { s.content.visit(*this); return r_any_folded; } private: - static BasicTypeDeclaration::Kind get_value_kind(const Variant &); template static T evaluate_logical(char, T, T); template static bool evaluate_relation(const char *, T, T); template static T evaluate_arithmetic(char, T, T); + template + static T evaluate_int_special_op(char, T, T); void set_result(const Variant &, bool = false); virtual void visit(RefPtr &); @@ -300,6 +301,7 @@ private: Assignment *r_assignment; bool assignment_target; bool r_side_effects; + bool in_struct; bool composite_reference; Assignment::Target r_reference; std::set unused_nodes; @@ -323,8 +325,7 @@ private: virtual void visit(FunctionCall &); void record_assignment(const Assignment::Target &, Node &); virtual void visit(ExpressionStatement &); - // Ignore structs because their members can't be accessed directly. - virtual void visit(StructDeclaration &) { } + virtual void visit(StructDeclaration &); virtual void visit(VariableDeclaration &); virtual void visit(InterfaceBlock &); void merge_variables(const BlockVariableMap &);