diff options
author | Brian <[email protected]> | 2007-01-31 08:55:10 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-01-31 08:55:10 -0700 |
commit | 309d5b665051179b7e135d7329da1ea45bfeb8e5 (patch) | |
tree | 49af2dba55623498a1eb895ed8794545f76ffdea /src/mesa/shader/slang/slang_codegen.c | |
parent | 9d5853813f90cf03581d5150b4f2d46fd847211b (diff) |
New asm instruction and IR_CLAMP node type to allow clamping to [0,1] with instruction saturate-write option. Not finished yet.
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 9b932ca71b4..cc2a0b27388 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -458,6 +458,7 @@ static slang_asm_info AsmInfo[] = { { "vec4_lrp", IR_LRP, 1, 3 }, { "vec4_min", IR_MIN, 1, 2 }, { "vec4_max", IR_MAX, 1, 2 }, + { "vec4_clamp", IR_CLAMP, 1, 3 }, { "vec4_seq", IR_SEQ, 1, 2 }, { "vec4_sge", IR_SGE, 1, 2 }, { "vec4_sgt", IR_SGT, 1, 2 }, @@ -1394,7 +1395,8 @@ _slang_gen_while(slang_assemble_ctx * A, const slang_operation *oper) tree = new_seq(tree, bra); body = _slang_gen_operation(A, &oper->children[1]); - tree = new_seq(tree, body); + if (body) + tree = new_seq(tree, body); jump = new_jump(startAtom); tree = new_seq(tree, jump); @@ -2167,7 +2169,10 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) case slang_oper_block_no_new_scope: /* list of operations */ + /* assert(oper->num_children > 0); + */ + if (oper->num_children > 0) { slang_ir_node *n, *tree = NULL; GLuint i; @@ -2434,6 +2439,9 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) case slang_oper_none: return NULL; + case slang_oper_void: + return NULL; + default: printf("Unhandled node type %d\n", oper->type); abort(); |