diff options
author | michal <michal@michal-laptop.(none)> | 2007-08-06 17:15:37 +0100 |
---|---|---|
committer | michal <michal@michal-laptop.(none)> | 2007-08-06 17:15:37 +0100 |
commit | 76478a470660becaceb09c7217b8c73601b1e92a (patch) | |
tree | e714da96b1acbda0d1097bf35be750db330ebc90 | |
parent | 10fd2742c698d8f4a43b3a7b9506e8d95bf56f4f (diff) |
Make SGE, SGT, SLE working.
-rw-r--r-- | src/mesa/pipe/tgsi/core/tgsi_exec.c | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/src/mesa/pipe/tgsi/core/tgsi_exec.c b/src/mesa/pipe/tgsi/core/tgsi_exec.c index 6aaaef98a8..9a42878e0a 100644 --- a/src/mesa/pipe/tgsi/core/tgsi_exec.c +++ b/src/mesa/pipe/tgsi/core/tgsi_exec.c @@ -358,6 +358,20 @@ micro_frc( } static void +micro_ge( + union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2, + const union tgsi_exec_channel *src3 ) +{ + dst->f[0] = src0->f[0] >= src1->f[0] ? src2->f[0] : src3->f[0]; + dst->f[1] = src0->f[1] >= src1->f[1] ? src2->f[1] : src3->f[1]; + dst->f[2] = src0->f[2] >= src1->f[2] ? src2->f[2] : src3->f[2]; + dst->f[3] = src0->f[3] >= src1->f[3] ? src2->f[3] : src3->f[3]; +} + +static void micro_i2f( union tgsi_exec_channel *dst, const union tgsi_exec_channel *src ) @@ -1508,12 +1522,10 @@ exec_instruction( case TGSI_OPCODE_SGE: /* TGSI_OPCODE_SETGE */ FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - - micro_lt( &r[0], &r[0], &r[1], &mach->Temps[TEMP_0_I].xyzw[TEMP_0_C], &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C] ); - - STORE(&r[0], 0, chan_index); + FETCH( &r[0], 0, chan_index ); + FETCH( &r[1], 1, chan_index ); + micro_ge( &r[0], &r[0], &r[1], &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C], &mach->Temps[TEMP_0_I].xyzw[TEMP_0_C] ); + STORE( &r[0], 0, chan_index ); } break; @@ -1785,21 +1797,29 @@ exec_instruction( break; case TGSI_OPCODE_SGT: - assert (0); + FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { + FETCH( &r[0], 0, chan_index ); + FETCH( &r[1], 1, chan_index ); + micro_lt( &r[0], &r[0], &r[1], &mach->Temps[TEMP_0_I].xyzw[TEMP_0_C], &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C] ); + STORE( &r[0], 0, chan_index ); + } break; case TGSI_OPCODE_SIN: - FETCH(&r[0], 0, CHAN_X); - + FETCH( &r[0], 0, CHAN_X ); micro_sin( &r[0], &r[0] ); - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - STORE( &r[0], 0, chan_index ); + STORE( &r[0], 0, chan_index ); } break; case TGSI_OPCODE_SLE: - assert (0); + FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { + FETCH( &r[0], 0, chan_index ); + FETCH( &r[1], 1, chan_index ); + micro_ge( &r[0], &r[0], &r[1], &mach->Temps[TEMP_0_I].xyzw[TEMP_0_C], &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C] ); + STORE( &r[0], 0, chan_index ); + } break; case TGSI_OPCODE_SNE: |