[Mesa-dev] [PATCH] glsl2: Empty functions can be inlined.

Tilman Sauerbeck tilman at code-monkey.de
Fri Sep 17 08:39:18 PDT 2010


Signed-off-by: Tilman Sauerbeck <tilman at code-monkey.de>
---
 src/glsl/ir_function_can_inline.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ir_function_can_inline.cpp b/src/glsl/ir_function_can_inline.cpp
index 8bb8e0d..4d3eb98 100644
--- a/src/glsl/ir_function_can_inline.cpp
+++ b/src/glsl/ir_function_can_inline.cpp
@@ -61,6 +61,9 @@ can_inline(ir_call *call)
    ir_function_can_inline_visitor v;
    const ir_function_signature *callee = call->get_callee();
 
+   if (callee->body.is_empty())
+      return true;
+
    v.run((exec_list *) &callee->body);
 
    ir_instruction *last = (ir_instruction *)callee->body.get_tail();
-- 
1.7.2.3



More information about the mesa-dev mailing list