[Mesa-dev] [PATCH 1/2] glsl: Add virtual function ir_instruction::as_jump()

Paul Berry stereotype441 at gmail.com
Tue Apr 23 10:25:15 PDT 2013


---
 src/glsl/ir.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 3018e0f..878a946 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -131,6 +131,7 @@ public:
    virtual class ir_swizzle *           as_swizzle()          { return NULL; }
    virtual class ir_constant *          as_constant()         { return NULL; }
    virtual class ir_discard *           as_discard()          { return NULL; }
+   virtual class ir_jump *              as_jump()             { return NULL; }
    /*@}*/
 
 protected:
@@ -1298,6 +1299,12 @@ protected:
    {
       ir_type = ir_type_unset;
    }
+
+public:
+   virtual ir_jump *as_jump()
+   {
+      return this;
+   }
 };
 
 class ir_return : public ir_jump {
-- 
1.8.2.1



More information about the mesa-dev mailing list