diff options
author | Brian <[email protected]> | 2006-12-13 14:48:36 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2006-12-13 14:48:36 -0700 |
commit | aff8e204d205b5d424d2c39a5d9e004caaa1eab1 (patch) | |
tree | 91d06d422f8900af461233186bcc79351c3025f6 /src/mesa/shader/slang/slang_execute.c | |
parent | 5b35132b41427798e02a66a8e39583fffbe9d232 (diff) |
Checkpoint new GLSL compiler back-end to produce fp/vp-style assembly instructions.
Diffstat (limited to 'src/mesa/shader/slang/slang_execute.c')
-rw-r--r-- | src/mesa/shader/slang/slang_execute.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_execute.c b/src/mesa/shader/slang/slang_execute.c index e469de02075..09401b8910a 100644 --- a/src/mesa/shader/slang/slang_execute.c +++ b/src/mesa/shader/slang/slang_execute.c @@ -392,12 +392,16 @@ _slang_execute2(const slang_assembly_file * file, slang_machine * mach) case slang_asm_int_copy: case slang_asm_bool_copy: /* store top value on stack to memory */ +#if 0 { GLuint address = (stack[mach->sp + a->param[0] / 4]._addr + a->param[1]) / 4; GLfloat value = stack[mach->sp]._float; mach->mem[address]._float = value; } +#else + mach->mem[(stack[mach->sp + a->param[0] / 4]._addr +a->param[1]) / 4]._float = stack[mach->sp]._float; +#endif mach->sp++; break; case slang_asm_float_move: @@ -425,6 +429,10 @@ _slang_execute2(const slang_assembly_file * file, slang_machine * mach) stack[mach->sp + 1]._float += stack[mach->sp]._float; mach->sp++; break; + case slang_asm_float_subtract: + stack[mach->sp + 1]._float -= stack[mach->sp]._float; + mach->sp++; + break; case slang_asm_float_multiply: stack[mach->sp + 1]._float *= stack[mach->sp]._float; mach->sp++; @@ -476,12 +484,14 @@ _slang_execute2(const slang_assembly_file * file, slang_machine * mach) case slang_asm_float_log2: stack[mach->sp]._float = LOG2(stack[mach->sp]._float); break; +#if 0 case slang_asm_float_floor: stack[mach->sp]._float = FLOORF(stack[mach->sp]._float); break; case slang_asm_float_ceil: stack[mach->sp]._float = CEILF(stack[mach->sp]._float); break; +#endif case slang_asm_float_noise1: stack[mach->sp]._float = _slang_library_noise1(stack[mach->sp]._float); @@ -718,6 +728,7 @@ _slang_execute2(const slang_assembly_file * file, slang_machine * mach) -mach->mem[(da + 12) / 4]._float; } break; +#if 0 case slang_asm_vec4_dot: /* [vec4] | vec4 > [float] */ { @@ -730,6 +741,7 @@ _slang_execute2(const slang_assembly_file * file, slang_machine * mach) mach->sp += 4; } break; +#endif case slang_asm_vec4_copy: /* [vec4] | vec4 > [vec4] */ { @@ -768,6 +780,19 @@ _slang_execute2(const slang_assembly_file * file, slang_machine * mach) } } break; + case slang_asm_vec4_dot: + case slang_asm_vec3_dot: + { + /* XXX almost certainly wrong */ + GLuint da = stack[mach->sp + 4]._addr; + mach->mem[da / 4]._float = + mach->mem[da / 4]._float * stack[mach->sp]._float + + mach->mem[(da + 4) / 4]._float * stack[mach->sp + 1]._float + + mach->mem[(da + 8) / 4]._float * stack[mach->sp + 2]._float + + mach->mem[(da + 12) / 4]._float * stack[mach->sp + 3]._float; + mach->sp += 4; + } + break; default: _mesa_problem(NULL, "bad slang opcode 0x%x", a->type); return GL_FALSE; |