From 26d74cd1d140786b8f4b1ccbaf500a16e68eec3c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 26 May 2010 17:42:03 -0700 Subject: [PATCH] Add stub visitor support for ir_texture. --- ir.h | 7 +++++++ ir_constant_expression.cpp | 10 ++++++++++ ir_constant_folding.cpp | 9 +++++++++ ir_function_inlining.cpp | 18 ++++++++++++++++++ ir_hierarchical_visitor.cpp | 14 ++++++++++++++ ir_hierarchical_visitor.h | 2 ++ ir_hv_accept.cpp | 6 ++++++ ir_visitor.h | 1 + 8 files changed, 67 insertions(+) diff --git a/ir.h b/ir.h index 44ffdc554ee..a286e7b9324 100644 --- a/ir.h +++ b/ir.h @@ -775,6 +775,13 @@ public: /* empty */ } + virtual void accept(ir_visitor *v) + { + v->visit(this); + } + + virtual ir_visitor_status accept(ir_hierarchical_visitor *); + /** * Return a string representing the ir_texture_opcode. */ diff --git a/ir_constant_expression.cpp b/ir_constant_expression.cpp index 361a7a1630a..e89b5bc7685 100644 --- a/ir_constant_expression.cpp +++ b/ir_constant_expression.cpp @@ -67,6 +67,7 @@ public: virtual void visit(ir_function_signature *); virtual void visit(ir_function *); virtual void visit(ir_expression *); + virtual void visit(ir_texture *); virtual void visit(ir_swizzle *); virtual void visit(ir_dereference_variable *); virtual void visit(ir_dereference_array *); @@ -502,6 +503,15 @@ ir_constant_visitor::visit(ir_expression *ir) } +void +ir_constant_visitor::visit(ir_texture *ir) +{ + // FINISHME: Do stuff with texture lookups + (void) ir; + value = NULL; +} + + void ir_constant_visitor::visit(ir_swizzle *ir) { diff --git a/ir_constant_folding.cpp b/ir_constant_folding.cpp index b3f27c80c85..5dc4a7dc654 100644 --- a/ir_constant_folding.cpp +++ b/ir_constant_folding.cpp @@ -60,6 +60,7 @@ public: virtual void visit(ir_function_signature *); virtual void visit(ir_function *); virtual void visit(ir_expression *); + virtual void visit(ir_texture *); virtual void visit(ir_swizzle *); virtual void visit(ir_dereference_variable *); virtual void visit(ir_dereference_array *); @@ -114,6 +115,14 @@ ir_constant_folding_visitor::visit(ir_expression *ir) } +void +ir_constant_folding_visitor::visit(ir_texture *ir) +{ + // FINISHME: Do stuff with texture lookups + (void) ir; +} + + void ir_constant_folding_visitor::visit(ir_swizzle *ir) { diff --git a/ir_function_inlining.cpp b/ir_function_inlining.cpp index 7cc8a325ffa..d66eceedb86 100644 --- a/ir_function_inlining.cpp +++ b/ir_function_inlining.cpp @@ -50,6 +50,7 @@ public: virtual ir_visitor_status visit_enter(ir_call *); virtual ir_visitor_status visit_enter(ir_assignment *); virtual ir_visitor_status visit_enter(ir_return *); + virtual ir_visitor_status visit_enter(ir_texture *); virtual ir_visitor_status visit_enter(ir_swizzle *); bool progress; @@ -118,6 +119,7 @@ public: virtual void visit(ir_function_signature *); virtual void visit(ir_function *); virtual void visit(ir_expression *); + virtual void visit(ir_texture *); virtual void visit(ir_swizzle *); virtual void visit(ir_dereference_variable *); virtual void visit(ir_dereference_array *); @@ -196,6 +198,14 @@ ir_function_cloning_visitor::visit(ir_expression *ir) } +void +ir_function_cloning_visitor::visit(ir_texture *ir) +{ + // FINISHME: Do stuff with texture lookups + (void) ir; +} + + void ir_function_cloning_visitor::visit(ir_swizzle *ir) { @@ -436,6 +446,14 @@ ir_function_inlining_visitor::visit_enter(ir_return *ir) } +ir_visitor_status +ir_function_inlining_visitor::visit_enter(ir_texture *ir) +{ + (void) ir; + return visit_continue_with_parent; +} + + ir_visitor_status ir_function_inlining_visitor::visit_enter(ir_swizzle *ir) { diff --git a/ir_hierarchical_visitor.cpp b/ir_hierarchical_visitor.cpp index ad474878355..fd77391973f 100644 --- a/ir_hierarchical_visitor.cpp +++ b/ir_hierarchical_visitor.cpp @@ -108,6 +108,20 @@ ir_hierarchical_visitor::visit_leave(ir_expression *ir) return visit_continue; } +ir_visitor_status +ir_hierarchical_visitor::visit_enter(ir_texture *ir) +{ + (void) ir; + return visit_continue; +} + +ir_visitor_status +ir_hierarchical_visitor::visit_leave(ir_texture *ir) +{ + (void) ir; + return visit_continue; +} + ir_visitor_status ir_hierarchical_visitor::visit_enter(ir_swizzle *ir) { diff --git a/ir_hierarchical_visitor.h b/ir_hierarchical_visitor.h index d3ba508cf1c..85bc5bb150b 100644 --- a/ir_hierarchical_visitor.h +++ b/ir_hierarchical_visitor.h @@ -113,6 +113,8 @@ public: virtual ir_visitor_status visit_leave(class ir_function *); virtual ir_visitor_status visit_enter(class ir_expression *); virtual ir_visitor_status visit_leave(class ir_expression *); + virtual ir_visitor_status visit_enter(class ir_texture *); + virtual ir_visitor_status visit_leave(class ir_texture *); virtual ir_visitor_status visit_enter(class ir_swizzle *); virtual ir_visitor_status visit_leave(class ir_swizzle *); virtual ir_visitor_status visit_enter(class ir_dereference_array *); diff --git a/ir_hv_accept.cpp b/ir_hv_accept.cpp index 8d535e24faa..7c1798a051a 100644 --- a/ir_hv_accept.cpp +++ b/ir_hv_accept.cpp @@ -156,6 +156,12 @@ done: return v->visit_leave(this); } +ir_visitor_status +ir_texture::accept(ir_hierarchical_visitor *v) +{ + return visit_continue_with_parent; +} + ir_visitor_status ir_swizzle::accept(ir_hierarchical_visitor *v) diff --git a/ir_visitor.h b/ir_visitor.h index ba30858fe62..a6f9d2b7ee3 100644 --- a/ir_visitor.h +++ b/ir_visitor.h @@ -48,6 +48,7 @@ public: virtual void visit(class ir_function_signature *) = 0; virtual void visit(class ir_function *) = 0; virtual void visit(class ir_expression *) = 0; + virtual void visit(class ir_texture *) = 0; virtual void visit(class ir_swizzle *) = 0; virtual void visit(class ir_dereference_variable *) = 0; virtual void visit(class ir_dereference_array *) = 0; -- 2.30.2