glsl: Add a virtual as_discard() method.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 25 Nov 2010 05:33:07 +0000 (21:33 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 25 Nov 2010 11:26:55 +0000 (03:26 -0800)
NOTE: This is candidate for the 7.9 branch.

src/glsl/ir.h

index 850033b..62bb0fd 100644 (file)
@@ -122,6 +122,7 @@ public:
    virtual class ir_if *                as_if()               { return NULL; }
    virtual class ir_swizzle *           as_swizzle()          { return NULL; }
    virtual class ir_constant *          as_constant()         { return NULL; }
+   virtual class ir_discard *           as_discard()          { return NULL; }
    /*@}*/
 
 protected:
@@ -1122,6 +1123,11 @@ public:
 
    virtual ir_visitor_status accept(ir_hierarchical_visitor *);
 
+   virtual ir_discard *as_discard()
+   {
+      return this;
+   }
+
    ir_rvalue *condition;
 };
 /*@}*/