From: Kenneth Graunke Date: Thu, 25 Nov 2010 05:33:07 +0000 (-0800) Subject: glsl: Add a virtual as_discard() method. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1eb7a81f2e43842acd59929ce65db2142b69134d;p=mesa.git glsl: Add a virtual as_discard() method. NOTE: This is candidate for the 7.9 branch. --- diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 850033b185f..62bb0fd7096 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -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; }; /*@}*/