diff options
author | Brian <brian@yutani.localnet.net> | 2007-01-04 14:40:02 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-01-04 14:40:02 -0700 |
commit | e64030060292cdab97096ee3924ef18b1f71111f (patch) | |
tree | 3b016885f7d2e678f8d22b54defcbf1b67c9db90 /src/mesa/shader/slang/slang_codegen.c | |
parent | 6a92d98d1a04629c09fae59585d94203580434c4 (diff) |
initial code to get texture sampling limping along
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r-- | src/mesa/shader/slang/slang_codegen.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 3fca45ce12..3b96ec0a88 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -91,6 +91,9 @@ static slang_asm_info AsmInfo[] = { { "float_multiply", IR_MUL, 1, 2 }, { "float_divide", IR_DIV, 1, 2 }, { "float_power", IR_POW, 1, 2 }, + /* texture / sampler */ + { "vec4_tex2d", IR_TEX, 1, 1 }, + { "vec4_texb2d", IR_TEXB, 1, 3 }, /* unary op */ { "int_to_float", IR_I_TO_F, 1, 1 }, { "float_exp", IR_EXP, 1, 1 }, @@ -791,10 +794,15 @@ _slang_gen_asm(slang_assemble_ctx *A, slang_operation *oper, n0 = _slang_gen_operation(A, dest_oper); assert(n0->Var); assert(n0->Store); - free(n0); n->Store = n0->Store; n->Writemask = writemask; + + free(n0); + } + + if (info->Opcode == IR_TEX || info->Opcode == IR_TEXB) { + n->TexTarget = TEXTURE_2D_INDEX; } return n; @@ -1571,7 +1579,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) CurFunction = fun; if (!CurFunction->end_label) - CurFunction->end_label = slang_atom_pool_gen(A->atoms, "__endOfFunction_Main"); + CurFunction->end_label = slang_atom_pool_gen(A->atoms, "__endOfFunc_main_"); n = _slang_gen_operation(A, fun->body); @@ -1583,7 +1591,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) CurFunction = NULL; -#if 0 +#if 1 printf("************* New body for %s *****\n", (char*)fun->header.a_name); slang_print_function(fun, 1); |