From: Ian Romanick <ian.d.roman...@intel.com> Now that they're all implemented using macros, this is trivial.
Signed-off-by: Ian Romanick <ian.d.roman...@intel.com> Cc: Francisco Jerez <curroje...@riseup.net> --- src/glsl/ir.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/glsl/ir.h b/src/glsl/ir.h index ff30263..7294629 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -147,6 +147,11 @@ public: { \ assume(this != NULL); \ return (is_##TYPE()) ? (ir_##TYPE *) this : NULL; \ + } \ + const class ir_##TYPE *as_##TYPE() const \ + { \ + assume(this != NULL); \ + return (is_##TYPE()) ? (ir_##TYPE *) this : NULL; \ } AS_BASE(rvalue) @@ -159,6 +164,11 @@ public: { \ assume(this != NULL); \ return ir_type == ir_type_##TYPE ? (ir_##TYPE *) this : NULL; \ + } \ + const class ir_##TYPE * as_##TYPE() const \ + { \ + assume(this != NULL); \ + return ir_type == ir_type_##TYPE ? (const ir_##TYPE *) this : NULL; \ } AS_CHILD(variable) AS_CHILD(function) -- 2.1.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev