summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@vmware.com>2009-03-18 21:40:03 +0000
committerAlan Hourihane <alanh@vmware.com>2009-03-18 21:40:03 +0000
commit192b7bc706f0d014ecea1843230a4b1adbe2a45b (patch)
tree6898fc211ac4eb4894fb18f671bc8fa2f6caa3c9 /src/mesa/shader/slang
parent752296b8f311c5e3844f3ce89d17ba57224ce5ba (diff)
Revert "slang: if we detect an if/break or if/continue within a loop and we're"
This reverts commit 752296b8f311c5e3844f3ce89d17ba57224ce5ba.
Diffstat (limited to 'src/mesa/shader/slang')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index d5d0c2d45f..753e5c45c4 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -719,23 +719,6 @@ new_var(slang_assemble_ctx *A, slang_variable *var)
/**
- * Determine if the given operation is of a specific type.
- */
-static GLboolean
-is_operation_type(const slang_operation *oper, slang_operation_type type)
-{
- if (oper->type == type)
- return GL_TRUE;
- else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE ||
- oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) &&
- oper->num_children == 1)
- return is_operation_type(&oper->children[0], type);
- else
- return GL_FALSE;
-}
-
-
-/**
* Check if the given function is really just a wrapper for a
* basic assembly instruction.
*/
@@ -2636,17 +2619,6 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper)
if (!slang_operation_copy(body, &oper->children[3]))
return NULL;
- /*
- * If we detect an if/break or if/continue lets do the real loop
- * and forget unrolling.
- */
- if (body->children[1].type == SLANG_OPER_IF) {
- if (is_operation_type(&body->children[1].children[1], SLANG_OPER_BREAK))
- return NULL;
- if (is_operation_type(&body->children[1].children[1], SLANG_OPER_CONTINUE))
- return NULL;
- }
-
/* in body, replace instances of 'varId' with literal 'iter' */
{
slang_variable *oldVar;
@@ -2747,6 +2719,23 @@ _slang_gen_continue(slang_assemble_ctx * A, const slang_operation *oper)
/**
+ * Determine if the given operation is of a specific type.
+ */
+static GLboolean
+is_operation_type(const slang_operation *oper, slang_operation_type type)
+{
+ if (oper->type == type)
+ return GL_TRUE;
+ else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE ||
+ oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) &&
+ oper->num_children == 1)
+ return is_operation_type(&oper->children[0], type);
+ else
+ return GL_FALSE;
+}
+
+
+/**
* Generate IR tree for an if/then/else conditional using high-level
* IR_IF instruction.
*/